tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject [4/4] incubator-tinkerpop git commit: The most brutal refactor. There is no such thing as a TraversalSource.Builder anymore. All there are are TraversalSources. These are simply a wrapper of a TraversalStrategy and a Graph. There is no such thing as a Tr
Date Tue, 09 Feb 2016 00:36:15 GMT
The most brutal refactor. There is no such thing as a TraversalSource.Builder anymore. All there are are TraversalSources. These are simply a wrapper of a TraversalStrategy and a Graph. There is no such thing as a TraversalEngine anymore. What was ComputerTraversalEngine is now simply a strategy of TraversalVertexProgramStrategy. There is no such thing as EngineDependentStrategy -- this is simply TraversalVertexProgramStrategy. In short, all there are are Graphs and TraversalStrategies. So so so so so much cleaner. This WILL NOT be backwards compatible for graph system providers. They will need to update their GraphProvider implementations -- two methods changed. Moreover, if they have an XXXStrategy that calls traversal.getEngine().isComputer(), they will need to change that to traversal.getStrategies().onGraphComputer(). Really simple to for them to fix. It took me less a minute to fix up Spark, Giraph, and Neo4j. These changes WILL be backwards compatible for users at the level of
  graph.traversal(computer(SparkGraphComputer)) still working (though Depcrecation introduced). The GraphTraversal.Builder will simply turn into a bunch of TravesalSource calls. It is not used outside of this context.  This commit is NOT complete and will be completed on the next sprint. Moreover, there are lots of cleanups and JavaDocing that I need to do -- I just don't want to lose this work so pushing.


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

Branch: refs/heads/TINKERPOP-971
Commit: 5f2cd6770d56b69c3b0eebf07152315237837f12
Parents: d974abc
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Mon Feb 8 17:35:46 2016 -0700
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Mon Feb 8 17:35:46 2016 -0700

----------------------------------------------------------------------
 .../computer/GiraphHadoopGraphProvider.java     |  10 +-
 .../GephiTraversalVisualizationStrategy.groovy  |   6 +-
 .../bulkloading/BulkLoaderVertexProgram.java    |   2 +-
 .../peerpressure/PeerPressureVertexProgram.java |  10 +-
 .../ranking/pagerank/PageRankVertexProgram.java |  11 +-
 .../traversal/TraversalVertexProgram.java       |   4 +-
 .../computer/util/DefaultComputerResult.java    |   1 -
 .../gremlin/process/traversal/Traversal.java    |  20 +-
 .../process/traversal/TraversalSource.java      |  43 +--
 .../traversal/TraversalSourceFactory.java       |  46 +++
 .../process/traversal/TraversalStrategies.java  |   9 +-
 .../dsl/graph/GraphTraversalSource.java         | 364 ++++++-------------
 .../engine/ComputerTraversalEngine.java         |  14 +-
 .../engine/StandardTraversalEngine.java         |  10 +-
 .../lambda/AbstractLambdaTraversal.java         |  12 -
 .../process/traversal/step/EngineDependent.java |   4 +-
 .../process/traversal/step/map/GraphStep.java   |  13 +-
 .../step/sideEffect/GroupSideEffectStep.java    |   9 +-
 .../sideEffect/GroupSideEffectStepV3d0.java     |   4 +-
 .../traversal/step/sideEffect/ProfileStep.java  |  11 +-
 .../traversal/step/util/ComputerAwareStep.java  |   9 +-
 .../step/util/ReducingBarrierStep.java          |   5 +-
 .../strategy/decoration/ConnectiveStrategy.java |  24 +-
 .../strategy/decoration/SackStrategy.java       |  52 +++
 .../strategy/decoration/SideEffectStrategy.java |  47 +++
 .../finalization/EngineDependentStrategy.java   |  57 ---
 .../finalization/LazyBarrierStrategy.java       |   6 +-
 .../TraversalVertexProgramStrategy.java         |  83 +++++
 .../optimization/MatchPredicateStrategy.java    |   2 +-
 .../ComputerVerificationStrategy.java           |   2 -
 .../traversal/util/DefaultTraversal.java        |  19 +-
 .../process/traversal/util/EmptyTraversal.java  |  12 -
 .../traversal/util/TraversalScriptFunction.java |   9 +-
 .../traversal/util/TraversalScriptHelper.java   |  14 +-
 .../tinkerpop/gremlin/structure/Graph.java      |  44 ++-
 .../gremlin/structure/util/StringFactory.java   |  14 +-
 .../decoration/ConnectiveStrategyTest.java      | 219 +++++------
 .../finalization/LazyBarrierStrategyTest.java   |  84 ++---
 .../AdjacentToIncidentStrategyTest.java         | 123 ++-----
 .../optimization/FilterRankingStrategyTest.java | 113 ++----
 .../IdentityRemovalStrategyTest.java            | 109 ++----
 .../IncidentToAdjacentStrategyTest.java         | 121 ++----
 .../MatchPredicateStrategyTest.java             |   2 +-
 .../RangeByIsCountStrategyTest.java             | 175 +++------
 .../ComputerVerificationStrategyTest.java       |  20 +-
 .../LambdaRestrictionStrategyTest.java          |   4 +-
 .../StandardVerificationStrategyTest.java       |  21 +-
 .../gremlin/groovy/loaders/StepLoader.groovy    |  21 --
 .../gremlin/groovy/loaders/SugarLoader.groovy   |  12 +-
 .../AbstractImportCustomizerProvider.java       |   2 +-
 .../tinkerpop/gremlin/server/GraphManager.java  |   2 +-
 .../tinkerpop/gremlin/AbstractGremlinTest.java  |  18 +-
 .../apache/tinkerpop/gremlin/GraphManager.java  |   6 +
 .../apache/tinkerpop/gremlin/GraphProvider.java |  23 +-
 .../process/computer/GraphComputerTest.java     | 104 +++---
 .../BulkDumperVertexProgramTest.java            |   4 +-
 .../BulkLoaderVertexProgramTest.java            |  14 +-
 .../PeerPressureVertexProgramTest.java          |   4 +-
 .../pagerank/PageRankVertexProgramTest.java     |   4 +-
 .../traversal/step/sideEffect/ProfileTest.java  |   6 +-
 .../ReadOnlyStrategyProcessTest.java            |   2 +-
 .../script/script-output-grateful-dead.groovy   |   2 +-
 .../groovy/plugin/HadoopRemoteAcceptor.java     |  17 +-
 .../structure/io/AbstractStorageCheck.java      |   8 +-
 .../optimization/Neo4jGraphStepStrategy.java    |   2 +-
 .../structure/NativeNeo4jStructureCheck.java    |   4 +-
 .../process/computer/LocalPropertyTest.java     |   6 +-
 .../computer/SparkHadoopGraphProvider.java      |  13 +-
 .../spark/structure/io/InputOutputRDDTest.java  |   5 +-
 .../spark/structure/io/InputRDDTest.java        |   6 +-
 .../spark/structure/io/OutputRDDTest.java       |   4 +-
 .../io/PersistedInputOutputRDDTest.java         |  11 +-
 .../io/gryo/GryoSerializerIntegrateTest.java    |   6 +-
 .../optimization/TinkerGraphStepStrategy.java   |   4 +-
 .../process/TinkerGraphComputerProvider.java    |  13 +-
 .../TinkerGraphNoStrategyComputerProvider.java  |  31 +-
 .../process/TinkerGraphNoStrategyProvider.java  |  25 +-
 .../structure/TinkerGraphPlayTest.java          |  29 +-
 78 files changed, 967 insertions(+), 1434 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphHadoopGraphProvider.java
