Skip to content

Instantly share code, notes, and snippets.

@okram
Created Feb 20, 2014
Embed
What would you like to do?
public void testOLAPWriteBack() throws Exception {
Graph g = TinkerFactory.createClassic();
g.V().pageRank().sideEffect(p -> p.get().getValue0().setProperty("pageRank", p.get().getValue1())).forEachRemaining(System.out::println);
System.out.println("---------------");
g.V().value("pageRank").forEachRemaining(System.out::println);
System.out.println("---------------");
g.V().pageRank().sideEffect(p -> p.get().getValue0().setProperty("pageRank", p.get().getValue1())).submit(g.compute()).forEachRemaining(System.out::println);
}
///////////////////
[v[1], 0.15000000000000002]
[v[2], 0.19250000000000003]
[v[3], 0.4018125]
[v[4], 0.19250000000000003]
[v[5], 0.23181250000000003]
[v[6], 0.15000000000000002]
---------------
0.15000000000000002
0.19250000000000003
0.4018125
0.19250000000000003
0.23181250000000003
0.15000000000000002
---------------
java.lang.RuntimeException: java.lang.IllegalArgumentException: The provided key is not a compute key: pageRank
at com.tinkerpop.gremlin.process.olap.traversal.TraversalResult.<init>(TraversalResult.java:37)
at com.tinkerpop.gremlin.process.olap.traversal.TraversalResult.<init>(TraversalResult.java:43)
at com.tinkerpop.tinkergraph.TinkerGraphComputer.execute(TinkerGraphComputer.java:38)
at com.tinkerpop.gremlin.process.util.DefaultTraversal.submit(DefaultTraversal.java:79)
at com.tinkerpop.tinkergraph.TinkerGraph$1.submit(TinkerGraph.java:150)
at com.tinkerpop.tinkergraph.process.olap.TinkerGraphComputerTest.testOLAPWriteBack(TinkerGraphComputerTest.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: The provided key is not a compute key: pageRank
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2237)
at com.tinkerpop.gremlin.process.olap.traversal.TraversalResult.<init>(TraversalResult.java:35)
... 31 more
Caused by: java.lang.IllegalArgumentException: The provided key is not a compute key: pageRank
at com.tinkerpop.gremlin.process.olap.GraphComputer$Exceptions.providedKeyIsNotAComputeKey(GraphComputer.java:108)
at com.tinkerpop.tinkergraph.TinkerVertex.lambda$setProperty$21(TinkerVertex.java:71)
at com.tinkerpop.tinkergraph.TinkerVertex$$Lambda$6/515132998.accept(Unknown Source)
at com.tinkerpop.tinkergraph.TinkerVertex.setProperty(TinkerVertex.java:75)
at com.tinkerpop.tinkergraph.process.olap.TinkerGraphComputerTest.lambda$testOLAPWriteBack$1(TinkerGraphComputerTest.java:36)
at com.tinkerpop.tinkergraph.process.olap.TinkerGraphComputerTest$$Lambda$51/1971489295.accept(Unknown Source)
at com.tinkerpop.gremlin.process.steps.sideEffect.SideEffectStep.lambda$new$55(SideEffectStep.java:17)
at com.tinkerpop.gremlin.process.steps.sideEffect.SideEffectStep$$Lambda$23/2036368507.apply(Unknown Source)
at com.tinkerpop.gremlin.process.steps.map.MapStep.processNextStart(MapStep.java:28)
at com.tinkerpop.gremlin.process.steps.AbstractStep.hasNext(AbstractStep.java:78)
at com.tinkerpop.gremlin.process.olap.traversal.TraversalCounterMessage.processStep(TraversalCounterMessage.java:101)
at com.tinkerpop.gremlin.process.olap.traversal.TraversalCounterMessage.lambda$execute$155(TraversalCounterMessage.java:62)
at com.tinkerpop.gremlin.process.olap.traversal.TraversalCounterMessage$$Lambda$65/522774638.accept(Unknown Source)
at java.util.HashMap.forEach(HashMap.java:1278)
at com.tinkerpop.gremlin.process.olap.traversal.TraversalCounterMessage.execute(TraversalCounterMessage.java:54)
at com.tinkerpop.gremlin.process.olap.traversal.TraversalVertexProgram.executeOtherIterations(TraversalVertexProgram.java:91)
at com.tinkerpop.gremlin.process.olap.traversal.TraversalVertexProgram.execute(TraversalVertexProgram.java:50)
at com.tinkerpop.tinkergraph.TinkerGraphComputer.lambda$null$13(TinkerGraphComputer.java:60)
at com.tinkerpop.tinkergraph.TinkerGraphComputer$$Lambda$33/235929099.accept(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290)
at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:885)
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1670)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1625)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:137)
Process finished with exit code 255
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment