Created
September 26, 2013 07:41
-
-
Save okram/6710992 to your computer and use it in GitHub Desktop.
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); | |
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