Cassandra keyspace (storage.cassandra.keyspace) and (titan and titan-version)
Trying to migrate my graph to JanusGraph, but apparently cassandra keyspace changed from titan to janusgraph, which makes sense, so I just updated the prop storage.cassandra.keyspace to titan so I could access my data as it was before, now it complains about janusgraph-version..
Some debugging indicated me that if I also provide "titan-version" it works, but I don't have that option as of now, so now what to do? Should I migrate (please don't tell me that) to a new janusgraph?
If I replace the following line https://github.com/JanusGraph/janusgraph/blob/master/janusgraph-core/src/main/java/org/janusgraph/graphdb/configuration/GraphDatabaseConfiguration.java#L1384 with:
globalWrite.get(new ConfigOption<String>(GRAPH_NS,"titan-version",
"The version of JanusGraph with which this database was created. Automatically set on first start. Don't manually set this property.",
ConfigOption.Type.FIXED, String.class).hide())
This is the error I'm getting with keyspace set to titan.
Caused by: java.lang.IllegalStateException: Need to set configuration value: root.graph.janusgraph-version
at com.google.common.base.Preconditions.checkState(Preconditions.java:197) ~[guava-18.0.jar:na]
at org.janusgraph.diskstorage.configuration.ConfigOption.get(ConfigOption.java:230) ~[janusgraph-core-0.1.0-SNAPSHOT.jar:na]
at org.janusgraph.diskstorage.configuration.BasicConfiguration.get(BasicConfiguration.java:70) ~[janusgraph-core-0.1.0-SNAPSHOT.jar:na]
at org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1384) ~[janusgraph-core-0.1.0-SNAPSHOT.jar:na]
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:108) ~[janusgraph-core-0.1.0-SNAPSHOT.jar:na]
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:98) ~[janusgraph-core-0.1.0-SNAPSHOT.jar:na]
at org.janusgraph.core.JanusGraphFactory$Builder.open(JanusGraphFactory.java:153) ~[janusgraph-core-0.1.0-SNAPSHOT.jar:na]
Without keyspace to titan, it just seems to be an empty graph for obvious reasons.
Thanks for the report and sorry for the trouble! That looks like a bug in JanusGraph.
As part of the migration from the name Titan to JanusGraph, we replaced all code and constances from titan-* to janusgraph-* but we did not set compatible versions, so we need to update GraphDatabaseConfiguration.java as well as JanusGraphConstants.java to do the following:
- allow
titan-versionas a valid configuration key for backwards-compatibility with Titan - allow
janusgraph-versionas a valid config key for folks who start with JanusGraph - set up compatible versions both for Titan 1.0 as well as JanusGraph 0.1.0-SNAPSHOT
If you're up for making these changes, we'd love to accept your contribution! Otherwise, we'll need someone to pick this up to fix this issue.
Sure, I'll pick it up tomorrow and send a fix
@rafatuita — thanks!
Please note that we'll need you (or an authorized officer of your company) to sign either the ICLA or CCLA, as appropriate, before we can accept any contributions.
got the fix ready, the approach I took was to go first on JanusGraph version, try/catch for the exception and look or a compatibility with titan and their versions, so it always tries janus first, if fails, go compatible check.
janusgraph.compatible.versions are stored on main pom.xmlfile, so I just added titan.backward.compatible.versions with those IDs 1.0.0,1.1.0-SNAPSHOT.
Since this is just a compatibility issue, didn't see a reason to work on this https://github.com/JanusGraph/janusgraph/blob/ec441ac6d87f3359c9740075786ec6de3651745e/janusgraph-dist/src/release/release.sh
let me know your thoughts.
@rafatuita good work on this one, can we close it out at this point?
@twilmes sure, you can close it by now.
Thanks @rafatuita. Closing as fixed by #80.