tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject [3/4] tinkerpop git commit: added LambdaHolder to the mix as its better to just have it logically sound then have 'side leak' potentials.
Date Fri, 14 Apr 2017 15:32:45 GMT
added LambdaHolder to the mix as its better to just have it logically sound then have 'side
leak' potentials.


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

Branch: refs/heads/tp32
Commit: 3b22c90969c56a754d8ba65f92857de95da03bd2
Parents: 710bcdb
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Fri Apr 14 07:49:41 2017 -0600
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Fri Apr 14 07:49:41 2017 -0600

----------------------------------------------------------------------
 .../strategy/optimization/RepeatUnrollStrategy.java          | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3b22c909/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RepeatUnrollStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RepeatUnrollStrategy.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RepeatUnrollStrategy.java
index d97ce1e..078e749 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RepeatUnrollStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RepeatUnrollStrategy.java
@@ -24,6 +24,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.lambda.LoopTraversal;
 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.branch.RepeatStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupGlobalStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.LoopsStep;
@@ -31,6 +32,10 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.map.NoOpBarrierStep;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
 
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
@@ -38,6 +43,7 @@ public final class RepeatUnrollStrategy extends AbstractTraversalStrategy<Traver
 
     private static final RepeatUnrollStrategy INSTANCE = new RepeatUnrollStrategy();
     protected static final int MAX_BARRIER_SIZE = 2500;
+    private static final Set<Class> INVALIDATING_STEPS = new HashSet<>(Arrays.asList(LambdaHolder.class,
LoopsStep.class));
 
     private RepeatUnrollStrategy() {
     }
@@ -53,7 +59,7 @@ public final class RepeatUnrollStrategy extends AbstractTraversalStrategy<Traver
                 if (null == repeatStep.getEmitTraversal() &&
                         repeatStep.getUntilTraversal() instanceof LoopTraversal &&
((LoopTraversal) repeatStep.getUntilTraversal()).getMaxLoops() > 0 &&
                         !TraversalHelper.hasStepOfAssignableClassRecursively(Scope.global,
DedupGlobalStep.class, repeatStep.getRepeatTraversal()) &&
-                        !TraversalHelper.hasStepOfAssignableClassRecursively(LoopsStep.class,
repeatStep.getRepeatTraversal())) {
+                        !TraversalHelper.hasStepOfAssignableClassRecursively(INVALIDATING_STEPS,
repeatStep.getRepeatTraversal())) {
                     final Traversal.Admin<?, ?> repeatTraversal = repeatStep.getGlobalChildren().get(0);
                     repeatTraversal.removeStep(repeatTraversal.getSteps().size() - 1); //
removes the RepeatEndStep
                     TraversalHelper.applySingleLevelStrategies(traversal, repeatTraversal,
RepeatUnrollStrategy.class);


Mime
View raw message