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/03/25 19:32:26 UTC

incubator-tinkerpop git commit: JavaDoc and enum renaming in GraphComputer work.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 5a4428f76 -> 5e0358122


JavaDoc and enum renaming in GraphComputer work.


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

Branch: refs/heads/master
Commit: 5e03581229ae3e7a0e15da58e1eaef470d1bd688
Parents: 5a4428f
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Mar 25 12:32:21 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Mar 25 12:32:21 2015 -0600

----------------------------------------------------------------------
 .../gremlin/process/computer/GraphComputer.java | 23 +++++++++++++++-----
 .../peerpressure/PeerPressureVertexProgram.java |  2 +-
 .../computer/lambda/LambdaVertexProgram.java    |  2 +-
 .../ranking/pagerank/PageRankVertexProgram.java |  2 +-
 .../traversal/TraversalVertexProgram.java       |  2 +-
 .../computer/giraph/GiraphGraphComputer.java    |  4 ++--
 .../computer/spark/SparkGraphComputer.java      |  4 ++--
 .../hadoop/structure/util/HadoopHelper.java     |  2 +-
 .../process/computer/TinkerGraphComputer.java   |  4 ++--
 9 files changed, 29 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5e035812/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputer.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputer.java
index c1f9a9f..1f2b3f3 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputer.java
@@ -48,11 +48,11 @@ public interface GraphComputer {
         /**
          * When the computation is complete, the {@link org.apache.tinkerpop.gremlin.structure.Graph} in {@link ComputerResult} is the original graph that spawned the graph computer.
          */
-        ORIGINAL_GRAPH,
+        ORIGINAL,
         /**
          * When the computation is complete, the {@link org.apache.tinkerpop.gremlin.structure.Graph} in {@link ComputerResult} is a new graph cloned from the original graph.
          */
-        NEW_GRAPH
+        NEW
     }
 
     public enum Persist {
@@ -61,11 +61,11 @@ public interface GraphComputer {
          */
         NOTHING,
         /**
-         * Write vertex and vertex properties back to the {@link ResultGraph}.
+         * Write vertex and vertex properties to the {@link ResultGraph}.
          */
         VERTEX_PROPERTIES,
         /**
-         * Write vertex, vertex properties, and edges back to the {@link ResultGraph}.
+         * Write vertex, vertex properties, and edges to the {@link ResultGraph}.
          */
         EDGES
     }
@@ -81,12 +81,21 @@ public interface GraphComputer {
     /**
      * Set the {@link ResultGraph} of the computation.
      * If this is not set explicitly by the user, then the {@link VertexProgram} can choose the most efficient result for its intended use.
+     * If there is no declared vertex program, then the {@link GraphComputer} defaults to {@link ResultGraph#ORIGINAL}.
      *
      * @param resultGraph the type of graph to be returned by {@link ComputerResult#graph}
-     * @return the updated GraphComputer with newly set result graph.
+     * @return the updated GraphComputer with newly set result graph
      */
     public GraphComputer result(final ResultGraph resultGraph);
 
+    /**
+     * Set the {@link Persist} level of the computation.
+     * If this is not set explicitly by the user, then the {@link VertexProgram} can choose the most efficient persist for the its intended use.
+     * If there is no declared vertex program, then the {@link GraphComputer} defaults to {@link Persist#NOTHING}.
+     *
+     * @param persist the persistence level of the resultant computation
+     * @return the updated GraphComputer with newly set persist
+     */
     public GraphComputer persist(final Persist persist);
 
     /**
@@ -168,6 +177,10 @@ public interface GraphComputer {
             return true;
         }
 
+        /**
+         * Supports {@link VertexProgram} and {@link MapReduce} parameters to be direct referenced Java objects (no serialization required).
+         * This is typically true for single machine graph computer engines. For cluster oriented graph computers, this is typically false.
+         */
         public default boolean supportsDirectObjects() {
             return true;
         }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5e035812/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
index f0899fc..3871b5b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
@@ -110,7 +110,7 @@ public class PeerPressureVertexProgram extends StaticVertexProgram<Pair<Serializ
 
     @Override
     public GraphComputer.ResultGraph getPreferredResultGraph() {
-        return GraphComputer.ResultGraph.NEW_GRAPH;
+        return GraphComputer.ResultGraph.NEW;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5e035812/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/lambda/LambdaVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/lambda/LambdaVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/lambda/LambdaVertexProgram.java
index a3b06f6..4181ba8 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/lambda/LambdaVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/lambda/LambdaVertexProgram.java
@@ -136,7 +136,7 @@ public class LambdaVertexProgram<M extends Serializable> extends StaticVertexPro
 
     @Override
     public GraphComputer.ResultGraph getPreferredResultGraph() {
-        return GraphComputer.ResultGraph.ORIGINAL_GRAPH;
+        return GraphComputer.ResultGraph.ORIGINAL;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5e035812/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
index de88430..a31f8ef 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
@@ -92,7 +92,7 @@ public class PageRankVertexProgram extends StaticVertexProgram<Double> {
 
     @Override
     public GraphComputer.ResultGraph getPreferredResultGraph() {
-        return GraphComputer.ResultGraph.NEW_GRAPH;
+        return GraphComputer.ResultGraph.NEW;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5e035812/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
index 97616d6..c50e1fd 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
@@ -231,7 +231,7 @@ public final class TraversalVertexProgram implements VertexProgram<TraverserSet<
 
     @Override
     public GraphComputer.ResultGraph getPreferredResultGraph() {
-        return GraphComputer.ResultGraph.ORIGINAL_GRAPH;
+        return GraphComputer.ResultGraph.ORIGINAL;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5e035812/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphGraphComputer.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphGraphComputer.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphGraphComputer.java
index fc958d5..d761ca0 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphGraphComputer.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphGraphComputer.java
@@ -172,8 +172,8 @@ public class GiraphGraphComputer extends Configured implements GraphComputer, To
         if (!this.persist.isPresent())
             this.persist = Optional.of(null == this.vertexProgram ? Persist.NOTHING : this.vertexProgram.getPreferredPersist());
         if (!this.resultGraph.isPresent())
-            this.resultGraph = Optional.of(null == this.vertexProgram ? ResultGraph.ORIGINAL_GRAPH : this.vertexProgram.getPreferredResultGraph());
-        if (this.resultGraph.get().equals(ResultGraph.ORIGINAL_GRAPH))
+            this.resultGraph = Optional.of(null == this.vertexProgram ? ResultGraph.ORIGINAL : this.vertexProgram.getPreferredResultGraph());
+        if (this.resultGraph.get().equals(ResultGraph.ORIGINAL))
             if (!this.persist.get().equals(Persist.NOTHING))
                 throw GraphComputer.Exceptions.resultGraphPersistCombinationNotSupported(this.resultGraph.get(), this.persist.get());
         this.giraphConfiguration.setBoolean(Constants.GREMLIN_HADOOP_GRAPH_OUTPUT_FORMAT_HAS_EDGES, this.persist.get().equals(Persist.EDGES));

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5e035812/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/spark/SparkGraphComputer.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/spark/SparkGraphComputer.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/spark/SparkGraphComputer.java
index b578bac..debacd8 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/spark/SparkGraphComputer.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/spark/SparkGraphComputer.java
@@ -133,8 +133,8 @@ public final class SparkGraphComputer implements GraphComputer {
         if (!this.persist.isPresent())
             this.persist = Optional.of(null == this.vertexProgram ? Persist.NOTHING : this.vertexProgram.getPreferredPersist());
         if (!this.resultGraph.isPresent())
-            this.resultGraph = Optional.of(null == this.vertexProgram ? ResultGraph.ORIGINAL_GRAPH : this.vertexProgram.getPreferredResultGraph());
-        if (this.resultGraph.get().equals(ResultGraph.ORIGINAL_GRAPH))
+            this.resultGraph = Optional.of(null == this.vertexProgram ? ResultGraph.ORIGINAL : this.vertexProgram.getPreferredResultGraph());
+        if (this.resultGraph.get().equals(ResultGraph.ORIGINAL))
             if (!this.persist.get().equals(Persist.NOTHING))
                 throw GraphComputer.Exceptions.resultGraphPersistCombinationNotSupported(this.resultGraph.get(), this.persist.get());
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5e035812/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/util/HadoopHelper.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/util/HadoopHelper.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/util/HadoopHelper.java
index e07af1a..280fc9d 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/util/HadoopHelper.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/util/HadoopHelper.java
@@ -35,7 +35,7 @@ public final class HadoopHelper {
     public static HadoopGraph getOutputGraph(final HadoopGraph hadoopGraph, final GraphComputer.ResultGraph resultGraph, final GraphComputer.Persist persist) {
         final BaseConfiguration newConfiguration = new BaseConfiguration();
         newConfiguration.copy(hadoopGraph.configuration());
-        if (resultGraph.equals(GraphComputer.ResultGraph.NEW_GRAPH)) {
+        if (resultGraph.equals(GraphComputer.ResultGraph.NEW)) {
             newConfiguration.setProperty(Constants.GREMLIN_HADOOP_INPUT_LOCATION, hadoopGraph.configuration().getOutputLocation() + "/" + Constants.HIDDEN_G);
             newConfiguration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_INPUT_FORMAT, InputOutputHelper.getInputFormat(hadoopGraph.configuration().getGraphOutputFormat()).getCanonicalName());
             newConfiguration.setProperty(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, hadoopGraph.configuration().getOutputLocation() + "_");

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5e035812/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java
index afd36b2..54f4d82 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java
@@ -115,8 +115,8 @@ public class TinkerGraphComputer implements GraphComputer {
         if (!this.persist.isPresent())
             this.persist = Optional.of(null == this.vertexProgram ? Persist.NOTHING : this.vertexProgram.getPreferredPersist());
         if (!this.resultGraph.isPresent())
-            this.resultGraph = Optional.of(null == this.vertexProgram ? ResultGraph.ORIGINAL_GRAPH : this.vertexProgram.getPreferredResultGraph());
-        if (this.resultGraph.get().equals(ResultGraph.ORIGINAL_GRAPH))
+            this.resultGraph = Optional.of(null == this.vertexProgram ? ResultGraph.ORIGINAL : this.vertexProgram.getPreferredResultGraph());
+        if (this.resultGraph.get().equals(ResultGraph.ORIGINAL))
             if (!this.persist.get().equals(Persist.NOTHING))
                 throw GraphComputer.Exceptions.resultGraphPersistCombinationNotSupported(this.resultGraph.get(), this.persist.get());