tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject tinkerpop git commit: fa-jesus that was sucky. Basically, SparkInterceptorStrategy needed to know about ComputerFinalizationStrategy.
Date Tue, 28 Feb 2017 21:06:37 GMT
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1640 1a2597b88 -> 587bf7bb4


fa-jesus that was sucky. Basically, SparkInterceptorStrategy needed to know about ComputerFinalizationStrategy.


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

Branch: refs/heads/TINKERPOP-1640
Commit: 587bf7bb4326909f3960ac7ca2ff873f673fcd51
Parents: 1a2597b
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Tue Feb 28 14:06:33 2017 -0700
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Tue Feb 28 14:06:33 2017 -0700

----------------------------------------------------------------------
 .../process/computer/traversal/TraversalVertexProgram.java     | 3 ++-
 .../strategy/finalization/ComputerFinalizationStrategy.java    | 6 ++----
 .../gremlin/process/traversal/step/GraphComputing.java         | 2 +-
 .../optimization/interceptor/SparkStarBarrierInterceptor.java  | 3 ++-
 .../tinkergraph/process/TinkerGraphNoStrategyProvider.java     | 1 -
 5 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/587bf7bb/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 30739b4..f72f49b 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
@@ -33,6 +33,7 @@ import org.apache.tinkerpop.gremlin.process.computer.VertexProgram;
 import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.ComputerResultStep;
 import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.TraversalVertexProgramStep;
 import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy;
+import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.finalization.ComputerFinalizationStrategy;
 import org.apache.tinkerpop.gremlin.process.computer.util.AbstractVertexProgramBuilder;
 import org.apache.tinkerpop.gremlin.process.computer.util.SingleMessenger;
 import org.apache.tinkerpop.gremlin.process.computer.util.VertexProgramHelper;
@@ -438,7 +439,7 @@ public final class TraversalVertexProgram implements VertexProgram<TraverserSet<
                 final Traversal.Admin<?, ?> parentTraversal = new DefaultTraversal<>();
                 traversal.getGraph().ifPresent(parentTraversal::setGraph);
                 final TraversalStrategies strategies = traversal.getStrategies().clone();
-                strategies.addStrategies(ComputerVerificationStrategy.instance(), new VertexProgramStrategy(Computer.compute()));
+                strategies.addStrategies(ComputerFinalizationStrategy.instance(), ComputerVerificationStrategy.instance(),
new VertexProgramStrategy(Computer.compute()));
                 parentTraversal.setStrategies(strategies);
                 traversal.setStrategies(strategies);
                 parentTraversal.setSideEffects(memoryTraversalSideEffects);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/587bf7bb/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/finalization/ComputerFinalizationStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/finalization/ComputerFinalizationStrategy.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/finalization/ComputerFinalizationStrategy.java
index a07c66e..cbf4be5 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/finalization/ComputerFinalizationStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/finalization/ComputerFinalizationStrategy.java
@@ -42,13 +42,11 @@ public final class ComputerFinalizationStrategy extends AbstractTraversalStrateg
 
     @Override
     public void apply(Traversal.Admin<?, ?> traversal) {
-        if (!TraversalHelper.onGraphComputer(traversal))
+        if (!TraversalHelper.onGraphComputer(traversal) || !TraversalHelper.isGlobalChild(traversal))
             return;
 
-        final boolean globalChild = TraversalHelper.isGlobalChild(traversal);
         for (final Step<?, ?> step : traversal.getSteps()) {
-            // only global children are graph computing
-            if (globalChild && step instanceof GraphComputing)
+            if (step instanceof GraphComputing)
                 ((GraphComputing) step).onGraphComputer();
         }
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/587bf7bb/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/GraphComputing.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/GraphComputing.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/GraphComputing.java
index cec5708..a3c0d1e 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/GraphComputing.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/GraphComputing.java
@@ -23,7 +23,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 
 /**
  * A {@code GraphComputing} step is one that will change its behavior whether its on a {@link
org.apache.tinkerpop.gremlin.process.computer.GraphComputer} or not.
- * {@link org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ComputerVerificationStrategy}
is responsible for calling the {@link GraphComputing#onGraphComputer()} method.
+ * {@link org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.finalization.ComputerFinalizationStrategy}
is responsible for calling the {@link GraphComputing#onGraphComputer()} method.
  * This method is only called for global children steps of a {@link TraversalParent}.
  *
  * @author Marko A. Rodriguez (http://markorodriguez.com)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/587bf7bb/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/interceptor/SparkStarBarrierInterceptor.java
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/interceptor/SparkStarBarrierInterceptor.java
b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/interceptor/SparkStarBarrierInterceptor.java
index 8585e0d..f75b845 100644
--- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/interceptor/SparkStarBarrierInterceptor.java
+++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/interceptor/SparkStarBarrierInterceptor.java
@@ -25,6 +25,7 @@ import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
 import org.apache.tinkerpop.gremlin.process.computer.ProgramPhase;
 import org.apache.tinkerpop.gremlin.process.computer.traversal.MemoryTraversalSideEffects;
 import org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram;
+import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.finalization.ComputerFinalizationStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.NumberHelper;
 import org.apache.tinkerpop.gremlin.process.traversal.Scope;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
@@ -75,7 +76,7 @@ public final class SparkStarBarrierInterceptor implements SparkVertexProgramInte
         final ReducingBarrierStep endStep = (ReducingBarrierStep) traversal.getEndStep();
// needed for the final traverser generation
         traversal.removeStep(0);                                    // remove GraphStep
         traversal.removeStep(traversal.getSteps().size() - 1);      // remove ReducingBarrierStep
-        traversal.setStrategies(traversal.clone().getStrategies().removeStrategies(ComputerVerificationStrategy.class));
// no longer a computer job, but parallel standard jobs
+        traversal.setStrategies(traversal.clone().getStrategies().removeStrategies(ComputerVerificationStrategy.class,
ComputerFinalizationStrategy.class)); // no longer a computer job, but parallel standard jobs
         traversal.applyStrategies();                                // compile
         boolean identityTraversal = traversal.getSteps().isEmpty(); // if the traversal is
empty, just return the vertex (fast)
         ///////////////////////////////

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/587bf7bb/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphNoStrategyProvider.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphNoStrategyProvider.java
b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphNoStrategyProvider.java
index 095fcaa..87e8f2b 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphNoStrategyProvider.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphNoStrategyProvider.java
@@ -26,7 +26,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ConnectiveStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SideEffectStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.ProfileStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ComputerVerificationStrategy;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider;
 import org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.strategy.optimization.TinkerGraphStepStrategy;


Mime
View raw message