apache spark - Unable to use SparkGraphComputer with Tinkerpop 3.2.3 and Janusgraph 0.1.1 in remote mode -
i have set tinkerpop gremlin server 3.2.3 , tinkerpop gremlin console 3.2.3 , added janusgraph 0.1.1 plugin both.
i run following code in remote mode ends in below-listed exception
:remote connect tinkerpop.server conf/remote.yaml :> graph = graphfactory.open('conf/hadoop-graph/hadoop-load.properties') :> blvp = bulkloadervertexprogram.build().writegraph('conf/connection.properties').create(graph) :> graph.compute(sparkgraphcomputer).program(blvp).submit().get() exception
java.lang.illegalargumentexception: graph not support provided graph computer: sparkgraphcomputer @ org.apache.tinkerpop.gremlin.structure.graph$exceptions.graphdoesnotsupportprovidedgraphcomputer(graph.java:1140) @ org.janusgraph.graphdb.tinkerpop.janusgraphblueprintsgraph.compute(janusgraphblueprintsgraph.java:145) @ org.apache.tinkerpop.gremlin.structure.graph$compute$0.call(unknown source) @ org.codehaus.groovy.runtime.callsite.callsitearray.defaultcall(callsitearray.java:48) @ org.codehaus.groovy.runtime.callsite.abstractcallsite.call(abstractcallsite.java:113) @ org.codehaus.groovy.runtime.callsite.abstractcallsite.call(abstractcallsite.java:125) @ script4.run(script4.groovy:1) @ org.apache.tinkerpop.gremlin.groovy.jsr223.gremlingroovyscriptengine.eval(gremlingroovyscriptengine.java:619) @ org.apache.tinkerpop.gremlin.groovy.jsr223.gremlingroovyscriptengine.eval(gremlingroovyscriptengine.java:448) @ javax.script.abstractscriptengine.eval(abstractscriptengine.java:233) @ org.apache.tinkerpop.gremlin.groovy.engine.scriptengines.eval(scriptengines.java:119) @ org.apache.tinkerpop.gremlin.groovy.engine.gremlinexecutor.lambda$eval$2(gremlinexecutor.java:287) @ java.util.concurrent.futuretask.run(futuretask.java:266) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1149) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:624) @ java.lang.thread.run(thread.java:748) the above code works fine in local mode, can please out missing here.
you need define olap graph in gremlin server configuration , add script binding olap graph traversal source.
for example in conf/gremlin-server/gremlin-server.yaml, update graphs this:
graphs: { graph: conf/gremlin-server/janusgraph-cassandra-es-server.properties, olapgraph: conf/hadoop-graph/read-cassandra.properties } later on in conf/gremlin-server/gremlin-server.yaml, default configuration uses scripts/empty-sample.groovy configure graph traversal source.
scriptengines: { gremlin-groovy: { imports: [java.lang.math], staticimports: [java.lang.math.pi], scripts: [scripts/empty-sample.groovy]}} so in scripts/empty.groovy, add binding olap traversal source og use sparkgraphcomputer:
globals << [g : graph.traversal(), og : olapgraph.traversal().withcomputer(org.apache.tinkerpop.gremlin.spark.process.computer.sparkgraphcomputer)] after restarting gremlin server, connect gremlin console, , find both graphs , graph traversal sources available:
gremlin> :remote connect tinkerpop.server conf/remote.yaml ==>configured localhost/127.0.0.1:8182 gremlin> :> graph ==>standardjanusgraph[cassandrathrift:[127.0.0.1]] gremlin> :> g ==>graphtraversalsource[standardjanusgraph[cassandrathrift:[127.0.0.1]], standard] gremlin> :> olapgraph ==>hadoopgraph[cassandrainputformat->gryooutputformat] gremlin> :> og ==>graphtraversalsource[hadoopgraph[cassandrainputformat->gryooutputformat], sparkgraphcomputer] gremlin> :> og.v().valuemap(true) ==>{label=software, name=[ripple], lang=[java], id=4328} ==>{label=software, name=[lop], lang=[java], id=4240} ==>{label=person, name=[josh], id=8216, age=[32]} ==>{label=person, name=[marko], id=4120, age=[29]} ==>{label=person, name=[vadas], id=4176, age=[27]} ==>{label=person, name=[peter], id=4296, age=[35]}
Comments
Post a Comment