----------------------------------------------------------------------
diff --git a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphHadoopGraphProvider.java b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphHadoopGraphProvider.java
index 07b7897..8eae4f1 100644
--- a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphHadoopGraphProvider.java
+++ b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphHadoopGraphProvider.java
@@ -22,8 +22,8 @@ import org.apache.giraph.conf.GiraphConstants;
 import org.apache.tinkerpop.gremlin.GraphProvider;
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.hadoop.HadoopGraphProvider;
+import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 
 import java.util.Map;
@@ -35,7 +35,6 @@ import java.util.concurrent.TimeUnit;
 @GraphProvider.Descriptor(computer = GiraphGraphComputer.class)
 public final class GiraphHadoopGraphProvider extends HadoopGraphProvider {
 
-
     @Override
     public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, final LoadGraphWith.GraphData loadGraphWith) {
         final Map<String, Object> config = super.getBaseConfiguration(graphName, test, testMethodName, loadGraphWith);
@@ -59,6 +58,11 @@ public final class GiraphHadoopGraphProvider extends HadoopGraphProvider {
 
     @Override
     public GraphTraversalSource traversal(final Graph graph) {
-        return GraphTraversalSource.build().engine(ComputerTraversalEngine.build().computer(GiraphGraphComputer.class)).create(graph);
+        return graph.traversal().withComputer(GiraphGraphComputer.class);
+    }
+
+    @Override
+    public GraphComputer getGraphComputer(final Graph graph) {
+        return graph.compute(GiraphGraphComputer.class);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiTraversalVisualizationStrategy.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiTraversalVisualizationStrategy.groovy b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiTraversalVisualizationStrategy.groovy
index 7e390b0..9f3c843 100644
--- a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiTraversalVisualizationStrategy.groovy
+++ b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiTraversalVisualizationStrategy.groovy
@@ -26,9 +26,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traverser
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasStep
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeOtherVertexStep
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeVertexStep
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateStep
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.LambdaSideEffectStep
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy
@@ -66,7 +66,7 @@ class GephiTraversalVisualizationStrategy extends AbstractTraversalStrategy<Trav
 
     @Override
     void apply(final Traversal.Admin<?, ?> traversal) {
-        if (traversal.getEngine().isComputer())
+        if (traversal.getStrategies().onGraphComputer())
             return
 
         // only apply these strategies if the traversal was :submit to the acceptor - otherwise process as usual
@@ -102,7 +102,7 @@ class GephiTraversalVisualizationStrategy extends AbstractTraversalStrategy<Trav
                 TraversalHelper.insertAfterStep(new LambdaSideEffectStep(traversal, { Traverser traverser ->
                     final BulkSet<Object> objects = ((BulkSet<Object>) traverser.sideEffects(sideEffectKey))
                     if (!objects.isEmpty()) {
-                        final List<String> vertices = objects.findAll{ Object o -> o instanceof Vertex}
+                        final List<String> vertices = objects.findAll { Object o -> o instanceof Vertex }
                                 .collect { Object o -> ((Vertex) o).id().toString() }
                         acceptor.updateVisitedVertices(vertices)
                         objects.clear()

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
index 3a10582..8eea782 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
@@ -171,7 +171,7 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
             LOGGER.info("Opened Graph instance: {}", graph);
             try {
                 listener = new BulkLoadingListener();
-                g = GraphTraversalSource.build().with(EventStrategy.build().addListener(listener).create()).create(graph);
+                g = new GraphTraversalSource(graph).withStrategy(EventStrategy.build().addListener(listener).create());
             } catch (Exception e) {
                 try {
                     graph.close();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
index f2989e0..c483d07 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
@@ -23,9 +23,6 @@ import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.computer.Memory;
 import org.apache.tinkerpop.gremlin.process.computer.MessageScope;
 import org.apache.tinkerpop.gremlin.process.computer.Messenger;
-import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalClassFunction;
-import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalObjectFunction;
-import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalScriptFunction;
 import org.apache.tinkerpop.gremlin.process.computer.util.AbstractVertexProgramBuilder;
 import org.apache.tinkerpop.gremlin.process.computer.util.ConfigurationTraversal;
 import org.apache.tinkerpop.gremlin.process.computer.util.StaticVertexProgram;
@@ -33,6 +30,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.MapHelper;
+import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalClassFunction;
+import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalObjectFunction;
+import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalScriptFunction;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
@@ -216,8 +216,8 @@ public class PeerPressureVertexProgram extends StaticVertexProgram<Pair<Serializ
             return this;
         }
 
-        public Builder traversal(final TraversalSource.Builder builder, final String scriptEngine, final String traversalScript, final Object... bindings) {
-            ConfigurationTraversal.storeState(new TraversalScriptFunction<>(builder, scriptEngine, traversalScript, bindings), this.configuration, TRAVERSAL_SUPPLIER);
+        public Builder traversal(final TraversalSource traversalSource, final String scriptEngine, final String traversalScript, final Object... bindings) {
+            ConfigurationTraversal.storeState(new TraversalScriptFunction<>(traversalSource, scriptEngine, traversalScript, bindings), this.configuration, TRAVERSAL_SUPPLIER);
             return this;
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
index efb38ac..931eb12 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
@@ -24,15 +24,15 @@ import org.apache.tinkerpop.gremlin.process.computer.Memory;
 import org.apache.tinkerpop.gremlin.process.computer.MessageCombiner;
 import org.apache.tinkerpop.gremlin.process.computer.MessageScope;
 import org.apache.tinkerpop.gremlin.process.computer.Messenger;
-import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalClassFunction;
-import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalObjectFunction;
-import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalScriptFunction;
 import org.apache.tinkerpop.gremlin.process.computer.util.AbstractVertexProgramBuilder;
 import org.apache.tinkerpop.gremlin.process.computer.util.ConfigurationTraversal;
 import org.apache.tinkerpop.gremlin.process.computer.util.StaticVertexProgram;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
+import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalClassFunction;
+import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalObjectFunction;
+import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalScriptFunction;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
@@ -44,7 +44,6 @@ import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Optional;
 import java.util.Set;
-import java.util.function.Function;
 import java.util.function.Supplier;
 
 /**
@@ -179,8 +178,8 @@ public class PageRankVertexProgram extends StaticVertexProgram<Double> {
             return this;
         }
 
-        public Builder traversal(final TraversalSource.Builder builder, final String scriptEngine, final String traversalScript, final Object... bindings) {
-            ConfigurationTraversal.storeState(new TraversalScriptFunction<>(builder, scriptEngine, traversalScript, bindings), this.configuration, TRAVERSAL_SUPPLIER);
+        public Builder traversal(final TraversalSource traversalSource, final String scriptEngine, final String traversalScript, final Object... bindings) {
+            ConfigurationTraversal.storeState(new TraversalScriptFunction<>(traversalSource, scriptEngine, traversalScript, bindings), this.configuration, TRAVERSAL_SUPPLIER);
             return this;
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/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 fe01ea2..3522469 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
@@ -281,8 +281,8 @@ public final class TraversalVertexProgram implements VertexProgram<TraverserSet<
             super(TraversalVertexProgram.class);
         }
 
-        public Builder traversal(final TraversalSource.Builder builder, final String scriptEngine, final String traversalScript, final Object... bindings) {
-            ConfigurationTraversal.storeState(new TraversalScriptFunction<>(builder, scriptEngine, traversalScript, bindings), this.configuration, TRAVERSAL_SUPPLIER);
+        public Builder traversal(final TraversalSource traversalSource, final String scriptEngine, final String traversalScript, final Object... bindings) {
+            ConfigurationTraversal.storeState(new TraversalScriptFunction<>(traversalSource, scriptEngine, traversalScript, bindings), this.configuration, TRAVERSAL_SUPPLIER);
             return this;
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/DefaultComputerResult.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/DefaultComputerResult.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/DefaultComputerResult.java
index 66873fb..da1ebfc 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/DefaultComputerResult.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/DefaultComputerResult.java
@@ -20,7 +20,6 @@ package org.apache.tinkerpop.gremlin.process.computer.util;
 
 import org.apache.tinkerpop.gremlin.process.computer.ComputerResult;
 import org.apache.tinkerpop.gremlin.process.computer.Memory;
-import org.apache.tinkerpop.gremlin.process.traversal.engine.StandardTraversalEngine;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java
index f167fb3..c4016a7 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java
@@ -20,8 +20,6 @@ package org.apache.tinkerpop.gremlin.process.traversal;
 
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
-import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine;
-import org.apache.tinkerpop.gremlin.process.traversal.engine.StandardTraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.ProfileStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet;
@@ -52,7 +50,7 @@ import java.util.stream.StreamSupport;
  * This is the base interface for all traversal's, where each extending interface is seen as a domain specific language.
  * For example, {@link GraphTraversal} is a domain specific language for traversing a graph using "graph concepts" (e.g. vertices, edges).
  * Another example may represent the graph using "social concepts" (e.g. people, cities, artifacts).
- * A {@link Traversal} is evaluated in one of two ways: {@link StandardTraversalEngine} (OLTP) and {@link ComputerTraversalEngine} (OLAP).
+ * A {@link Traversal} is evaluated in one of two ways: iterator-based OLTP or {@link GraphComputer}-based OLAP.
  * OLTP traversals leverage an iterator and are executed within a single JVM (with data access allowed to be remote).
  * OLAP traversals leverage {@link GraphComputer} and are executed between multiple JVMs (and/or cores).
  *
@@ -345,20 +343,6 @@ public interface Traversal<S, E> extends Iterator<E>, Serializable, Cloneable {
         public void applyStrategies() throws IllegalStateException;
 
         /**
-         * Get the {@link TraversalEngine} that will be used to execute this traversal.
-         *
-         * @return get the traversal engine associated with this traversal.
-         */
-        public TraversalEngine getEngine();
-
-        /**
-         * Set the {@link TraversalEngine} to be used for executing this traversal.
-         *
-         * @param engine the engine to execute the traversal with.
-         */
-        public void setEngine(final TraversalEngine engine);
-
-        /**
          * Get the {@link TraverserGenerator} associated with this traversal.
          * The traversal generator creates {@link Traverser} instances that are respective of the traversal's {@link org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement}.
          *
@@ -381,7 +365,7 @@ public interface Traversal<S, E> extends Iterator<E>, Serializable, Cloneable {
                 requirements.add(TraverserRequirement.SIDE_EFFECTS);
             if (null != this.getSideEffects().getSackInitialValue())
                 requirements.add(TraverserRequirement.SACK);
-            if (this.getEngine().isComputer())
+            if (this.getStrategies().onGraphComputer())
                 requirements.add(TraverserRequirement.BULK);
             if (requirements.contains(TraverserRequirement.ONE_BULK))
                 requirements.remove(TraverserRequirement.BULK);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
index 58884ee..4354767 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
@@ -18,13 +18,8 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal;
 
-import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 
-import java.io.Serializable;
-import java.util.List;
-import java.util.Optional;
-
 /**
  * A {@code TraversalSource} is responsible for generating a {@link Traversal}. A {@code TraversalSource}, once built,
  * can generate any number of {@link Traversal} instances. Each traversal DSL will maintain a corresponding
@@ -32,36 +27,20 @@ import java.util.Optional;
  *
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-public interface TraversalSource {
-
-    public TraversalSource.Builder asBuilder();
-
-    /**
-     * Gets the {@link GraphComputer} associated with the {@code TraversalSource} which could be constructed as empty.
-     */
-    public Optional<GraphComputer> getGraphComputer();
-
-    /**
-     * Gets the {@link Graph} associated with the {@code TraversalSource} which could be constructed as empty.
-     */
-    public Optional<Graph> getGraph();
-
-    /**
-     * Gets the list of {@link TraversalStrategy} instances that will be applied to {@link Traversal} objects
-     * generated from this {@code TraversalSource}.
-     */
-    public List<TraversalStrategy> getStrategies();
-
-    ////////////////
+public interface TraversalSource extends Cloneable {
 
-    public interface Builder<C extends TraversalSource> extends Serializable {
+    // withStrategy
+    // withoutStrategy
+    // withBulk
+    // withPath
+    // withSack
+    // withSideEffect
 
-        public Builder engine(final TraversalEngine.Builder engine);
+    public TraversalStrategies getStrategies();
 
-        public Builder with(final TraversalStrategy strategy);
+    public Graph getGraph();
 
-        public Builder without(final Class<? extends TraversalStrategy> strategyClass);
+    @SuppressWarnings("CloneDoesntDeclareCloneNotSupportedException")
+    public TraversalSource clone();
 
-        public C create(final Graph graph);
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSourceFactory.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSourceFactory.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSourceFactory.java
new file mode 100644
index 0000000..f955d88
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSourceFactory.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tinkerpop.gremlin.process.traversal;
+
+import org.apache.tinkerpop.gremlin.structure.Graph;
+
+import java.io.Serializable;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class TraversalSourceFactory<T extends TraversalSource> implements Serializable {
+
+    private final TraversalStrategies traversalStrategies;
+    private final Class<T> traversalSourceClass;
+
+    public TraversalSourceFactory(final T traversalSource) {
+        this.traversalSourceClass = (Class<T>) traversalSource.getClass();
+        this.traversalStrategies = traversalSource.getStrategies();
+    }
+
+    public T createTraversalSource(final Graph graph) {
+        try {
+            return this.traversalSourceClass.getConstructor(Graph.class, TraversalStrategies.class).newInstance(graph, this.traversalStrategies);
+        } catch (final Exception e) {
+            throw new IllegalStateException(e.getMessage(), e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
index cdd2f9a..2ef0df3 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
@@ -19,15 +19,14 @@
 package org.apache.tinkerpop.gremlin.process.traversal;
 
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ConnectiveStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.EngineDependentStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.ProfileStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.TraversalVertexProgramStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.AdjacentToIncidentStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.FilterRankingStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IdentityRemovalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IncidentToAdjacentStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.MatchPredicateStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.RangeByIsCountStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ComputerVerificationStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.StandardVerificationStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserGeneratorFactory;
 import org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalStrategies;
@@ -62,6 +61,10 @@ public interface TraversalStrategies extends Serializable, Cloneable {
      */
     public List<TraversalStrategy<?>> toList();
 
+    public default boolean onGraphComputer() {
+        return toList().stream().filter(strategy -> strategy instanceof TraversalVertexProgramStrategy).findAny().isPresent();
+    }
+
     /**
      * Apply all the {@link TraversalStrategy} optimizers to the {@link Traversal} for the stated {@link TraversalEngine}.
      * This method must ensure that the strategies are sorted prior to application.
@@ -197,7 +200,6 @@ public interface TraversalStrategies extends Serializable, Cloneable {
             final TraversalStrategies coreStrategies = new DefaultTraversalStrategies();
             coreStrategies.addStrategies(
                     ConnectiveStrategy.instance(),
-                    EngineDependentStrategy.instance(),
                     ProfileStrategy.instance(),
                     IncidentToAdjacentStrategy.instance(),
                     AdjacentToIncidentStrategy.instance(),
@@ -205,7 +207,6 @@ public interface TraversalStrategies extends Serializable, Cloneable {
                     IdentityRemovalStrategy.instance(),
                     MatchPredicateStrategy.instance(),
                     RangeByIsCountStrategy.instance(),
-                    ComputerVerificationStrategy.instance(),
                     StandardVerificationStrategy.instance());
             //LambdaRestrictionStrategy.instance(),
             //LazyBarrierStrategy.instance(),

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
index 8395ace..0b7058c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
@@ -19,14 +19,15 @@
 package org.apache.tinkerpop.gremlin.process.traversal.dsl.graph;
 
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine;
-import org.apache.tinkerpop.gremlin.process.traversal.engine.StandardTraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStartStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SackStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SideEffectStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.TraversalVertexProgramStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ComputerVerificationStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
@@ -34,12 +35,13 @@ import org.apache.tinkerpop.gremlin.structure.Transaction;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 import org.apache.tinkerpop.gremlin.util.function.ConstantSupplier;
+import org.javatuples.Pair;
 
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import java.util.Optional;
 import java.util.function.BinaryOperator;
+import java.util.function.Function;
 import java.util.function.Supplier;
 import java.util.function.UnaryOperator;
 
@@ -48,317 +50,187 @@ import java.util.function.UnaryOperator;
  */
 public class GraphTraversalSource implements TraversalSource {
 
-    public static Builder standard() {
-        return GraphTraversalSource.build().engine(StandardTraversalEngine.build());
-    }
+    private final Graph graph;
+    private TraversalStrategies strategies;
+    private boolean oneBulk = false;
+    private boolean pathOn = false;
 
-    public static Builder computer() {
-        return GraphTraversalSource.build().engine(ComputerTraversalEngine.build());
+    public GraphTraversalSource(final Graph graph, final TraversalStrategies traversalStrategies) {
+        this.graph = graph;
+        this.strategies = traversalStrategies;
     }
 
-    public static Builder computer(final Class<? extends GraphComputer> graphComputerClass) {
-        return GraphTraversalSource.build().engine(ComputerTraversalEngine.build().computer(graphComputerClass));
-    }
-
-    ////
-
-    private final transient Graph graph;
-    private final TraversalEngine.Builder engineBuilder;
-    private final TraversalStrategies strategies;
-    private final List<TraversalStrategy> withStrategies;
-    private final List<Class<? extends TraversalStrategy>> withoutStrategies;
-
-    private GraphTraversalSource(final Graph graph, final TraversalEngine.Builder engineBuilder, final List<TraversalStrategy> withStrategies, final List<Class<? extends TraversalStrategy>> withoutStrategies) {
-        this.graph = graph;
-        this.engineBuilder = engineBuilder;
-        this.withStrategies = withStrategies;
-        this.withoutStrategies = withoutStrategies;
-        this.withStrategies.addAll(engineBuilder.getWithStrategies());
-        this.withoutStrategies.addAll(engineBuilder.getWithoutStrategies());
-        final TraversalStrategies tempStrategies = TraversalStrategies.GlobalCache.getStrategies(this.graph.getClass());
-        this.strategies = withStrategies.isEmpty() && withoutStrategies.isEmpty() ?
-                tempStrategies :
-                tempStrategies.clone()
-                        .addStrategies(withStrategies.toArray(new TraversalStrategy[withStrategies.size()]))
-                        .removeStrategies(withoutStrategies.toArray(new Class[withoutStrategies.size()]));
+    public GraphTraversalSource(final Graph graph) {
+        this(graph, TraversalStrategies.GlobalCache.getStrategies(graph.getClass()));
     }
 
     private <S> GraphTraversal.Admin<S, S> generateTraversal() {
         final GraphTraversal.Admin<S, S> traversal = new DefaultGraphTraversal<>(this.graph);
-        final TraversalEngine engine = this.engineBuilder.create(this.graph);
-        traversal.setEngine(engine);
         traversal.setStrategies(this.strategies);
+        if (this.oneBulk)
+            traversal.addTraverserRequirement(TraverserRequirement.ONE_BULK);
+        if (this.pathOn)
+            traversal.addTraverserRequirement(TraverserRequirement.PATH);
         return traversal;
     }
 
-    public <S> GraphTraversal<S, S> inject(S... starts) {
-        return (GraphTraversal<S, S>) this.generateTraversal().inject(starts);
+    @Override
+    public TraversalStrategies getStrategies() {
+        return this.strategies;
     }
 
-    /**
-     * @deprecated As of release 3.1.0, replaced by {@link #addV()}
-     */
-    @Deprecated
-    public GraphTraversal<Vertex, Vertex> addV(final Object... keyValues) {
-        final GraphTraversal.Admin<Vertex, Vertex> traversal = this.generateTraversal();
-        traversal.addStep(new AddVertexStartStep(traversal, null));
-        ((AddVertexStartStep) traversal.getEndStep()).addPropertyMutations(keyValues);
-        return traversal;
+    @Override
+    public Graph getGraph() {
+        return this.graph;
     }
 
-    public GraphTraversal<Vertex, Vertex> addV(final String label) {
-        final GraphTraversal.Admin<Vertex, Vertex> traversal = this.generateTraversal();
-        return traversal.addStep(new AddVertexStartStep(traversal, label));
+    @SuppressWarnings("CloneDoesntDeclareCloneNotSupportedException")
+    public GraphTraversalSource clone() {
+        try {
+            final GraphTraversalSource clone = (GraphTraversalSource) super.clone();
+            return clone;
+        } catch (final CloneNotSupportedException e) {
+            throw new IllegalStateException(e.getMessage(), e);
+        }
     }
 
-    public GraphTraversal<Vertex, Vertex> addV() {
-        final GraphTraversal.Admin<Vertex, Vertex> traversal = this.generateTraversal();
-        return traversal.addStep(new AddVertexStartStep(traversal, null));
+    //// UTILITIES
+
+
+    public GraphTraversalSource withComputer(final Function<Graph, GraphComputer> graphComputerFunction) {
+        this.strategies = this.strategies.clone();
+        this.strategies.addStrategies(new TraversalVertexProgramStrategy(graphComputerFunction), ComputerVerificationStrategy.instance());
+        return this;
     }
 
-    public GraphTraversal<Vertex, Vertex> V(final Object... vertexIds) {
-        final GraphTraversal.Admin<Vertex, Vertex> traversal = this.generateTraversal();
-        return traversal.addStep(new GraphStep<>(traversal, Vertex.class, true, vertexIds));
+    public GraphTraversalSource withComputer(final Class<? extends GraphComputer> graphComputerClass) {
+        return this.withComputer(g -> g.compute(graphComputerClass));
     }
 
-    public GraphTraversal<Edge, Edge> E(final Object... edgesIds) {
-        final GraphTraversal.Admin<Edge, Edge> traversal = this.generateTraversal();
-        return traversal.addStep(new GraphStep<>(traversal, Edge.class, true, edgesIds));
+    public GraphTraversalSource withComputer() {
+        return this.withComputer(Graph::compute);
     }
 
-    //// UTILITIES
+    public GraphTraversalSource withStrategy(final TraversalStrategy... traversalStrategies) {
+        this.strategies = this.strategies.clone();
+        this.strategies.addStrategies(traversalStrategies);
+        return this;
+    }
+
+    public GraphTraversalSource withoutStrategy(final Class<? extends TraversalStrategy>... traversalStrategyClass) {
+        this.strategies = this.strategies.clone();
+        this.strategies.removeStrategies(traversalStrategyClass);
+        return this;
+    }
 
-    public GraphTraversalSourceStub withSideEffect(final String key, final Supplier supplier) {
-        final GraphTraversal.Admin traversal = this.generateTraversal();
-        traversal.getSideEffects().registerSupplier(key, supplier);
-        return new GraphTraversalSourceStub(traversal);
+    public GraphTraversalSource withSideEffect(final String key, final Supplier sideEffect) {
+        this.strategies = this.strategies.clone();
+        this.strategies.addStrategies(new SideEffectStrategy(Collections.singletonList(new Pair<>(key, sideEffect))));
+        return this;
     }
 
-    public GraphTraversalSourceStub withSideEffect(final String key, final Object object) {
-        final GraphTraversal.Admin traversal = this.generateTraversal();
-        traversal.getSideEffects().registerSupplier(key, new ConstantSupplier<>(object));
-        return new GraphTraversalSourceStub(traversal);
+
+    public GraphTraversalSource withSideEffect(final Object... keyValues) {
+        this.strategies = this.strategies.clone();
+        final List<Pair<String, Supplier>> sideEffects = new ArrayList<>();
+        for (int i = 0; i < keyValues.length; i = i + 2) {
+            sideEffects.add(new Pair<>((String) keyValues[i], keyValues[i + 1] instanceof Supplier ? (Supplier) keyValues[i + 1] : new ConstantSupplier<>(keyValues[i + 1])));
+        }
+        this.strategies.addStrategies(new SideEffectStrategy(sideEffects));
+        return this;
     }
 
-    public <A> GraphTraversalSourceStub withSack(final A initialValue) {
+    public <A> GraphTraversalSource withSack(final A initialValue) {
         return this.withSack(initialValue, null, null);
     }
 
-    public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue) {
-        final GraphTraversal.Admin traversal = this.generateTraversal();
-        traversal.getSideEffects().setSack(initialValue, null, null);
-        return new GraphTraversalSourceStub(traversal);
+    public <A> GraphTraversalSource withSack(final Supplier<A> initialValue) {
+        return this;//.withSack((Supplier<A>) initialValue, null, null);
     }
 
-    public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator) {
+    public <A> GraphTraversalSource withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator) {
         return this.withSack(initialValue, splitOperator, null);
     }
 
-    public <A> GraphTraversalSourceStub withSack(final A initialValue, final UnaryOperator<A> splitOperator) {
+    public <A> GraphTraversalSource withSack(final A initialValue, final UnaryOperator<A> splitOperator) {
         return this.withSack(initialValue, splitOperator, null);
     }
 
-    public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final BinaryOperator<A> mergeOperator) {
+    public <A> GraphTraversalSource withSack(final Supplier<A> initialValue, final BinaryOperator<A> mergeOperator) {
         return this.withSack(initialValue, null, mergeOperator);
     }
 
-    public <A> GraphTraversalSourceStub withSack(final A initialValue, final BinaryOperator<A> mergeOperator) {
+    public <A> GraphTraversalSource withSack(final A initialValue, final BinaryOperator<A> mergeOperator) {
         return this.withSack(initialValue, null, mergeOperator);
     }
 
-    public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator, final BinaryOperator<A> mergeOperator) {
-        final GraphTraversal.Admin traversal = this.generateTraversal();
-        traversal.getSideEffects().setSack(initialValue, splitOperator, mergeOperator);
-        return new GraphTraversalSourceStub(traversal);
+    public <A> GraphTraversalSource withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator, final BinaryOperator<A> mergeOperator) {
+        this.strategies = this.strategies.clone();
+        this.strategies.addStrategies(new SackStrategy(initialValue, splitOperator, mergeOperator));
+        return this;
     }
 
-    public <A> GraphTraversalSourceStub withSack(final A initialValue, final UnaryOperator<A> splitOperator, final BinaryOperator<A> mergeOperator) {
-        final GraphTraversal.Admin traversal = this.generateTraversal();
-        traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), splitOperator, mergeOperator);
-        return new GraphTraversalSourceStub(traversal);
+    public <A> GraphTraversalSource withSack(final A initialValue, final UnaryOperator<A> splitOperator, final BinaryOperator<A> mergeOperator) {
+        this.strategies = this.strategies.clone();
+        this.strategies.addStrategies(new SackStrategy(new ConstantSupplier<>(initialValue), splitOperator, mergeOperator));
+        return this;
     }
 
-    public GraphTraversalSourceStub withBulk(final boolean useBulk) {
-        final GraphTraversal.Admin traversal = this.generateTraversal();
-        traversal.addTraverserRequirement(useBulk ? TraverserRequirement.BULK : TraverserRequirement.ONE_BULK);
-        return new GraphTraversalSourceStub(traversal);
+    public GraphTraversalSource withBulk(final boolean useBulk) {
+        this.oneBulk = !useBulk;
+        return this;
     }
 
-    public <S> GraphTraversalSourceStub withPath() {
-        final GraphTraversal.Admin traversal = this.generateTraversal();
-        traversal.addTraverserRequirement(TraverserRequirement.PATH);
-        return new GraphTraversalSourceStub(traversal);
+    public <S> GraphTraversalSource withPath() {
+        this.pathOn = true;
+        return this;
     }
 
-    public Transaction tx() {
-        return this.graph.tx();
-    }
+    /////////////////////////////
 
-    public static Builder build() {
-        return new Builder();
+    /**
+     * @deprecated As of release 3.1.0, replaced by {@link #addV()}
+     */
+    @Deprecated
+    public GraphTraversal<Vertex, Vertex> addV(final Object... keyValues) {
+        final GraphTraversal.Admin<Vertex, Vertex> traversal = this.generateTraversal();
+        traversal.addStep(new AddVertexStartStep(traversal, null));
+        ((AddVertexStartStep) traversal.getEndStep()).addPropertyMutations(keyValues);
+        return traversal;
     }
 
-    @Override
-    public List<TraversalStrategy> getStrategies() {
-        return Collections.unmodifiableList(this.strategies.toList());
+    public GraphTraversal<Vertex, Vertex> addV(final String label) {
+        final GraphTraversal.Admin<Vertex, Vertex> traversal = this.generateTraversal();
+        return traversal.addStep(new AddVertexStartStep(traversal, label));
     }
 
-    @Override
-    public Optional<GraphComputer> getGraphComputer() {
-        return this.engineBuilder.create(this.graph).getGraphComputer();
+    public GraphTraversal<Vertex, Vertex> addV() {
+        final GraphTraversal.Admin<Vertex, Vertex> traversal = this.generateTraversal();
+        return traversal.addStep(new AddVertexStartStep(traversal, null));
     }
 
-    @Override
-    public Optional<Graph> getGraph() {
-        return Optional.ofNullable(this.graph);
+    public <S> GraphTraversal<S, S> inject(S... starts) {
+        return (GraphTraversal<S, S>) this.generateTraversal().inject(starts);
     }
 
-    @Override
-    public GraphTraversalSource.Builder asBuilder() {
-        final GraphTraversalSource.Builder builder = GraphTraversalSource.build().engine(this.engineBuilder);
-        this.withStrategies.forEach(builder::with);
-        this.withoutStrategies.forEach(builder::without);
-        return builder;
+    public GraphTraversal<Vertex, Vertex> V(final Object... vertexIds) {
+        final GraphTraversal.Admin<Vertex, Vertex> traversal = this.generateTraversal();
+        return traversal.addStep(new GraphStep<>(traversal, Vertex.class, true, vertexIds));
     }
 
-    @Override
-    public String toString() {
-        return StringFactory.traversalSourceString(this);
+    public GraphTraversal<Edge, Edge> E(final Object... edgesIds) {
+        final GraphTraversal.Admin<Edge, Edge> traversal = this.generateTraversal();
+        return traversal.addStep(new GraphStep<>(traversal, Edge.class, true, edgesIds));
     }
 
-    //////
-
-    public final static class Builder implements TraversalSource.Builder<GraphTraversalSource> {
-
-        private TraversalEngine.Builder engineBuilder = StandardTraversalEngine.build();
-        private List<TraversalStrategy> withStrategies = new ArrayList<>();
-        private List<Class<? extends TraversalStrategy>> withoutStrategies = new ArrayList<>();
-
-        private Builder() {
-        }
-
-        @Override
-        public Builder engine(final TraversalEngine.Builder engineBuilder) {
-            this.engineBuilder = engineBuilder;
-            return this;
-        }
 
-        @Override
-        public Builder with(final TraversalStrategy strategy) {
-            this.withStrategies.add(strategy);
-            return this;
-        }
-
-        @Override
-        public TraversalSource.Builder without(final Class<? extends TraversalStrategy> strategyClass) {
-            this.withoutStrategies.add(strategyClass);
-            return this;
-        }
-
-        @Override
-        public GraphTraversalSource create(final Graph graph) {
-            return new GraphTraversalSource(graph, this.engineBuilder, this.withStrategies, this.withoutStrategies);
-        }
+    public Transaction tx() {
+        return this.graph.tx();
     }
 
-    public static class GraphTraversalSourceStub {
-
-        private final GraphTraversal.Admin traversal;
-
-        public GraphTraversalSourceStub(final GraphTraversal.Admin traversal) {
-            this.traversal = traversal;
-        }
-
-        public <S> GraphTraversal<S, S> inject(S... starts) {
-            return this.traversal.inject(starts);
-        }
-
-        /**
-         * @deprecated As of release 3.1.0, replaced by {@link #addV()}
-         */
-        @Deprecated
-        public GraphTraversal<Vertex, Vertex> addV(final Object... keyValues) {
-            this.traversal.addStep(new AddVertexStartStep(this.traversal, null));
-            ((AddVertexStartStep) this.traversal.getEndStep()).addPropertyMutations(keyValues);
-            return this.traversal;
-        }
-
-        public GraphTraversal<Vertex, Vertex> addV(final String label) {
-            return this.traversal.addStep(new AddVertexStartStep(this.traversal, label));
-        }
 
-        public GraphTraversal<Vertex, Vertex> addV() {
-            return this.traversal.addStep(new AddVertexStartStep(this.traversal, null));
-        }
-
-        public GraphTraversal<Vertex, Vertex> V(final Object... vertexIds) {
-            return this.traversal.addStep(new GraphStep<>(this.traversal, Vertex.class, true, vertexIds));
-        }
-
-        public GraphTraversal<Edge, Edge> E(final Object... edgesIds) {
-            return this.traversal.addStep(new GraphStep<>(this.traversal, Edge.class, true, edgesIds));
-        }
-
-        //// UTILITIES
-
-        public GraphTraversalSourceStub withSideEffect(final String key, final Supplier supplier) {
-            this.traversal.getSideEffects().registerSupplier(key, supplier);
-            return this;
-        }
-
-        public GraphTraversalSourceStub withSideEffect(final String key, final Object object) {
-            this.traversal.getSideEffects().registerSupplier(key, new ConstantSupplier<>(object));
-            return this;
-        }
-
-        public <A> GraphTraversalSourceStub withSack(final A initialValue) {
-            this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), null, null);
-            return this;
-        }
-
-        public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue) {
-            this.traversal.getSideEffects().setSack(initialValue, null, null);
-            return this;
-        }
-
-        public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator) {
-            this.traversal.getSideEffects().setSack(initialValue, splitOperator, null);
-            return this;
-        }
-
-        public <A> GraphTraversalSourceStub withSack(final A initialValue, final UnaryOperator<A> splitOperator) {
-            this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), splitOperator, null);
-            return this;
-        }
-
-        public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final BinaryOperator<A> mergeOperator) {
-            this.traversal.getSideEffects().setSack(initialValue, null, mergeOperator);
-            return this;
-        }
-
-        public <A> GraphTraversalSourceStub withSack(final A initialValue, final BinaryOperator<A> mergeOperator) {
-            this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), null, mergeOperator);
-            return this;
-        }
-
-        public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator, final BinaryOperator<A> mergeOperator) {
-            this.traversal.getSideEffects().setSack(initialValue, splitOperator, mergeOperator);
-            return this;
-        }
-
-        public <A> GraphTraversalSourceStub withSack(final A initialValue, final UnaryOperator<A> splitOperator, final BinaryOperator<A> mergeOperator) {
-            this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), splitOperator, mergeOperator);
-            return this;
-        }
-
-        public GraphTraversalSourceStub withBulk(final boolean useBulk) {
-            this.traversal.addTraverserRequirement(useBulk ? TraverserRequirement.BULK : TraverserRequirement.ONE_BULK);
-            return this;
-        }
-
-        public GraphTraversalSourceStub withPath() {
-            this.traversal.addTraverserRequirement(TraverserRequirement.PATH);
-            return this;
-        }
+    @Override
+    public String toString() {
+        return StringFactory.traversalSourceString(this);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/ComputerTraversalEngine.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/ComputerTraversalEngine.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/ComputerTraversalEngine.java
index 3928bf9..0064502 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/ComputerTraversalEngine.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/ComputerTraversalEngine.java
@@ -19,7 +19,6 @@
 package org.apache.tinkerpop.gremlin.process.traversal.engine;
 
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
-import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.ComputerResultStep;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
@@ -29,7 +28,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.Prof
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 
 import java.util.Collections;
 import java.util.HashSet;
@@ -40,6 +38,7 @@ import java.util.Set;
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
+@Deprecated
 public final class ComputerTraversalEngine implements TraversalEngine {
 
     private final transient GraphComputer graphComputer;
@@ -55,7 +54,8 @@ public final class ComputerTraversalEngine implements TraversalEngine {
 
     @Override
     public String toString() {
-        return StringFactory.traversalEngineString(this);
+        return null;
+        //return StringFactory.traversalEngineString(this);
     }
 
     @Override
@@ -132,9 +132,9 @@ public final class ComputerTraversalEngine implements TraversalEngine {
         @Override
         public void apply(final Traversal.Admin<?, ?> traversal) {
             if (traversal.getParent() instanceof EmptyStep) {
-                final TraversalEngine engine = traversal.getEngine();
-                if (engine.isComputer())
-                    traversal.addStep(new ComputerResultStep<>(traversal, engine.getGraphComputer().get(), true));
+                //final TraversalEngine engine = traversal.getEngine();
+                //if (engine.isComputer())
+                //    traversal.addStep(new ComputerResultStep<>(traversal, engine.getGraphComputer().get(), true));
             }
         }
 
@@ -147,4 +147,4 @@ public final class ComputerTraversalEngine implements TraversalEngine {
             return INSTANCE;
         }
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/StandardTraversalEngine.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/StandardTraversalEngine.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/StandardTraversalEngine.java
index d2a62f1..d72dc36 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/StandardTraversalEngine.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/StandardTraversalEngine.java
@@ -18,17 +18,16 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.engine;
 
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 
 import java.util.Optional;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
+@Deprecated
 public final class StandardTraversalEngine implements TraversalEngine {
 
     private static final StandardTraversalEngine INSTANCE = new StandardTraversalEngine();
@@ -57,7 +56,8 @@ public final class StandardTraversalEngine implements TraversalEngine {
 
     @Override
     public String toString() {
-        return StringFactory.traversalEngineString(this);
+        return "null";
+        //return StringFactory.traversalEngineString(this);
     }
 
     public final static class Builder implements TraversalEngine.Builder {
@@ -69,4 +69,4 @@ public final class StandardTraversalEngine implements TraversalEngine {
             return StandardTraversalEngine.INSTANCE;
         }
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/AbstractLambdaTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/AbstractLambdaTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/AbstractLambdaTraversal.java
index 2f27372..c7ca249 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/AbstractLambdaTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/AbstractLambdaTraversal.java
@@ -20,12 +20,10 @@ package org.apache.tinkerpop.gremlin.process.traversal.lambda;
 
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 import org.apache.tinkerpop.gremlin.process.traversal.TraverserGenerator;
-import org.apache.tinkerpop.gremlin.process.traversal.engine.StandardTraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep;
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.O_TraverserGenerator;
@@ -71,11 +69,6 @@ public abstract class AbstractLambdaTraversal<S, E> implements Traversal.Admin<S
     }
 
     @Override
-    public TraversalEngine getEngine() {
-        return StandardTraversalEngine.instance();
-    }
-
-    @Override
     public TraverserGenerator getTraverserGenerator() {
         return O_TraverserGenerator.instance();
     }
@@ -144,11 +137,6 @@ public abstract class AbstractLambdaTraversal<S, E> implements Traversal.Admin<S
     }
 
     @Override
-    public void setEngine(final TraversalEngine engine) {
-
-    }
-
-    @Override
     public Optional<Graph> getGraph() {
         return Optional.empty();
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/EngineDependent.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/EngineDependent.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/EngineDependent.java
index cb1aeec..d1efd11 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/EngineDependent.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/EngineDependent.java
@@ -18,13 +18,11 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.step;
 
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
-
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
 public interface EngineDependent {
 
-    public void onEngine(final TraversalEngine traversalEngine);
+    public void onGraphComputer();
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GraphStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GraphStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GraphStep.java
index de3e669..5f33750 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GraphStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/GraphStep.java
@@ -20,7 +20,6 @@ package org.apache.tinkerpop.gremlin.process.traversal.step.map;
 
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 import org.apache.tinkerpop.gremlin.process.traversal.step.EngineDependent;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep;
@@ -99,13 +98,11 @@ public class GraphStep<S, E extends Element> extends AbstractStep<S, E> implemen
     }
 
     @Override
-    public void onEngine(final TraversalEngine traversalEngine) {
-        if (traversalEngine.isComputer()) {
-            this.iteratorSupplier = Collections::emptyIterator;
-            for (int i = 0; i < this.ids.length; i++) {    // if this is going to OLAP, convert to ids so you don't serialize elements
-                if (this.ids[i] instanceof Element)
-                    this.ids[i] = ((Element) this.ids[i]).id();
-            }
+    public void onGraphComputer() {
+        this.iteratorSupplier = Collections::emptyIterator;
+        for (int i = 0; i < this.ids.length; i++) {    // if this is going to OLAP, convert to ids so you don't serialize elements
+            if (this.ids[i] instanceof Element)
+                this.ids[i] = ((Element) this.ids[i]).id();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStep.java
index b2885b9..ecabfec 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStep.java
@@ -25,7 +25,6 @@ import org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexPr
 import org.apache.tinkerpop.gremlin.process.computer.traversal.VertexTraversalSideEffects;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
 import org.apache.tinkerpop.gremlin.process.traversal.step.Barrier;
@@ -131,8 +130,8 @@ public final class GroupSideEffectStep<S, K, V> extends SideEffectStep<S> implem
     }
 
     @Override
-    public void onEngine(final TraversalEngine traversalEngine) {
-        this.onGraphComputer = traversalEngine.isComputer();
+    public void onGraphComputer() {
+        this.onGraphComputer = true;
     }
 
     @Override
@@ -232,10 +231,10 @@ public final class GroupSideEffectStep<S, K, V> extends SideEffectStep<S> implem
 
         @Override
         public void reduce(final K key, final Iterator<Collection<?>> values, final ReduceEmitter<K, V> emitter) {
-            Traversal.Admin<?,V> reduceTraversalClone = this.reduceTraversal.clone();
+            Traversal.Admin<?, V> reduceTraversalClone = this.reduceTraversal.clone();
             while (values.hasNext()) {
                 final BulkSet<?> value = (BulkSet<?>) values.next();
-                value.forEach((v,bulk) -> reduceTraversalClone.addStart(reduceTraversalClone.getTraverserGenerator().generate(v, (Step) reduceTraversalClone.getStartStep(), bulk)));
+                value.forEach((v, bulk) -> reduceTraversalClone.addStart(reduceTraversalClone.getTraverserGenerator().generate(v, (Step) reduceTraversalClone.getStartStep(), bulk)));
                 TraversalHelper.getFirstStepOfAssignableClass(Barrier.class, reduceTraversalClone).ifPresent(Barrier::processAllStarts);
             }
             emitter.emit(key, reduceTraversalClone.next());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStepV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStepV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStepV3d0.java
index 643466d..a6bece6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStepV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupSideEffectStepV3d0.java
@@ -96,8 +96,8 @@ public final class GroupSideEffectStepV3d0<S, K, V, R> extends SideEffectStep<S>
     }
 
     @Override
-    public void onEngine(final TraversalEngine traversalEngine) {
-        this.onGraphComputer = traversalEngine.isComputer();
+    public void onGraphComputer() {
+        this.onGraphComputer = true;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/ProfileStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/ProfileStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/ProfileStep.java
index e42e5fa..f8a182b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/ProfileStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/ProfileStep.java
@@ -25,6 +25,7 @@ import org.apache.tinkerpop.gremlin.process.computer.util.StaticMapReduce;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.step.EngineDependent;
 import org.apache.tinkerpop.gremlin.process.traversal.step.MapReducer;
 import org.apache.tinkerpop.gremlin.process.traversal.step.Profiling;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
@@ -44,10 +45,11 @@ import java.util.NoSuchElementException;
 /**
  * @author Bob Briody (http://bobbriody.com)
  */
-public final class ProfileStep<S> extends AbstractStep<S, S> implements MapReducer<MapReduce.NullObject, StandardTraversalMetrics, MapReduce.NullObject, StandardTraversalMetrics, StandardTraversalMetrics> {
+public final class ProfileStep<S> extends AbstractStep<S, S> implements MapReducer<MapReduce.NullObject, StandardTraversalMetrics, MapReduce.NullObject, StandardTraversalMetrics, StandardTraversalMetrics>, EngineDependent {
 
     // Stored in the Traversal sideEffects but kept here as a reference for convenience.
     private StandardTraversalMetrics traversalMetrics;
+    private boolean onGraphComputer = false;
 
     public ProfileStep(final Traversal.Admin traversal) {
         super(traversal);
@@ -140,7 +142,7 @@ public final class ProfileStep<S> extends AbstractStep<S, S> implements MapReduc
             MutableMetrics metrics;
 
             // Computer metrics are "stand-alone" but Standard metrics handle double-counted upstream time.
-            if (traversal.getEngine().isComputer()) {
+            if (this.onGraphComputer) {
                 metrics = new MutableMetrics(step.getId(), step.toString());
             } else {
                 metrics = new DependantMutableMetrics(step.getId(), step.toString(), prevMetrics);
@@ -178,6 +180,11 @@ public final class ProfileStep<S> extends AbstractStep<S, S> implements MapReduc
         }
     }
 
+    @Override
+    public void onGraphComputer() {
+        this.onGraphComputer = true;
+    }
+
     //////////////////
 
     public static final class ProfileMapReduce extends StaticMapReduce<MapReduce.NullObject, StandardTraversalMetrics, MapReduce.NullObject, StandardTraversalMetrics, StandardTraversalMetrics> {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ComputerAwareStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ComputerAwareStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ComputerAwareStep.java
index 419205c..b5b3346 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ComputerAwareStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ComputerAwareStep.java
@@ -19,7 +19,6 @@
 package org.apache.tinkerpop.gremlin.process.traversal.step.util;
 
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 import org.apache.tinkerpop.gremlin.process.traversal.step.EngineDependent;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
@@ -49,8 +48,8 @@ public abstract class ComputerAwareStep<S, E> extends AbstractStep<S, E> impleme
     }
 
     @Override
-    public void onEngine(final TraversalEngine engine) {
-        this.traverserStepIdAndLabelsSetByChild = engine.isComputer();
+    public void onGraphComputer() {
+        this.traverserStepIdAndLabelsSetByChild = true;
     }
 
     @Override
@@ -88,8 +87,8 @@ public abstract class ComputerAwareStep<S, E> extends AbstractStep<S, E> impleme
         }
 
         @Override
-        public void onEngine(final TraversalEngine engine) {
-            this.traverserStepIdAndLabelsSetByChild = engine.isComputer();
+        public void onGraphComputer() {
+            this.traverserStepIdAndLabelsSetByChild = true;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ReducingBarrierStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ReducingBarrierStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ReducingBarrierStep.java
index b459071..69ba60d 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ReducingBarrierStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ReducingBarrierStep.java
@@ -26,7 +26,6 @@ import org.apache.tinkerpop.gremlin.process.computer.util.StaticMapReduce;
 import org.apache.tinkerpop.gremlin.process.computer.util.VertexProgramHelper;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 import org.apache.tinkerpop.gremlin.process.traversal.step.Barrier;
 import org.apache.tinkerpop.gremlin.process.traversal.step.EngineDependent;
@@ -68,8 +67,8 @@ public abstract class ReducingBarrierStep<S, E> extends AbstractStep<S, E> imple
     }
 
     @Override
-    public void onEngine(final TraversalEngine traversalEngine) {
-        this.byPass = traversalEngine.isComputer();
+    public void onGraphComputer() {
+        this.byPass = true;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ConnectiveStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ConnectiveStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ConnectiveStrategy.java
index a3e6b77..b3eb8a2 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ConnectiveStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ConnectiveStrategy.java
@@ -58,7 +58,7 @@ public final class ConnectiveStrategy extends AbstractTraversalStrategy<Traversa
     @Override
     public void apply(final Traversal.Admin<?, ?> traversal) {
         if (TraversalHelper.hasStepOfAssignableClass(ConnectiveStep.class, traversal)) {
-            processConjunctionMarkers(traversal);
+            processConnectiveMarker(traversal);
         }
     }
 
@@ -66,7 +66,7 @@ public final class ConnectiveStrategy extends AbstractTraversalStrategy<Traversa
         return !(step instanceof EmptyStep || step instanceof ProfileStep || step instanceof ComputerAwareStep.EndStep || (step instanceof StartStep && !StartStep.isVariableStartStep(step)) || GraphStep.isStartStep(step));
     }
 
-    private static void processConjunctionMarkers(final Traversal.Admin<?, ?> traversal) {
+    private static void processConnectiveMarker(final Traversal.Admin<?, ?> traversal) {
         processConjunctionMarker(OrStep.class, traversal);
         processConjunctionMarker(AndStep.class, traversal);
     }
@@ -75,15 +75,15 @@ public final class ConnectiveStrategy extends AbstractTraversalStrategy<Traversa
 
         TraversalHelper.getStepsOfClass(markerClass, traversal).stream()
                 .filter(conjunctionStep -> conjunctionStep.getLocalChildren().isEmpty())
-                .findFirst().ifPresent(conjunctionStep -> {
+                .findFirst().ifPresent(connectiveStep -> {
 
-            Step<?, ?> currentStep = conjunctionStep.getNextStep();
+            Step<?, ?> currentStep = connectiveStep.getNextStep();
             final Traversal.Admin<?, ?> rightTraversal = __.start().asAdmin();
-            if (!conjunctionStep.getLabels().isEmpty()) {
+            if (!connectiveStep.getLabels().isEmpty()) {
                 final StartStep<?> startStep = new StartStep<>(rightTraversal);
-                final Set<String> conjunctionLabels = ((Step<?, ?>) conjunctionStep).getLabels();
+                final Set<String> conjunctionLabels = ((Step<?, ?>) connectiveStep).getLabels();
                 conjunctionLabels.forEach(startStep::addLabel);
-                conjunctionLabels.forEach(label -> conjunctionStep.removeLabel(label));
+                conjunctionLabels.forEach(label -> connectiveStep.removeLabel(label));
                 rightTraversal.addStep(startStep);
             }
             while (legalCurrentStep(currentStep)) {
@@ -92,9 +92,9 @@ public final class ConnectiveStrategy extends AbstractTraversalStrategy<Traversa
                 traversal.removeStep(currentStep);
                 currentStep = nextStep;
             }
-            processConjunctionMarkers(rightTraversal);
+            processConnectiveMarker(rightTraversal);
 
-            currentStep = conjunctionStep.getPreviousStep();
+            currentStep = connectiveStep.getPreviousStep();
             final Traversal.Admin<?, ?> leftTraversal = __.start().asAdmin();
             while (legalCurrentStep(currentStep)) {
                 final Step<?, ?> previousStep = currentStep.getPreviousStep();
@@ -102,10 +102,10 @@ public final class ConnectiveStrategy extends AbstractTraversalStrategy<Traversa
                 traversal.removeStep(currentStep);
                 currentStep = previousStep;
             }
-            processConjunctionMarkers(leftTraversal);
+            processConnectiveMarker(leftTraversal);
 
-            conjunctionStep.addLocalChild(leftTraversal);
-            conjunctionStep.addLocalChild(rightTraversal);
+            connectiveStep.addLocalChild(leftTraversal);
+            connectiveStep.addLocalChild(rightTraversal);
         });
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SackStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SackStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SackStrategy.java
new file mode 100644
index 0000000..16719f9
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SackStrategy.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration;
+
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
+
+import java.util.function.BinaryOperator;
+import java.util.function.Supplier;
+import java.util.function.UnaryOperator;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class SackStrategy extends AbstractTraversalStrategy<TraversalStrategy.DecorationStrategy> implements TraversalStrategy.DecorationStrategy {
+
+    private final Supplier initialValue;
+    private final UnaryOperator splitOperator;
+    private final BinaryOperator mergeOperator;
+
+
+    public SackStrategy(final Supplier initialValue, final UnaryOperator splitOperator, final BinaryOperator mergeOperator) {
+        this.initialValue = initialValue;
+        this.splitOperator = splitOperator;
+        this.mergeOperator = mergeOperator;
+    }
+
+    @Override
+    public void apply(final Traversal.Admin<?, ?> traversal) {
+        if (traversal.getParent() instanceof EmptyStep)
+            traversal.getSideEffects().setSack(this.initialValue, this.splitOperator, this.mergeOperator);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f2cd677/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SideEffectStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SideEffectStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SideEffectStrategy.java
new file mode 100644
index 0000000..02c76be
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SideEffectStrategy.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration;
+
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
+import org.javatuples.Pair;
+
+import java.util.List;
+import java.util.function.Supplier;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class SideEffectStrategy extends AbstractTraversalStrategy<TraversalStrategy.DecorationStrategy> implements TraversalStrategy.DecorationStrategy {
+
+    private final List<Pair<String, Supplier>> sideEffects;
+
+    public SideEffectStrategy(final List<Pair<String, Supplier>> sideEffects) {
+        this.sideEffects = sideEffects;
+    }
+
+    @Override
+    public void apply(final Traversal.Admin<?, ?> traversal) {
+        if (traversal.getParent() instanceof EmptyStep)
+            this.sideEffects.forEach(pair -> traversal.getSideEffects().registerSupplier(pair.getValue0(), pair.getValue1()));
+    }
+}
\ No newline at end of file



Mime
View raw message