Graph does not support the provided graph computer: SparkGraphComputer

Hi, I'm trying to instantiate a janusgraph server that correctly exports a graph.traversal().withComputer(SparkGraphComputer) As I was unable to find specific documentation on this, I have tried following this: https://stackoverflow.com/questions/45323666/unable-to-use-sparkgraphcomputer-with-tinkerpop-3-2-3-and-janusgraph-0-1-1-in-re However, I'm unable to instantiate a graph of this type: hadoopgraph[cassandrainputformat->gryooutputformat]. When I attempt to use graph: conf/hadoop-graph/read-cql.properties in the server configuration .yaml file, I get the following server error: Need to set configuration value: root.storage.backend If I set the storage backend by adding storage.backend=cql and storage.cql.keyspace=janusgraph I'm able to start the janusgraph server, but when I attempt to use the og traversal source, I get the following error: Graph does not support the provided graph computer: SparkGraphComputer Does anyone have any suggestions on how to properly setup a janusgraph server so that queries are executed using SparkGraphComputer? BTW: I'm able to correctly run queries from the gremlin console, by following the example in the official janusgraph documentation: https://docs.janusgraph.org/advanced-topics/hadoop/ But what I'm interested in is instantiating a janusgraph server that by defualt runs all queries on a given traveral source using SparkGraphComputer.
Stack Overflow
Unable to use SparkGraphComputer with Tinkerpop 3.2.3 and Janusgrap...
I have set up Tinkerpop Gremlin Server 3.2.3 and Tinkerpop Gremlin Console 3.2.3 and added janusgraph 0.1.1 as plugin to both. I run following code in remote mode which ends up in below-listed exc...
Solution:
OK, finally I was able to figure out the issue on my own. To make things work, since JanusGraphFactory fails to create a graph, I replaced
graphManager: org.janusgraph.graphdb.management.JanusGraphManager
graphManager: org.janusgraph.graphdb.management.JanusGraphManager
with...
Jump to solution
4 Replies
rpuga
rpugaOP2w ago
I wanted to provide an update on this issue. From the janusgraph server logs (attached), it's clear that the janusgraph server uses JanusGraphFactory to open the graph
org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:115) ~[janusgraph-core-1.1.0.jar:?]
org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:115) ~[janusgraph-core-1.1.0.jar:?]
The same error can be reproduced in the gremlin console:
plugin activated: tinkerpop.hadoop
plugin activated: tinkerpop.spark
plugin activated: tinkerpop.utilities
plugin activated: janusgraph.imports
gremlin>
gremlin> graph = JanusGraphFactory.open("conf/hadoop-graph/spark-cql-es.properties")
23:18:43 INFO org.apache.commons.beanutils.FluentPropertyBeanIntrospector.introspect - Error when creating PropertyDescriptor for public final void org.apache.commons.configuration2.AbstractConfiguration.setProperty(java.lang.String,java.lang.Object)! Ignoring this property.
Need to set configuration value: root.storage.backend
Type ':help' or ':h' for help.
Display stack trace? [yN]n
plugin activated: tinkerpop.hadoop
plugin activated: tinkerpop.spark
plugin activated: tinkerpop.utilities
plugin activated: janusgraph.imports
gremlin>
gremlin> graph = JanusGraphFactory.open("conf/hadoop-graph/spark-cql-es.properties")
23:18:43 INFO org.apache.commons.beanutils.FluentPropertyBeanIntrospector.introspect - Error when creating PropertyDescriptor for public final void org.apache.commons.configuration2.AbstractConfiguration.setProperty(java.lang.String,java.lang.Object)! Ignoring this property.
Need to set configuration value: root.storage.backend
Type ':help' or ':h' for help.
Display stack trace? [yN]n
whereas using GraphFactory instead of JanusGraphFactory works fine:
gremlin> graph = GraphFactory.open("conf/hadoop-graph/spark-cql-es.properties")
==>hadoopgraph[cqlinputformat->nulloutputformat]
gremlin>
gremlin> graph = GraphFactory.open("conf/hadoop-graph/spark-cql-es.properties")
==>hadoopgraph[cqlinputformat->nulloutputformat]
gremlin>
Why is janusgraphmr.ioformat.conf.storage.backend=cql read/accepted by GraphFactory but not by JanusGraphFactory?
Solution
rpuga
rpuga2w ago
OK, finally I was able to figure out the issue on my own. To make things work, since JanusGraphFactory fails to create a graph, I replaced
graphManager: org.janusgraph.graphdb.management.JanusGraphManager
graphManager: org.janusgraph.graphdb.management.JanusGraphManager
with
graphManager: org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager
graphManager: org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager
The rest of the relevant parts of the .yaml file look like this:
host: 0.0.0.0
port: 8182
evaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
# graphManager: org.janusgraph.graphdb.management.JanusGraphManager
graphManager: org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager
graphs: {
graph: conf/janusgraph-cql-es-server.properties,
olapgraph: conf/hadoop-graph/spark-cql-es.properties
}
scriptEngines: {
gremlin-groovy: {
plugins: { org.janusgraph.graphdb.tinkerpop.plugin.JanusGraphGremlinPlugin: {},
....... org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/spark-janusgraph.groovy]}}}}
host: 0.0.0.0
port: 8182
evaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
# graphManager: org.janusgraph.graphdb.management.JanusGraphManager
graphManager: org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager
graphs: {
graph: conf/janusgraph-cql-es-server.properties,
olapgraph: conf/hadoop-graph/spark-cql-es.properties
}
scriptEngines: {
gremlin-groovy: {
plugins: { org.janusgraph.graphdb.tinkerpop.plugin.JanusGraphGremlinPlugin: {},
....... org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/spark-janusgraph.groovy]}}}}
and, importantly, scripts/spark-janusgraph.groovy looks like this:
def globals = [:]

globals << [hook : [
onStartUp: { ctx ->
ctx.logger.info("Executed once at startup of Gremlin Server.")
},
onShutDown: { ctx ->
ctx.logger.info("Executed once at shutdown of Gremlin Server.")
}
] as LifeCycleHook]

globals << [g : graph.traversal(), og : olapgraph.traversal().withComputer(org.apache.tinkerpop.gremlin.spark.process.computer.SparkGraphComputer)]
def globals = [:]

globals << [hook : [
onStartUp: { ctx ->
ctx.logger.info("Executed once at startup of Gremlin Server.")
},
onShutDown: { ctx ->
ctx.logger.info("Executed once at shutdown of Gremlin Server.")
}
] as LifeCycleHook]

globals << [g : graph.traversal(), og : olapgraph.traversal().withComputer(org.apache.tinkerpop.gremlin.spark.process.computer.SparkGraphComputer)]
rpuga
rpugaOP2w ago
@gdotv , I wanted to mention that the above solution answers the related but separate question I asked previously on running OLAP queries from G.V(). It may be useful to other GV() users as well. 😉
gdotv
gdotv2w ago
Hey, glad to hear, thanks for confirming. I'm gonna keep a note of this for my own testing 😁. Let me know if you need another trial of G.V() (or your current one extended) if your trial ran out while you were figuring this out.

Did you find this page helpful?