Skip to content

Instantly share code, notes, and snippets.

@okram
Created September 26, 2013 07:38
Show Gist options
  • Save okram/6710968 to your computer and use it in GitHub Desktop.
Save okram/6710968 to your computer and use it in GitHub Desktop.
public void testLambdaProgram() {
//TinkerGraph g = TinkerFactory.createClassic();
TinkerGraph g = new TinkerGraph();
Stream.generate(g::addVertex).limit(500000).count();
ComputeResult result = g.compute().program(LambdaVertexProgram.create()
.setup(gm -> {
})
.execute((v, gm) -> {
v.setProperty("i", gm.getIteration());
})
.terminate(gm -> gm.getIteration() > 20)
.computeKeys(VertexProgram.ofComputeKeys("i", VertexProgram.KeyType.VARIABLE))
.build())
.submit();
System.out.println("Runtime: " + result.getGraphMemory().getRuntime());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment