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
public static String unHide(final String key) { | |
return key.startsWith(Graph.HIDDEN_PREFIX) ? key.substring(Graph.HIDDEN_PREFIX.length()) : key; | |
} |
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
~/software/tinkerpop/tinkerpop3$ bin/gremlin.sh | |
\,,,/ | |
(o o) | |
-----oOOo-(3)-oOOo----- | |
gremlin> :use install com.tinkerpop giraph-gremlin 3.0.0-SNAPSHOT | |
==>loaded: [com.tinkerpop, giraph-gremlin, 3.0.0-SNAPSHOT] - restart the console to use [giraph] | |
gremlin> :q | |
~/software/tinkerpop/tinkerpop3$ bin/gremlin.sh |
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
/** | |
* @author Marko A. Rodriguez (http://markorodriguez.com) | |
*/ | |
public class GremlinGroovySSupplier<A> implements SSupplier<A> { | |
private final String groovyScript; | |
private final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(); | |
public GremlinGroovySSupplier(final String groovyScript) { | |
this.groovyScript = groovyScript; |
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
@Test | |
public void shouldSerialize() throws Exception { | |
SSupplier<Traversal> traversalSSupplier = new GremlinGroovySSupplier<>("TinkerFactory.createClassic().V.out.name"); | |
byte[] bytes = Serializer.serializeObject(traversalSSupplier); | |
traversalSSupplier = (SSupplier<Traversal>) Serializer.deserializeObject(bytes); | |
Traversal traversal = traversalSSupplier.get(); | |
assertEquals(TinkerGraphStep.class, traversal.getSteps().get(0).getClass()); | |
assertEquals(VertexStep.class, traversal.getSteps().get(1).getClass()); | |
assertEquals(ElementValueStep.class, traversal.getSteps().get(2).getClass()); | |
assertEquals(traversal.getSteps().size(), 3); |
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
$ bin/gremlin.sh | |
\,,,/ | |
(o o) | |
-----oOOo-(3)-oOOo----- | |
gremlin> :use install com.tinkerpop giraph-gremlin 3.0.0-SNAPSHOT | |
==>loaded: [com.tinkerpop, giraph-gremlin, 3.0.0-SNAPSHOT] - restart the console to use [giraph] | |
gremlin> :q | |
$ bin/gremlin.sh |
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
$ bin/gremlin.sh | |
\,,,/ | |
(o o) | |
-----oOOo-(3)-oOOo----- | |
gremlin> :use install com.tinkerpop giraph-gremlin 3.0.0-SNAPSHOT | |
==>loaded: [com.tinkerpop, giraph-gremlin, 3.0.0-SNAPSHOT] - restart the console to use [giraph] | |
gremlin> :q | |
$ bin/gremlin.sh |
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
\,,,/ | |
(o o) | |
─────oOOo-( )-oOOo───3 |
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
public class GiraphGremlinGraphProvider extends AbstractGraphProvider { | |
@Override | |
public Map<String, Object> getBaseConfiguration(final String graphName) { | |
return new HashMap<String, Object>() {{ | |
put("gremlin.graph", GiraphGraph.class.getName()); | |
put("giraph.vertexInputFormatClass", "com.tinkerpop.gremlin.giraph.structure.io.kryo.KryoVertexInputFormat"); | |
put("giraph.vertexOutputFormatClass", "com.tinkerpop.gremlin.giraph.structure.io.kryo.KryoVertexOutputFormat"); | |
put("giraph.minWorkers", "1"); | |
put("giraph.maxWorkers", "1"); |
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
$ bin/gremlin.sh | |
\,,,/ | |
(o o) | |
─────oOOo─(3)─oOOo───── | |
gremlin> :use install com.tinkerpop giraph-gremlin 3.0.0-SNAPSHOT | |
==>loaded: [com.tinkerpop, giraph-gremlin, 3.0.0-SNAPSHOT] - restart the console to use [giraph] | |
gremlin> :q | |
$ bin/gremlin.sh |
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> g | |
==>giraphgraph[kryovertexinputformat->kryovertexoutputformat] | |
gremlin> g.V.out.name | |
==>lop | |
==>ripple | |
==>lop | |
==>lop |