made the barriers sizes of the various barrier() introducing strategies public 
statics so its easy to see which strategy is adding which barrier in the 
various tests. Also, much easier to refactor without explicit ints everywhere. 
Thanks for the tip @dkuppitz.


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

Branch: refs/heads/master
Commit: c328a42f758b587be5cfba468a943b51e3c02b1f
Parents: 135af8e
Author: Marko A. Rodriguez <okramma...@gmail.com>
Authored: Wed Oct 12 13:52:27 2016 -0600
Committer: Marko A. Rodriguez <okramma...@gmail.com>
Committed: Wed Oct 12 13:52:27 2016 -0600

----------------------------------------------------------------------
 .../process/traversal/step/map/MatchStep.java   |  2 +-
 .../optimization/LazyBarrierStrategy.java       |  2 +-
 .../optimization/PathRetractionStrategy.java    |  4 +-
 .../optimization/RepeatUnrollStrategy.java      |  4 +-
 .../optimization/LazyBarrierStrategyTest.java   | 51 +++++++++++---------
 .../PathRetractionStrategyTest.java             | 13 +++--
 .../optimization/RepeatUnrollStrategyTest.java  |  2 +-
 7 files changed, 41 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c328a42f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
----------------------------------------------------------------------
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
index fb2fdd3..c075d0a 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
@@ -369,7 +369,7 @@ public final class MatchStep<S, E> extends 
ComputerAwareStep<S, Map<String, E>>
                 for (final Traversal.Admin<?, ?> matchTraversal : 
this.matchTraversals) {
                     while (matchTraversal.hasNext()) { // TODO: perhaps make 
MatchStep a LocalBarrierStep ??
                         
this.standardAlgorithmBarrier.add(matchTraversal.nextTraverser());
-                        if (null == this.keepLabels || 
this.standardAlgorithmBarrier.size() >= 
PathRetractionStrategy.DEFAULT_STANDARD_BARRIER_SIZE) {
+                        if (null == this.keepLabels || 
this.standardAlgorithmBarrier.size() >= 
PathRetractionStrategy.MAX_BARRIER_SIZE) {
                             stop = true;
                             break;
                         }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c328a42f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/LazyBarrierStrategy.java
----------------------------------------------------------------------
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/LazyBarrierStrategy.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/LazyBarrierStrategy.java
index 5ca5ff2..96da26f 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/LazyBarrierStrategy.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/LazyBarrierStrategy.java
@@ -56,7 +56,7 @@ public final class LazyBarrierStrategy extends 
AbstractTraversalStrategy<Travers
             MatchPredicateStrategy.class));
 
     private static final int BIG_START_SIZE = 5;
-    protected static final int MAX_BARRIER_SIZE = 10000;
+    protected static final int MAX_BARRIER_SIZE = 2500;
 
     private LazyBarrierStrategy() {
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c328a42f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java
----------------------------------------------------------------------
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java
index a85b752..da869b2 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java
@@ -48,9 +48,9 @@ import java.util.Set;
  */
 public final class PathRetractionStrategy extends 
AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy> implements 
TraversalStrategy.OptimizationStrategy {
 
-    public static Integer DEFAULT_STANDARD_BARRIER_SIZE = 2500;
+    public static Integer MAX_BARRIER_SIZE = 2500;
 
-    private static final PathRetractionStrategy INSTANCE = new 
PathRetractionStrategy(DEFAULT_STANDARD_BARRIER_SIZE);
+    private static final PathRetractionStrategy INSTANCE = new 
PathRetractionStrategy(MAX_BARRIER_SIZE);
     // these strategies do strong rewrites involving path labeling and thus, 
should run prior to PathRetractionStrategy
     private static final Set<Class<? extends OptimizationStrategy>> PRIORS = 
new HashSet<>(Arrays.asList(
             RepeatUnrollStrategy.class, MatchPredicateStrategy.class, 
PathProcessorStrategy.class));

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c328a42f/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 36f20ca..31eb0d2 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
@@ -35,6 +35,8 @@ public final class RepeatUnrollStrategy extends 
AbstractTraversalStrategy<Traver
 
     private static final RepeatUnrollStrategy INSTANCE = new 
RepeatUnrollStrategy();
 
+    protected static final int MAX_BARRIER_SIZE = 2500;
+
     private RepeatUnrollStrategy() {
     }
 
@@ -57,7 +59,7 @@ public final class RepeatUnrollStrategy extends 
AbstractTraversalStrategy<Traver
                         TraversalHelper.insertTraversal(insertIndex, 
repeatTraversal.clone(), traversal);
                         insertIndex = insertIndex + repeatLength;
                         if (j != (loops - 1) || 
!(traversal.getSteps().get(insertIndex).getNextStep() instanceof Barrier)) // 
only add a final NoOpBarrier is subsequent step is not a barrier
-                            traversal.addStep(++insertIndex, new 
NoOpBarrierStep<>(traversal, 5000));
+                            traversal.addStep(++insertIndex, new 
NoOpBarrierStep<>(traversal, MAX_BARRIER_SIZE));
                     }
                     // label last step if repeat() was labeled
                     if (!repeatStep.getLabels().isEmpty())

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c328a42f/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/LazyBarrierStrategyTest.java
----------------------------------------------------------------------
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/LazyBarrierStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/LazyBarrierStrategyTest.java
index dfa9665..e1b9a94 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/LazyBarrierStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/LazyBarrierStrategyTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization;
 
+import com.sun.org.apache.regexp.internal.RE;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
@@ -68,37 +69,39 @@ public class LazyBarrierStrategyTest {
 
     @Parameterized.Parameters(name = "{0}")
     public static Iterable<Object[]> generateTestParameters() {
-        final int SIZE = LazyBarrierStrategy.MAX_BARRIER_SIZE;
+        final int LAZY_SIZE = LazyBarrierStrategy.MAX_BARRIER_SIZE;
+        final int REPEAT_SIZE = RepeatUnrollStrategy.MAX_BARRIER_SIZE;
+        final int PATH_SIZE = PathRetractionStrategy.MAX_BARRIER_SIZE;
         return Arrays.asList(new Object[][]{
                 {__.out().count(), __.out().count(), Collections.emptyList()},
                 {__.out().out().count(), __.out().out().count(), 
Collections.emptyList()},
-                {__.out().out().out().count(), 
__.out().out().barrier(SIZE).out().count(), Collections.emptyList()},
-                {__.out().out().out().out().count(), 
__.out().out().barrier(SIZE).out().barrier(SIZE).out().count(), 
Collections.emptyList()},
-                {__.out().out().out().count(), 
__.out().out().barrier(SIZE).outE().count(), 
Arrays.asList(RangeByIsCountStrategy.instance(), 
AdjacentToIncidentStrategy.instance())},
-                {__.out().out().out().count().is(P.gt(10)), 
__.out().out().barrier(SIZE).outE().limit(11).count().is(P.gt(10)), 
Arrays.asList(RangeByIsCountStrategy.instance(), 
AdjacentToIncidentStrategy.instance())},
-                {__.outE().inV().outE().inV().outE().inV().groupCount(), 
__.outE().inV().outE().inV().barrier(SIZE).outE().inV().groupCount(), 
Collections.emptyList()},
-                {__.outE().inV().outE().inV().outE().inV().groupCount(), 
__.out().out().barrier(SIZE).out().groupCount(), 
Collections.singletonList(IncidentToAdjacentStrategy.instance())},
-                {__.out().out().has("age", 32).out().count(), 
__.out().out().barrier(SIZE).has("age", 32).out().count(), 
Collections.emptyList()},
-                {__.V().out().out().has("age", 32).out().count(), 
__.V().out().barrier(SIZE).out().barrier(SIZE).has("age", 32).out().count(), 
Collections.emptyList()},
-                {__.V().out().has("age", 32).out().count(), 
__.V().out().barrier(SIZE).has("age", 32).out().count(), 
Collections.emptyList()},
-                {__.V().out().has("age", 32).V().out().count(), 
__.V().out().barrier(SIZE).has("age", 32).V().barrier(SIZE).out().count(), 
Collections.emptyList()},
+                {__.out().out().out().count(), 
__.out().out().barrier(LAZY_SIZE).out().count(), Collections.emptyList()},
+                {__.out().out().out().out().count(), 
__.out().out().barrier(LAZY_SIZE).out().barrier(LAZY_SIZE).out().count(), 
Collections.emptyList()},
+                {__.out().out().out().count(), 
__.out().out().barrier(LAZY_SIZE).outE().count(), 
Arrays.asList(RangeByIsCountStrategy.instance(), 
AdjacentToIncidentStrategy.instance())},
+                {__.out().out().out().count().is(P.gt(10)), 
__.out().out().barrier(LAZY_SIZE).outE().limit(11).count().is(P.gt(10)), 
Arrays.asList(RangeByIsCountStrategy.instance(), 
AdjacentToIncidentStrategy.instance())},
+                {__.outE().inV().outE().inV().outE().inV().groupCount(), 
__.outE().inV().outE().inV().barrier(LAZY_SIZE).outE().inV().groupCount(), 
Collections.emptyList()},
+                {__.outE().inV().outE().inV().outE().inV().groupCount(), 
__.out().out().barrier(LAZY_SIZE).out().groupCount(), 
Collections.singletonList(IncidentToAdjacentStrategy.instance())},
+                {__.out().out().has("age", 32).out().count(), 
__.out().out().barrier(LAZY_SIZE).has("age", 32).out().count(), 
Collections.emptyList()},
+                {__.V().out().out().has("age", 32).out().count(), 
__.V().out().barrier(LAZY_SIZE).out().barrier(LAZY_SIZE).has("age", 
32).out().count(), Collections.emptyList()},
+                {__.V().out().has("age", 32).out().count(), 
__.V().out().barrier(LAZY_SIZE).has("age", 32).out().count(), 
Collections.emptyList()},
+                {__.V().out().has("age", 32).V().out().count(), 
__.V().out().barrier(LAZY_SIZE).has("age", 
32).V().barrier(LAZY_SIZE).out().count(), Collections.emptyList()},
                 {__.repeat(__.out()).times(4), __.repeat(__.out()).times(4), 
Collections.emptyList()},
-                {__.repeat(__.out()).times(4), 
__.out().barrier(5000).out().barrier(5000).out().barrier(5000).out().barrier(5000),
 Collections.singletonList(RepeatUnrollStrategy.instance())},
-                {__.out().out().as("a").select("a").out(), 
__.out().out().barrier(SIZE).as("a").select("a").out(), 
Collections.emptyList()},
-                {__.out().out().as("a").select("a").out(), 
__.out().out().barrier(SIZE).as("a").select("a").barrier(2500).out().barrier(SIZE),
 Collections.singletonList(PathRetractionStrategy.instance())},
-                {__.out().out().as("a").out().select("a").out(), 
__.out().out().barrier(SIZE).as("a").out().select("a").barrier(2500).out().barrier(SIZE),
 Collections.singletonList(PathRetractionStrategy.instance())},
-                {__.out().out().out().limit(10).out(), 
__.out().out().barrier(SIZE).out().limit(10).out().barrier(SIZE), 
Collections.emptyList()},
-                {__.V().out().in().where(P.neq("a")), 
__.V().out().barrier(SIZE).in().barrier(SIZE).where(P.neq("a")), 
Collections.emptyList()},
+                {__.repeat(__.out()).times(4), 
__.out().barrier(REPEAT_SIZE).out().barrier(REPEAT_SIZE).out().barrier(REPEAT_SIZE).out().barrier(REPEAT_SIZE),
 Collections.singletonList(RepeatUnrollStrategy.instance())},
+                {__.out().out().as("a").select("a").out(), 
__.out().out().barrier(LAZY_SIZE).as("a").select("a").out(), 
Collections.emptyList()},
+                {__.out().out().as("a").select("a").out(), 
__.out().out().barrier(LAZY_SIZE).as("a").select("a").barrier(PATH_SIZE).out().barrier(LAZY_SIZE),
 Collections.singletonList(PathRetractionStrategy.instance())},
+                {__.out().out().as("a").out().select("a").out(), 
__.out().out().barrier(LAZY_SIZE).as("a").out().select("a").barrier(PATH_SIZE).out().barrier(LAZY_SIZE),
 Collections.singletonList(PathRetractionStrategy.instance())},
+                {__.out().out().out().limit(10).out(), 
__.out().out().barrier(LAZY_SIZE).out().limit(10).out().barrier(LAZY_SIZE), 
Collections.emptyList()},
+                {__.V().out().in().where(P.neq("a")), 
__.V().out().barrier(LAZY_SIZE).in().barrier(LAZY_SIZE).where(P.neq("a")), 
Collections.emptyList()},
                 {__.V().as("a").out().in().where(P.neq("a")), 
__.V().as("a").out().in().where(P.neq("a")), Collections.emptyList()},
-                {__.out().out().in().where(P.neq("a")), 
__.out().out().barrier(SIZE).in().barrier(SIZE).where(P.neq("a")), 
Collections.emptyList()},
+                {__.out().out().in().where(P.neq("a")), 
__.out().out().barrier(LAZY_SIZE).in().barrier(LAZY_SIZE).where(P.neq("a")), 
Collections.emptyList()},
                 {__.out().as("a").out().in().where(P.neq("a")), 
__.out().as("a").out().in().where(P.neq("a")), Collections.emptyList()},
-                {__.out().as("a").out().in().where(P.neq("a")).out().out(), 
__.out().as("a").out().in().where(P.neq("a")).barrier(2500).out().barrier(SIZE).out().barrier(SIZE),
 Collections.singletonList(PathRetractionStrategy.instance())},
-                
{__.out().as("a").out().as("b").in().where(P.neq("a")).out().out(), 
__.out().as("a").out().as("b").in().where(P.neq("a")).barrier(2500).out().barrier(SIZE).out().barrier(SIZE),
 Collections.singletonList(PathRetractionStrategy.instance())},
+                {__.out().as("a").out().in().where(P.neq("a")).out().out(), 
__.out().as("a").out().in().where(P.neq("a")).barrier(LAZY_SIZE).out().barrier(LAZY_SIZE).out().barrier(LAZY_SIZE),
 Collections.singletonList(PathRetractionStrategy.instance())},
+                
{__.out().as("a").out().as("b").in().where(P.neq("a")).out().out(), 
__.out().as("a").out().as("b").in().where(P.neq("a")).barrier(PATH_SIZE).out().barrier(LAZY_SIZE).out().barrier(LAZY_SIZE),
 Collections.singletonList(PathRetractionStrategy.instance())},
                 
{__.out().as("a").out().as("b").in().where(P.neq("a")).out().out(), 
__.out().as("a").out().as("b").in().where(P.neq("a")).out().out(), 
Collections.emptyList()},
-                
{__.out().as("a").out().as("b").in().where(P.neq("a")).out().select("b").out(), 
__.out().as("a").out().as("b").in().where(P.neq("a")).barrier(2500).out().select("b").barrier(2500).out().barrier(SIZE),
 Collections.singletonList(PathRetractionStrategy.instance())},
-                
{__.out().as("a").out().as("b").in().where(P.neq("a")).out().select("b").out().out(),
 
__.out().as("a").out().as("b").in().where(P.neq("a")).barrier(2500).out().select("b").barrier(2500).out().barrier(SIZE).out().barrier(SIZE),
 Collections.singletonList(PathRetractionStrategy.instance())},
-                
{__.V().out().out().groupCount().by(__.out().out().out()).out(), 
__.V().out().barrier(SIZE).out().groupCount().by(__.out().out().barrier(SIZE).out()).out().barrier(SIZE),
 Collections.emptyList()},
-                
{__.V().out().out().groupCount().by(__.out().out().out()).out().as("a"), 
__.V().out().barrier(SIZE).out().groupCount().by(__.out().out().barrier(SIZE).out()).out().barrier(SIZE).as("a"),
 Collections.emptyList()}
+                
{__.out().as("a").out().as("b").in().where(P.neq("a")).out().select("b").out(), 
__.out().as("a").out().as("b").in().where(P.neq("a")).barrier(PATH_SIZE).out().select("b").barrier(PATH_SIZE).out().barrier(LAZY_SIZE),
 Collections.singletonList(PathRetractionStrategy.instance())},
+                
{__.out().as("a").out().as("b").in().where(P.neq("a")).out().select("b").out().out(),
 
__.out().as("a").out().as("b").in().where(P.neq("a")).barrier(PATH_SIZE).out().select("b").barrier(PATH_SIZE).out().barrier(LAZY_SIZE).out().barrier(LAZY_SIZE),
 Collections.singletonList(PathRetractionStrategy.instance())},
+                
{__.V().out().out().groupCount().by(__.out().out().out()).out(), 
__.V().out().barrier(LAZY_SIZE).out().groupCount().by(__.out().out().barrier(LAZY_SIZE).out()).out().barrier(LAZY_SIZE),
 Collections.emptyList()},
+                
{__.V().out().out().groupCount().by(__.out().out().out()).out().as("a"), 
__.V().out().barrier(LAZY_SIZE).out().groupCount().by(__.out().out().barrier(LAZY_SIZE).out()).out().barrier(LAZY_SIZE).as("a"),
 Collections.emptyList()}
         });
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c328a42f/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java
----------------------------------------------------------------------
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java
index e95c729..fc1bc10 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java
@@ -28,7 +28,6 @@ import 
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
 import org.apache.tinkerpop.gremlin.process.traversal.step.PathProcessor;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
 import 
org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalStrategies;
-import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -46,7 +45,7 @@ import static 
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.limit;
 import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.out;
 import static 
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.select;
 import static 
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.values;
-import static 
org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.PathRetractionStrategy.DEFAULT_STANDARD_BARRIER_SIZE;
+import static 
org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.PathRetractionStrategy.MAX_BARRIER_SIZE;
 import static org.junit.Assert.assertEquals;
 
 /**
@@ -138,16 +137,16 @@ public class PathRetractionStrategyTest {
                 
{__.V().as("a").repeat(out().where(neq("a"))).emit().select("a").values("test"),
 "[[[a]], []]", null},
                 // given the way this test harness is structured, I have to 
manual test for RepeatUnrollStrategy (and it works) TODO: add more test 
parameters
                 // 
{__.V().as("a").repeat(__.out().where(neq("a"))).times(3).select("a").values("test"),
 Arrays.asList(Collections.singleton("a"), Collections.singleton("a"), 
Collections.singleton("a"), Collections.emptySet())}
-                {__.V().as("a").out().as("b").select("a").out().out(), "[[]]", 
__.V().as("a").out().as("b").select("a").barrier(DEFAULT_STANDARD_BARRIER_SIZE).out().out()},
+                {__.V().as("a").out().as("b").select("a").out().out(), "[[]]", 
__.V().as("a").out().as("b").select("a").barrier(MAX_BARRIER_SIZE).out().out()},
                 {__.V().as("a").out().as("b").select("a").count(), "[[]]", 
__.V().as("a").out().as("b").select("a").count()},
                 {__.V().as("a").out().as("b").select("a").barrier().count(), 
"[[]]", __.V().as("a").out().as("b").select("a").barrier().count()},
                 {__.V().as("a").out().as("b").dedup("a", "b").out(), "[[]]", 
__.V().as("a").out().as("b").dedup("a", "b").out()},
                 {__.V().as("a").out().as("b").match(as("a").out().as("b")), 
"[[a, b]]", __.V().as("a").out().as("b").match(as("a").out().as("b"))},
-                
{__.V().as("a").out().as("b").match(as("a").out().as("b")).select("a"), "[[a], 
[]]", 
__.V().as("a").out().as("b").match(as("a").out().as("b")).select("a").barrier(DEFAULT_STANDARD_BARRIER_SIZE)},
-                
{__.V().as("a").out().as("b").match(as("a").out().as("b")).select("a").out().dedup("a"),
 "[[a], [a], []]", 
__.V().as("a").out().as("b").match(as("a").out().as("b")).select("a").barrier(DEFAULT_STANDARD_BARRIER_SIZE).out().dedup("a")},
-                {__.V().as("a").out().as("b").where(P.gt("a")).out().out(), 
"[[]]", 
__.V().as("a").out().as("b").where(P.gt("a")).barrier(DEFAULT_STANDARD_BARRIER_SIZE).out().out()},
+                
{__.V().as("a").out().as("b").match(as("a").out().as("b")).select("a"), "[[a], 
[]]", 
__.V().as("a").out().as("b").match(as("a").out().as("b")).select("a").barrier(MAX_BARRIER_SIZE)},
+                
{__.V().as("a").out().as("b").match(as("a").out().as("b")).select("a").out().dedup("a"),
 "[[a], [a], []]", 
__.V().as("a").out().as("b").match(as("a").out().as("b")).select("a").barrier(MAX_BARRIER_SIZE).out().dedup("a")},
+                {__.V().as("a").out().as("b").where(P.gt("a")).out().out(), 
"[[]]", 
__.V().as("a").out().as("b").where(P.gt("a")).barrier(MAX_BARRIER_SIZE).out().out()},
                 {__.V().as("a").out().as("b").where(P.gt("a")).count(), 
"[[]]", __.V().as("a").out().as("b").where(P.gt("a")).count()},
-                
{__.V().as("a").out().as("b").select("a").as("c").where(P.gt("b")).out(), 
"[[b], []]", 
__.V().as("a").out().as("b").select("a").as("c").barrier(DEFAULT_STANDARD_BARRIER_SIZE).where(P.gt("b")).barrier(DEFAULT_STANDARD_BARRIER_SIZE).out()},
+                
{__.V().as("a").out().as("b").select("a").as("c").where(P.gt("b")).out(), 
"[[b], []]", 
__.V().as("a").out().as("b").select("a").as("c").barrier(MAX_BARRIER_SIZE).where(P.gt("b")).barrier(MAX_BARRIER_SIZE).out()},
                 
{__.V().select("c").map(select("c").map(select("c"))).select("c"), "[[c], [[c], 
[[c]]], []]", null},
                 
{__.V().select("c").map(select("c").map(select("c"))).select("b"), "[[b, c], 
[[b, c], [[b]]], []]", null},
                 {__.V().as("a").out().as("b").select("a").select("b").union(

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c328a42f/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RepeatUnrollStrategyTest.java
----------------------------------------------------------------------
diff --git 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RepeatUnrollStrategyTest.java
 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RepeatUnrollStrategyTest.java
index 3ebc7d8..07c53cb 100644
--- 
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RepeatUnrollStrategyTest.java
+++ 
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/RepeatUnrollStrategyTest.java
@@ -77,7 +77,7 @@ public class RepeatUnrollStrategyTest {
 
         @Parameterized.Parameters(name = "{0}")
         public static Iterable<Object[]> generateTestParameters() {
-            final int maxBarrierSize = 5000;
+            final int maxBarrierSize = RepeatUnrollStrategy.MAX_BARRIER_SIZE;
             final Predicate<Traverser<Vertex>> predicate = t -> t.loops() > 5;
             return Arrays.asList(new Object[][]{
                     {__.repeat(out()).times(0), __.repeat(out()).times(0), 
Collections.emptyList()},

Reply via email to