barrettc
barrettc
JJanusGraph
Created by barrettc on 10/29/2024 in #questions
Best practices recommendation for Kotlin?
What, if any, are best practices recommendations when using the Java API from a Kotlin coroutine environment? Are there plans to support an asynchronous Java client in the future?
2 replies
JJanusGraph
Created by barrettc on 10/9/2024 in #questions
Trying to connect to JanusGraph server/Cassandra with Kotlin client
I'm new to JanusGraph and attempting to connect to a remote server from a Kotlin client. I have created two Docker containers and everything looks good from the logs of JanusGraph:
docker run -d -p 7000:7000 -p 7001:7001 -p 7199:7199 -p 9042:9042 -p 9160:9160 -e CASSANDRA_START_RPC=true cassandra:4.0.6
docker run -d -p 7000:7000 -p 7001:7001 -p 7199:7199 -p 9042:9042 -p 9160:9160 -e CASSANDRA_START_RPC=true cassandra:4.0.6
docker run -d -p 8182:8182 -p 8184:8184 -e JANUS_PROPS_TEMPLATE=cql -e janusgraph.storage.hostname=host.docker.internal janusgraph/janusgraph:1.0.0
docker run -d -p 8182:8182 -p 8184:8184 -e JANUS_PROPS_TEMPLATE=cql -e janusgraph.storage.hostname=host.docker.internal janusgraph/janusgraph:1.0.0
I'm following the Connecting from Java directions with both conf/remote-graph.properties and conf/remote-objects.yaml available. In my Kotlin client, I'm just running:
val g = traversal().withRemote("conf/remote-graph.properties")
g.addV("person").property("name", "john").next()
val g = traversal().withRemote("conf/remote-graph.properties")
g.addV("person").property("name", "john").next()
The error I get is:
java.lang.UnsupportedOperationException: Graph does not support adding vertices
at org.apache.tinkerpop.gremlin.structure.Graph$Exceptions.vertexAdditionsNotSupported(Graph.java:1248)
at org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph.addVertex(EmptyGraph.java:60)
at org.apache.tinkerpop.gremlin.structure.Graph.addVertex(Graph.java:128)
java.lang.UnsupportedOperationException: Graph does not support adding vertices
at org.apache.tinkerpop.gremlin.structure.Graph$Exceptions.vertexAdditionsNotSupported(Graph.java:1248)
at org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph.addVertex(EmptyGraph.java:60)
at org.apache.tinkerpop.gremlin.structure.Graph.addVertex(Graph.java:128)
I've seen other questions out there that involve adding snippets to the server yaml and/or groovy scripts but I'm not sure what is necessary. I'm trying to keep this as simple as possible to start. Appreciate any tips!
2 replies