Created
June 7, 2012 12:17
-
-
Save spmallette/2888507 to your computer and use it in GitHub Desktop.
cassandra start/stop and gremlin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gremlin> conf = new BaseConfiguration() | |
==>org.apache.commons.configuration.BaseConfiguration@301abf87 | |
gremlin> conf.setProperty("storage.backend", "cassandra") | |
==>null | |
gremlin> conf.setProperty("storage.hostname", "127.0.0.1") | |
==>null | |
gremlin> g = TitanFactory.open(conf) | |
==>standardtitangraph[cassandra] | |
gremlin> g.createKeyIndex("someid", Vertex.class) | |
==>null | |
gremlin> g.stopTransaction(SUCCESS) | |
==>null | |
gremlin> v = g.addVertex(null) | |
==>v[4] | |
gremlin> v.setProperty("someid", 123) | |
==>null | |
gremlin> g.stopTransaction(SUCCESS) | |
==>null | |
gremlin> g.shutdown() | |
==>null | |
-- stop and restart cassandra | |
gremlin> g = TitanFactory.open(conf) | |
==>standardtitangraph[cassandra] | |
gremlin> g.shutdown() | |
==>null | |
-- stop cassandra, delete the cassandra related data directories and restart cassandra | |
gremlin> g = TitanFactory.open(conf) | |
Exception in storage backend. | |
Display stack trace? [yN] y | |
com.thinkaurelius.titan.core.GraphStorageException: Exception in storage backend. | |
at com.thinkaurelius.titan.diskstorage.cassandra.thriftpool.UncheckedGenericKeyedObjectPool.borrowObject(UncheckedGenericKeyedObjectPool.java:44) | |
at com.thinkaurelius.titan.diskstorage.cassandra.thriftpool.UncheckedGenericKeyedObjectPool.genericBorrowObject(UncheckedGenericKeyedObjectPool.java:74) | |
at com.thinkaurelius.titan.diskstorage.cassandra.CassandraThriftOrderedKeyColumnValueStore.getSlice(CassandraThriftOrderedKeyColumnValueStore.java:157) | |
at com.thinkaurelius.titan.diskstorage.cassandra.CassandraThriftOrderedKeyColumnValueStore.getSlice(CassandraThriftOrderedKeyColumnValueStore.java:192) | |
at com.thinkaurelius.titan.diskstorage.util.OrderedKeyColumnValueIDManager.getIDBlock(OrderedKeyColumnValueIDManager.java:68) | |
at com.thinkaurelius.titan.diskstorage.cassandra.CassandraThriftStorageManager.getIDBlock(CassandraThriftStorageManager.java:208) | |
at com.thinkaurelius.titan.graphdb.database.idassigner.StandardIDPool.renewBuffer(StandardIDPool.java:73) | |
at com.thinkaurelius.titan.graphdb.database.idassigner.StandardIDPool.<init>(StandardIDPool.java:42) | |
at com.thinkaurelius.titan.graphdb.database.idassigner.SimpleVertexIDAssigner.<init>(SimpleVertexIDAssigner.java:42) | |
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.getIDAssigner(GraphDatabaseConfiguration.java:308) | |
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.<init>(StandardTitanGraph.java:83) | |
at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:60) | |
at com.thinkaurelius.titan.core.TitanFactory$open.call(Unknown Source) | |
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) | |
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) | |
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) | |
at groovysh_evaluate.run(groovysh_evaluate:39) | |
at groovysh_evaluate$run.call(Unknown Source) | |
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) | |
at groovysh_evaluate$run.call(Unknown Source) | |
at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:67) | |
at org.codehaus.groovy.tools.shell.Interpreter$evaluate.call(Unknown Source) | |
at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:152) | |
at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:114) | |
at org.codehaus.groovy.tools.shell.Shell$leftShift$0.call(Unknown Source) | |
at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:88) | |
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) | |
at java.lang.reflect.Method.invoke(Unknown Source) | |
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) | |
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) | |
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1047) | |
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128) | |
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:148) | |
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:100) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) | |
at java.lang.reflect.Method.invoke(Unknown Source) | |
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:267) | |
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52) | |
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:137) | |
at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:57) | |
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) | |
at java.lang.reflect.Method.invoke(Unknown Source) | |
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) | |
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) | |
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1047) | |
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128) | |
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:148) | |
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:66) | |
at com.thinkaurelius.titan.util.gremlin.Console.<init>(Console.java:52) | |
at com.thinkaurelius.titan.util.gremlin.Console.<init>(Console.java:59) | |
at com.thinkaurelius.titan.util.gremlin.Console.main(Console.java:64) | |
Caused by: InvalidRequestException(why:Keyspace titan does not exist) | |
at org.apache.cassandra.thrift.Cassandra$set_keyspace_result.read(Cassandra.java:4790) | |
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78) | |
at org.apache.cassandra.thrift.Cassandra$Client.recv_set_keyspace(Cassandra.java:480) | |
at org.apache.cassandra.thrift.Cassandra$Client.set_keyspace(Cassandra.java:467) | |
at com.thinkaurelius.titan.diskstorage.cassandra.thriftpool.CTConnectionFactory.makeObject(CTConnectionFactory.java:69) | |
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1190) | |
at com.thinkaurelius.titan.diskstorage.cassandra.thriftpool.UncheckedGenericKeyedObjectPool.borrowObject(UncheckedGenericKeyedObjectPool.java:42) | |
... 58 more | |
gremlin> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment