JanusGraphJ
JanusGraph12mo ago
rpuga

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
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

with
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]}}}}


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)]
Was this page helpful?