You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2015/05/13 20:57:51 UTC

incubator-tinkerpop git commit: PageRankVertexProgram example fixed with new loadState(Graph, Configuration) method.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master d11ce9c0c -> c00ca0c79


PageRankVertexProgram example fixed with new loadState(Graph,Configuration) method.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/c00ca0c7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/c00ca0c7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/c00ca0c7

Branch: refs/heads/master
Commit: c00ca0c79e46610a0bfec660a900ac601583464f
Parents: d11ce9c
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed May 13 12:57:47 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed May 13 12:57:47 2015 -0600

----------------------------------------------------------------------
 docs/src/the-graphcomputer.asciidoc | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c00ca0c7/docs/src/the-graphcomputer.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/the-graphcomputer.asciidoc b/docs/src/the-graphcomputer.asciidoc
index d54b8f2..c176c73 100644
--- a/docs/src/the-graphcomputer.asciidoc
+++ b/docs/src/the-graphcomputer.asciidoc
@@ -128,7 +128,7 @@ public class PageRankVertexProgram implements VertexProgram<Double> { <1>
     private static final String TOTAL_ITERATIONS = "gremlin.pageRankVertexProgram.totalIterations";
     private static final String INCIDENT_TRAVERSAL_SUPPLIER = "gremlin.pageRankVertexProgram.incidentTraversalSupplier";
 
-    private LambdaHolder<Supplier<Traversal<Vertex, Edge>>> traversalSupplier;
+     private ConfigurationTraversal<Vertex, Edge> configurationTraversal;
     private double vertexCountAsDouble = 1.0d;
     private double alpha = 0.85d;
     private int totalIterations = 30;
@@ -138,12 +138,12 @@ public class PageRankVertexProgram implements VertexProgram<Double> { <1>
     private PageRankVertexProgram() {}
 
     @Override
-    public void loadState(final Configuration configuration) { <4>
-        this.traversalSupplier = LambdaHolder.loadState(configuration, INCIDENT_TRAVERSAL_SUPPLIER);
-        if (null != this.traversalSupplier) {
-            VertexProgramHelper.verifyReversibility(this.traversalSupplier.get().get());
-            this.incidentMessageScope = MessageScope.Local.of(this.traversalSupplier.get());
-        }
+    public void loadState(final Graph graph, final Configuration configuration) { <4>
+        if (configuration.containsKey(TRAVERSAL_SUPPLIER)) {
+                    this.configurationTraversal = ConfigurationTraversal.loadState(graph, configuration, TRAVERSAL_SUPPLIER);
+                    this.incidentMessageScope = MessageScope.Local.of(this.configurationTraversal);
+                    this.countMessageScope = MessageScope.Local.of(new MessageScope.Local.ReverseTraversalSupplier(this.incidentMessageScope));
+                }
         this.vertexCountAsDouble = configuration.getDouble(VERTEX_COUNT, 1.0d);
         this.alpha = configuration.getDouble(ALPHA, 0.85d);
         this.totalIterations = configuration.getInt(TOTAL_ITERATIONS, 30);