Skip to content

Instantly share code, notes, and snippets.

@okram
Created September 26, 2013 07:42
Show Gist options
  • Save okram/6711007 to your computer and use it in GitHub Desktop.
Save okram/6711007 to your computer and use it in GitHub Desktop.
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);
vertexProgram.execute(coreShellVertex, graphMemory);
});
this.vertexMemory.completeIteration();
this.graphMemory.incrIteration();
done = this.vertexProgram.terminate(this.graphMemory);
}
this.graphMemory.setRuntime(System.currentTimeMillis() - time);
return new ComputeResult() {
@Override
public GraphMemory getGraphMemory() {
return graphMemory;
}
@Override
public VertexMemory getVertexMemory() {
return vertexMemory;
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment