You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2021/03/03 21:40:58 UTC

[tinkerpop] branch TINKERPOP-1994 created (now 8cc36b8)

This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a change to branch TINKERPOP-1994
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git.


      at 8cc36b8  TINKERPOP-1994 Moved barrier() addition from PathRetractionStrategy to LazyBarrierStrategy

This branch includes the following new commits:

     new 8cc36b8  TINKERPOP-1994 Moved barrier() addition from PathRetractionStrategy to LazyBarrierStrategy

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[tinkerpop] 01/01: TINKERPOP-1994 Moved barrier() addition from PathRetractionStrategy to LazyBarrierStrategy

Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch TINKERPOP-1994
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 8cc36b8ef646ad58e978d29152241d259a3ad30a
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Wed Mar 3 16:40:15 2021 -0500

    TINKERPOP-1994 Moved barrier() addition from PathRetractionStrategy to LazyBarrierStrategy
---
 CHANGELOG.asciidoc                                 |  1 +
 .../process/traversal/step/map/MatchStep.java      |  4 +--
 .../strategy/optimization/LazyBarrierStrategy.java | 15 ++++++++++-
 .../optimization/PathRetractionStrategy.java       | 27 +++++--------------
 .../optimization/LazyBarrierStrategyTest.java      | 31 +++++++++++++---------
 .../optimization/PathRetractionStrategyTest.java   | 13 +++++----
 6 files changed, 50 insertions(+), 41 deletions(-)

diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index e396795..6b35c32 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -29,6 +29,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 * Allowed setting `ssl_options` for gremlin-python.  
 * Fixed bug with global `dedup()` when used in reducing `by()` of `group()`.
 * Fixed bug with Javascript Groovy `Translator` when generating Gremlin with multiple embedded traversals.
+* Refactored strategies such that `barrier()` is only inserted with `LazyBarrierStrategy`.
 * Modified Gremlin Server `Settings` to be more extensible allowing for custom options with the YAML parser.
 * Fixed `toString()` representation of `P` when string values are present in Javascript.
 
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 6de3970..a845af0 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
@@ -37,7 +37,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.ProfileStep;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ConnectiveStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.PathRetractionStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.LazyBarrierStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
 import org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal;
@@ -371,7 +371,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.MAX_BARRIER_SIZE) {
+                        if (null == this.keepLabels || this.standardAlgorithmBarrier.size() >= LazyBarrierStrategy.MAX_BARRIER_SIZE) {
                             stop = true;
                             break;
                         }
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 b942d8f..6f63d1f 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
@@ -28,6 +28,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.NoneStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.FlatMapStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.NoOpBarrierStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.ProfileSideEffectStep;
@@ -68,7 +69,7 @@ public final class LazyBarrierStrategy extends AbstractTraversalStrategy<Travers
             EarlyLimitStrategy.class));
 
     private static final int BIG_START_SIZE = 5;
-    protected static final int MAX_BARRIER_SIZE = 2500;
+    public static final int MAX_BARRIER_SIZE = 2500;
 
     private LazyBarrierStrategy() {
     }
@@ -92,6 +93,18 @@ public final class LazyBarrierStrategy extends AbstractTraversalStrategy<Travers
                 final Set<String> keepLabels = ((PathProcessor) step).getKeepLabels();
                 if (null != keepLabels && keepLabels.isEmpty()) // if no more path data, then start barrier'ing again
                     labeledPath = false;
+
+                // OLTP barrier optimization that will try and bulk traversers after a path processor step to thin
+                // the stream
+                final boolean onGraphComputer = TraversalHelper.onGraphComputer(traversal);
+                if (!onGraphComputer &&
+                        !(step instanceof MatchStep) &&
+                        !(step instanceof Barrier) &&
+                        !(step.getNextStep() instanceof Barrier) &&
+                        !(step.getTraversal().getParent() instanceof MatchStep) &&
+                        !(step.getNextStep() instanceof NoneStep) &&
+                        !(step.getNextStep() instanceof EmptyStep))
+                    TraversalHelper.insertAfterStep(new NoOpBarrierStep<>(traversal, MAX_BARRIER_SIZE), step, traversal);
             }
             if (step instanceof FlatMapStep &&
                     !(step instanceof VertexStep && ((VertexStep) step).returnsEdge()) ||
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 d370c38..1e4c538 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
@@ -22,16 +22,13 @@ import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.VertexPr
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
-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.PathProcessor;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
 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.filter.FilterStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.NoneStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.NoOpBarrierStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectOneStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
@@ -54,9 +51,14 @@ import java.util.Set;
  */
 public final class PathRetractionStrategy extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy> implements TraversalStrategy.OptimizationStrategy {
 
+    /**
+     * @deprecated As of release 3.4.11, not replaced as barriers are not inserted by this strategy anymore.
+     */
+    @Deprecated
     public static Integer MAX_BARRIER_SIZE = 2500;
 
-    private static final PathRetractionStrategy INSTANCE = new PathRetractionStrategy(MAX_BARRIER_SIZE);
+    private static final PathRetractionStrategy INSTANCE = new PathRetractionStrategy();
+
     // 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,
@@ -64,12 +66,6 @@ public final class PathRetractionStrategy extends AbstractTraversalStrategy<Trav
             PathProcessorStrategy.class));
     private static final String MARKER = Graph.Hidden.hide("gremlin.pathRetraction");
 
-    private final int standardBarrierSize;
-
-    private PathRetractionStrategy(final int standardBarrierSize) {
-        this.standardBarrierSize = standardBarrierSize;
-    }
-
     public static PathRetractionStrategy instance() {
         return INSTANCE;
     }
@@ -92,7 +88,6 @@ public final class PathRetractionStrategy extends AbstractTraversalStrategy<Trav
             return;
         }
 
-        final boolean onGraphComputer = TraversalHelper.onGraphComputer(traversal);
         final Set<String> foundLabels = new HashSet<>();
         final Set<String> keepLabels = new HashSet<>();
 
@@ -130,16 +125,6 @@ public final class PathRetractionStrategy extends AbstractTraversalStrategy<Trav
                     pathProcessor.setKeepLabels(((MatchStep) currentStep.getTraversal().getParent().asStep()).getMatchStartLabels());
                     pathProcessor.getKeepLabels().addAll(((MatchStep) currentStep.getTraversal().getParent().asStep()).getMatchEndLabels());
                 }
-
-                // OLTP barrier optimization that will try and bulk traversers after a path processor step to thin the stream
-                if (!onGraphComputer &&
-                        !(currentStep instanceof MatchStep) &&
-                        !(currentStep instanceof Barrier) &&
-                        !(currentStep.getNextStep() instanceof Barrier) &&
-                        !(currentStep.getTraversal().getParent() instanceof MatchStep) &&
-                        !(currentStep.getNextStep() instanceof NoneStep) &&
-                        !(currentStep.getNextStep() instanceof EmptyStep))
-                    TraversalHelper.insertAfterStep(new NoOpBarrierStep<>(traversal, this.standardBarrierSize), currentStep, traversal);
             }
         }
 
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 77655dd..1788346 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
@@ -19,10 +19,12 @@
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization;
 
 import org.apache.tinkerpop.gremlin.process.traversal.P;
+import org.apache.tinkerpop.gremlin.process.traversal.Translator;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
+import org.apache.tinkerpop.gremlin.process.traversal.translator.GroovyTranslator;
 import org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalStrategies;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -32,6 +34,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 
