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 2017/01/26 22:18:35 UTC
tinkerpop git commit: dah. my last tweak made a buggy. now I'm done
for the day.
Repository: tinkerpop
Updated Branches:
refs/heads/TINKERPOP-1617 265f50715 -> 527afc246
dah. my last tweak made a buggy. now I'm done for the day.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/527afc24
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/527afc24
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/527afc24
Branch: refs/heads/TINKERPOP-1617
Commit: 527afc2463414bd27b8b2481a76c0c81d7f7e53b
Parents: 265f507
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Jan 26 15:18:31 2017 -0700
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Jan 26 15:18:31 2017 -0700
----------------------------------------------------------------------
.../strategy/optimization/SingleIterationStrategy.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/527afc24/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java
index eed1104..96a2a0a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java
@@ -28,6 +28,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.process.traversal.step.Barrier;
+import org.apache.tinkerpop.gremlin.process.traversal.step.LambdaHolder;
import org.apache.tinkerpop.gremlin.process.traversal.step.SideEffectCapable;
import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
import org.apache.tinkerpop.gremlin.process.traversal.step.branch.LocalStep;
@@ -93,13 +94,14 @@ public final class SingleIterationStrategy extends AbstractTraversalStrategy<Tra
}
if (doesMessagePass && // if the traversal doesn't message pass, then don't try and localize it as its just wasted computation
TraversalHelper.isLocalStarGraph(computerTraversal) && // if we move beyond the star graph, then localization is not possible.
- (computerTraversal.getStartStep() instanceof GraphStep) && // while GraphComputer requires GraphStep starts, this is just a precaution when inject() starts are supported
+ computerTraversal.getStartStep() instanceof GraphStep && // while GraphComputer requires GraphStep starts, this is just a precaution when inject() starts are supported
!(computerTraversal.getStartStep().getNextStep() instanceof EmptyStep) && // if its just a g.V()/E(), then don't localize
!(computerTraversal.getStartStep().getNextStep() instanceof LocalStep) && // removes the potential for the infinite recursive application of the traversal
!(computerTraversal.getStartStep().getNextStep() instanceof Barrier) && // if the second step is a barrier, no point in trying to localize anything
!computerTraversal.getTraverserRequirements().contains(TraverserRequirement.LABELED_PATH) && // this is to alleviate issues with DetachedElement in paths (TODO: when detachment is dynamic, remove this)
!computerTraversal.getTraverserRequirements().contains(TraverserRequirement.PATH) && // this is to alleviate issues with DetachedElement in paths (TODO: when detachment is dynamic, remove this)
- TraversalHelper.getStepsOfAssignableClassRecursively(SideEffectCapable.class, computerTraversal).isEmpty() && // this is to alleviate issues with DetachedElement in paths (TODO: when detachment is dynamic, remove this)
+ !TraversalHelper.hasStepOfAssignableClassRecursively(LambdaHolder.class, computerTraversal) && // this is because we might be accessing data on an adjacent vertex and that is bad
+ !TraversalHelper.hasStepOfAssignableClassRecursively(SideEffectCapable.class, computerTraversal) && // this is to alleviate issues with DetachedElement in paths (TODO: when detachment is dynamic, remove this)
!(TraversalHelper.getStepsOfAssignableClass(TraversalParent.class, computerTraversal). // this is a strict precaution that could be loosed with deeper logic on barriers in global children
stream().
filter(parent -> !parent.getGlobalChildren().isEmpty()).findAny().isPresent())) {