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 ComputeResult submit() { | |
final long time = System.currentTimeMillis(); | |
this.vertexMemory.setComputeKeys(this.vertexProgram.getComputeKeys()); | |
this.vertexProgram.setup(this.graphMemory); | |
boolean done = false; | |
while (!done) { | |
StreamFactory.stream(this.graph.query().vertices()).forEach(vertex -> { | |
final CoreShellVertex coreShellVertex = new CoreShellVertex(vertexMemory); | |
coreShellVertex.setBaseVertex(vertex); |
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 ComputeResult submit() { | |
final long time = System.currentTimeMillis(); | |
this.vertexMemory.setComputeKeys(this.vertexProgram.getComputeKeys()); | |
this.vertexProgram.setup(this.graphMemory); | |
boolean done = false; | |
while (!done) { | |
StreamFactory.parallelStream(this.graph.query().vertices()).forEach(vertex -> { | |
final CoreShellVertex coreShellVertex = new CoreShellVertex(vertexMemory); | |
coreShellVertex.setBaseVertex(vertex); |
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 void testPipeline() { | |
TinkerGraph g = TinkerFactory.createClassic(); | |
new Gremlin(g.query().vertices()).as("x") | |
.out("knows") | |
.has("name", "vadas") | |
.back("x") | |
.value("name") | |
.sideEffect(System.out::println).iterate(); |
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/aurelius/faunus$ bin/gremlin.sh | |
\,,,/ | |
(o o) | |
-----oOOo-(_)-oOOo----- | |
2013-09-30 10:11:48.366 java[29040:1703] Unable to load realm info from SCDynamicStore | |
gremlin> g = FaunusFactory.open('bin/faunus.properties') | |
==>faunusgraph[graphsoninputformat->graphsonoutputformat] | |
gremlin> g.getConf().setClass('mapred.map.output.compression.codec',org.apache.hadoop.io.compress.SnappyCodec,CompressionCodec.class) | |
10:11:55 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable |
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 void testGremlinOLAP() { | |
Graph g = TinkerFactory.createClassic(); | |
ComputeResult result = | |
g.compute().program(GremlinVertexProgram.create().steps("V", "out", "count").build()).submit(); | |
System.out.println(result.getGraphMemory().get("result").toString()); | |
} | |
/////////////////// |
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
package com.tinkerpop.gremlin.computer; | |
import com.tinkerpop.blueprints.Direction; | |
import com.tinkerpop.blueprints.Vertex; | |
import com.tinkerpop.blueprints.computer.GraphMemory; | |
import com.tinkerpop.blueprints.computer.VertexProgram; | |
import com.tinkerpop.gremlin.pipes.FilterPipe; | |
import com.tinkerpop.gremlin.pipes.FlatMapPipe; | |
import com.tinkerpop.gremlin.pipes.Gremlin; | |
import com.tinkerpop.gremlin.pipes.MapPipe; |
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
package com.tinkerpop.gremlin.computer; | |
import com.tinkerpop.blueprints.Direction; | |
import com.tinkerpop.blueprints.Graph; | |
import com.tinkerpop.blueprints.Vertex; | |
import com.tinkerpop.blueprints.computer.GraphMemory; | |
import com.tinkerpop.blueprints.computer.VertexProgram; | |
import com.tinkerpop.blueprints.util.StreamFactory; | |
import com.tinkerpop.gremlin.pipes.FilterPipe; | |
import com.tinkerpop.gremlin.pipes.FlatMapPipe; |
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
package com.tinkerpop.gremlin.computer; | |
import com.tinkerpop.blueprints.Direction; | |
import com.tinkerpop.blueprints.Graph; | |
import com.tinkerpop.blueprints.Property; | |
import com.tinkerpop.blueprints.Vertex; | |
import com.tinkerpop.blueprints.tinkergraph.TinkerGraph; | |
import java.util.Iterator; |
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
ComputeResult result = | |
g.compute().program(GremlinVertexProgram.create().gremlin(() -> (Gremlin) | |
Gremlin.of().has("name", "marko").out().out().simplePath().has("name","lop").in()) | |
.build()) | |
.submit(); |
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 interface Transaction { | |
public void commit(); | |
public void rollback(); | |
public Transaction open(); | |
public boolean isOpen(); |