+import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.as;
 import static org.junit.Assert.assertEquals;
 
 /**
@@ -46,16 +49,17 @@ public class LazyBarrierStrategyTest {
     }
 
     @Parameterized.Parameter(value = 0)
-    public Traversal original;
+    public Traversal.Admin original;
 
     @Parameterized.Parameter(value = 1)
-    public Traversal optimized;
+    public Traversal.Admin optimized;
 
     @Parameterized.Parameter(value = 2)
     public Collection<TraversalStrategy> otherStrategies;
 
     @Test
     public void doTest() {
+        final Translator<String,String> translator = GroovyTranslator.of("__");
         final TraversalStrategies strategies = new DefaultTraversalStrategies();
         strategies.addStrategies(LazyBarrierStrategy.instance());
         for (final TraversalStrategy strategy : this.otherStrategies) {
@@ -63,14 +67,13 @@ public class LazyBarrierStrategyTest {
         }
         this.original.asAdmin().setStrategies(strategies);
         this.original.asAdmin().applyStrategies();
-        assertEquals(this.optimized, this.original);
+        assertEquals(translator.translate(original.getBytecode()), this.optimized, this.original);
     }
 
     @Parameterized.Parameters(name = "{0}")
     public static Iterable<Object[]> generateTestParameters() {
         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()},
@@ -86,19 +89,19 @@ public class LazyBarrierStrategyTest {
                 {__.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(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(), 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(), Collections.singletonList(PathRetractionStrategy.instance())},
+                {__.out().out().as("a").select("a").out(), __.out().out().barrier(LAZY_SIZE).as("a").select("a").barrier(LAZY_SIZE).out(), Collections.emptyList()},
+                {__.out().out().as("a").select("a").out(), __.out().out().barrier(LAZY_SIZE).as("a").select("a").barrier(LAZY_SIZE).out(), Collections.singletonList(PathRetractionStrategy.instance())},
+                {__.out().out().as("a").out().select("a").out(), __.out().out().barrier(LAZY_SIZE).as("a").out().select("a").barrier(LAZY_SIZE).out(), Collections.singletonList(PathRetractionStrategy.instance())},
                 {__.out().out().out().limit(10).out(), __.out().out().barrier(LAZY_SIZE).out().limit(10).out(), 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(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(LAZY_SIZE).out().barrier(LAZY_SIZE).out(), 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(), 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(PATH_SIZE).out().select("b").barrier(PATH_SIZE).out(), 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(), 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(LAZY_SIZE).out().barrier(LAZY_SIZE).out(), 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(LAZY_SIZE).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(LAZY_SIZE).out().select("b").barrier(LAZY_SIZE).out(), 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(LAZY_SIZE).out().select("b").barrier(LAZY_SIZE).out().barrier(LAZY_SIZE).out(), 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(), 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().as("a"), Collections.emptyList()},
                 {__.out().drop(), __.out().drop(), Collections.emptyList()},
@@ -112,7 +115,11 @@ public class LazyBarrierStrategyTest {
                 {__.V().both().profile(), __.V().both().profile(), Collections.emptyList() },
                 {__.V().both().both().profile(), __.V().both().barrier(LAZY_SIZE).both().profile(), Collections.emptyList() },
                 {__.V().both().local(__.both().both().out()).profile(), __.V().both().barrier(LAZY_SIZE).local(__.both().both().barrier(LAZY_SIZE).out()).profile(), Collections.emptyList() },
-                {__.V().both().local(__.both().both().out()).in().profile(), __.V().both().barrier(LAZY_SIZE).local(__.both().both().barrier(LAZY_SIZE).out()).in().profile(), Collections.emptyList() }
+                {__.V().both().local(__.both().both().out()).in().profile(), __.V().both().barrier(LAZY_SIZE).local(__.both().both().barrier(LAZY_SIZE).out()).in().profile(), Collections.emptyList() },
+                {__.V().as("a").out().as("b").select("a").out().out(), __.V().as("a").out().as("b").select("a").barrier(LAZY_SIZE).out().out(), Collections.emptyList() },
+                {__.V().as("a").out().as("b").select("a").as("c").where(P.gt("b")).out(), __.V().as("a").out().as("b").select("a").as("c").barrier(LAZY_SIZE).where(P.gt("b")).barrier(LAZY_SIZE).out(), Collections.emptyList()},
+                {__.V().as("a").out().as("b").where(P.gt("a")).out().out(), __.V().as("a").out().as("b").where(P.gt("a")).barrier(LAZY_SIZE).out().out(), Collections.emptyList() },
+                {__.V().as("a").out().as("b").match(as("a").out().as("b")).select("a").out().dedup("a"), __.V().as("a").out().as("b").match(as("a").out().as("b")).select("a").barrier(LAZY_SIZE).out().dedup("a"), Collections.emptyList()},
         });
     }
 }
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 0669b08..9afbd16 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
@@ -23,11 +23,13 @@ import org.apache.tinkerpop.gremlin.process.traversal.Order;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.Scope;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
+import org.apache.tinkerpop.gremlin.process.traversal.Translator;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
 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.translator.GroovyTranslator;
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
 import org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalStrategies;
 
@@ -87,13 +89,14 @@ public class PathRetractionStrategyTest {
 
     @Test
     public void doTest() {
+        final Translator<String,String> translator = GroovyTranslator.of("__");
         for (final TraversalStrategies currentStrategies : this.strategies) {
             final Traversal.Admin<?, ?> currentTraversal = this.traversal.clone();
             currentTraversal.setStrategies(currentStrategies);
             currentTraversal.applyStrategies();
             assertEquals(this.labels, getKeepLabels(currentTraversal).toString());
             if (null != optimized)
-                assertEquals(currentTraversal, optimized);
+                assertEquals(translator.translate(traversal.getBytecode()), currentTraversal, optimized);
         }
     }
 
@@ -160,16 +163,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(MAX_BARRIER_SIZE).out().out()},
+                {__.V().as("a").out().as("b").select("a").out().out(), "[[]]", __.V().as("a").out().as("b").select("a").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")},
-                {__.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").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").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")).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(MAX_BARRIER_SIZE).where(P.gt("b")).barrier(MAX_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").where(P.gt("b")).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(