You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2017/01/19 17:40:19 UTC

[13/50] [abbrv] tinkerpop git commit: Created AkkaGremlinPlugin so you can import akka-gremlin into GremlinConsole (and GremlinServer--not sure). The concept of an Actor Address now has to identifies -- the physical location of the actor and the unique (

Created AkkaGremlinPlugin so you can import akka-gremlin into GremlinConsole (and GremlinServer--not sure). The concept of an Actor Address now has to identifies -- the physical location of the actor and the unique (provider specific) guid of the actor. By knowing the physical location and knowing if its local to the sending actor, then detachment/attachment isn't required. Also added TraversalSource.withProcessor(Description). Computer implements Description and now a new Actors implements Description. Both GraphComputer and GraphActors implement a marker interface called Processor. So, g.withProcessor(Actors.of(AkkaGraphActors).partitioner(...)).


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

Branch: refs/heads/TINKERPOP-1564
Commit: e3b67a7ae19e03fd0999602c44309a850a704023
Parents: 885a38e
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Dec 14 14:35:18 2016 -0700
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Jan 19 10:26:57 2017 -0700

----------------------------------------------------------------------
 .../gremlin/akka/jsr223/AkkaGremlinPlugin.java  | 50 +++++++++++++
 .../akka/process/actor/AkkaGraphActors.java     |  8 ++-
 .../gremlin/akka/process/actor/MasterActor.java | 15 ++--
 .../gremlin/akka/process/actor/WorkerActor.java | 14 ++--
 ...pache.tinkerpop.gremlin.jsr223.GremlinPlugin |  1 +
 .../akka/process/AkkaActorsProvider.java        | 11 +--
 .../gremlin/akka/process/AkkaPlayTest.java      | 11 +--
 .../tinkerpop/gremlin/jsr223/CoreImports.java   |  6 ++
 .../tinkerpop/gremlin/process/Processor.java    | 52 ++++++++++++++
 .../tinkerpop/gremlin/process/actor/Actors.java | 76 ++++++++++++++++++++
 .../gremlin/process/actor/Address.java          | 27 ++++---
 .../gremlin/process/actor/GraphActors.java      |  4 +-
 .../actor/traversal/TraversalMasterProgram.java | 11 ++-
 .../actor/traversal/TraversalWorkerProgram.java | 10 +--
 .../decoration/ActorProgramStrategy.java        | 14 +++-
 .../gremlin/process/computer/Computer.java      | 23 +++++-
 .../gremlin/process/computer/GraphComputer.java |  3 +-
 .../process/traversal/TraversalSource.java      | 21 +++++-
 .../dsl/graph/GraphTraversalSource.java         |  6 ++
 .../gremlin_python/process/graph_traversal.py   |  4 ++
 20 files changed, 320 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/jsr223/AkkaGremlinPlugin.java
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/jsr223/AkkaGremlinPlugin.java b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/jsr223/AkkaGremlinPlugin.java
new file mode 100644
index 0000000..049c5b7
--- /dev/null
+++ b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/jsr223/AkkaGremlinPlugin.java
@@ -0,0 +1,50 @@
+/*
+ *  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.akka.jsr223;
+
+import org.apache.tinkerpop.gremlin.akka.process.actor.AkkaGraphActors;
+import org.apache.tinkerpop.gremlin.jsr223.AbstractGremlinPlugin;
+import org.apache.tinkerpop.gremlin.jsr223.DefaultImportCustomizer;
+import org.apache.tinkerpop.gremlin.jsr223.ImportCustomizer;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class AkkaGremlinPlugin extends AbstractGremlinPlugin {
+
+    protected static String NAME = "tinkerpop.akka";
+
+    private static final AkkaGremlinPlugin INSTANCE = new AkkaGremlinPlugin();
+
+    private static final ImportCustomizer imports = DefaultImportCustomizer.build().addClassImports(AkkaGraphActors.class).create();
+
+    public AkkaGremlinPlugin() {
+        super(NAME, imports);
+    }
+
+    @Override
+    public boolean requireRestart() {
+        return true;
+    }
+
+    public static AkkaGremlinPlugin instance() {
+        return INSTANCE;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/AkkaGraphActors.java
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/AkkaGraphActors.java b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/AkkaGraphActors.java
index 362db97..8cfe56f 100644
--- a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/AkkaGraphActors.java
+++ b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/AkkaGraphActors.java
@@ -30,6 +30,8 @@ import org.apache.tinkerpop.gremlin.process.actor.GraphActors;
 import org.apache.tinkerpop.gremlin.structure.Partitioner;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.Future;
 import java.util.stream.Collectors;
@@ -49,7 +51,11 @@ public final class AkkaGraphActors<R> implements GraphActors<R> {
                 withValue("message-priorities",
                         ConfigValueFactory.fromAnyRef(this.actorProgram.getMessagePriorities().stream().map(Class::getCanonicalName).collect(Collectors.toList()).toString()));
         this.system = ActorSystem.create("traversal-" + actorProgram.hashCode(), config);
-        this.master = new Address.Master(this.system.actorOf(Props.create(MasterActor.class, this.actorProgram, partitioner), "master").path().toString());
+        try {
+            this.master = new Address.Master(this.system.actorOf(Props.create(MasterActor.class, this.actorProgram, partitioner), "master").path().toString(), InetAddress.getLocalHost());
+        } catch (final UnknownHostException e) {
+            throw new IllegalStateException(e.getMessage(), e);
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/MasterActor.java
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/MasterActor.java b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/MasterActor.java
index bb7f28b..05bedbc 100644
--- a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/MasterActor.java
+++ b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/MasterActor.java
@@ -30,6 +30,8 @@ import org.apache.tinkerpop.gremlin.process.actor.Address;
 import org.apache.tinkerpop.gremlin.structure.Partition;
 import org.apache.tinkerpop.gremlin.structure.Partitioner;
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -45,12 +47,17 @@ public final class MasterActor extends AbstractActor implements RequiresMessageQ
     private final Map<Address, ActorSelection> actors = new HashMap<>();
 
     public MasterActor(final ActorProgram program, final Partitioner partitioner) {
-        this.master = new Address.Master(self().path().toString());
+        try {
+            this.master = new Address.Master(self().path().toString(), InetAddress.getLocalHost());
+        } catch (final UnknownHostException e) {
+            throw new IllegalStateException(e.getMessage(), e);
+        }
         this.workers = new ArrayList<>();
         final List<Partition> partitions = partitioner.getPartitions();
         for (final Partition partition : partitions) {
-            this.workers.add(new Address.Worker("worker-" + partition.hashCode()));
-            context().actorOf(Props.create(WorkerActor.class, program, partitioner, partition), "worker-" + partition.hashCode());
+            final String workerPathString = "worker-" + partition.guid();
+            this.workers.add(new Address.Worker(workerPathString, partition.location()));
+            context().actorOf(Props.create(WorkerActor.class, program, this.master, partition, partitioner), workerPathString);
         }
         final ActorProgram.Master masterProgram = program.createMasterProgram(this);
         receive(ReceiveBuilder.matchAny(masterProgram::execute).build());
@@ -61,7 +68,7 @@ public final class MasterActor extends AbstractActor implements RequiresMessageQ
     public <M> void send(final Address toActor, final M message) {
         ActorSelection actor = this.actors.get(toActor);
         if (null == actor) {
-            actor = context().actorSelection(toActor.location());
+            actor = context().actorSelection(toActor.getId());
             this.actors.put(toActor, actor);
         }
         actor.tell(message, self());

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/WorkerActor.java
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/WorkerActor.java b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/WorkerActor.java
index 6aab38b..d83252e 100644
--- a/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/WorkerActor.java
+++ b/akka-gremlin/src/main/java/org/apache/tinkerpop/gremlin/akka/process/actor/WorkerActor.java
@@ -45,13 +45,13 @@ public final class WorkerActor extends AbstractActor implements RequiresMessageQ
     private final List<Address.Worker> workers;
     private final Map<Address, ActorSelection> actors = new HashMap<>();
 
-    public WorkerActor(final ActorProgram program, final Partitioner partitioner, final Partition localPartition) {
+    public WorkerActor(final ActorProgram program, final Address.Master master, final Partition localPartition, final Partitioner partitioner) {
         this.localPartition = localPartition;
-        this.self = new Address.Worker("../worker-" + localPartition.hashCode());
-        this.master = new Address.Master(context().parent().path().toString());
+        this.self = new Address.Worker(this.createWorkerAddress(localPartition), localPartition.location());
+        this.master = master;
         this.workers = new ArrayList<>();
         for (final Partition partition : partitioner.getPartitions()) {
-            this.workers.add(new Address.Worker("../worker-" + partition.hashCode()));
+            this.workers.add(new Address.Worker(this.createWorkerAddress(partition), partition.location()));
         }
         final ActorProgram.Worker workerProgram = program.createWorkerProgram(this);
         receive(ReceiveBuilder.matchAny(workerProgram::execute).build());
@@ -62,7 +62,7 @@ public final class WorkerActor extends AbstractActor implements RequiresMessageQ
     public <M> void send(final Address toActor, final M message) {
         ActorSelection actor = this.actors.get(toActor);
         if (null == actor) {
-            actor = context().actorSelection(toActor.location());
+            actor = context().actorSelection(toActor.getId());
             this.actors.put(toActor, actor);
         }
         actor.tell(message, self());
@@ -87,5 +87,9 @@ public final class WorkerActor extends AbstractActor implements RequiresMessageQ
     public Address.Master master() {
         return this.master;
     }
+
+    private String createWorkerAddress(final Partition partition) {
+        return "../worker-" + partition.guid();
+    }
 }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/akka-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin b/akka-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
new file mode 100644
index 0000000..78805d5
--- /dev/null
+++ b/akka-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
@@ -0,0 +1 @@
+org.apache.tinkerpop.gremlin.akka.jsr223.AkkaGremlinPlugin
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/AkkaActorsProvider.java
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/AkkaActorsProvider.java b/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/AkkaActorsProvider.java
index bf9e092..b36e3b5 100644
--- a/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/AkkaActorsProvider.java
+++ b/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/AkkaActorsProvider.java
@@ -23,14 +23,11 @@ import org.apache.commons.configuration.Configuration;
 import org.apache.tinkerpop.gremlin.AbstractGraphProvider;
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.akka.process.actor.AkkaGraphActors;
-import org.apache.tinkerpop.gremlin.process.actor.traversal.strategy.decoration.ActorProgramStrategy;
+import org.apache.tinkerpop.gremlin.process.actor.Actors;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionTest;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.step.ComplexTest;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupTest;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TailTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphTest;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.OrderTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProfileTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProgramTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupTest;
@@ -63,6 +60,8 @@ import java.util.Set;
  */
 public class AkkaActorsProvider extends AbstractGraphProvider {
 
+    private static final Random RANDOM = new Random();
+
     private static Set<String> SKIP_TESTS = new HashSet<>(Arrays.asList(
             "g_V_hasLabelXpersonX_V_hasLabelXsoftwareX_name",
             "g_VX1X_repeatXbothEXcreatedX_whereXwithoutXeXX_aggregateXeX_otherVX_emit_path",
@@ -147,7 +146,9 @@ public class AkkaActorsProvider extends AbstractGraphProvider {
             //throw new VerificationException("This test current does not work with Gremlin-Python", EmptyTraversal.instance());
         else {
             final GraphTraversalSource g = graph.traversal();
-            return g.withStrategies(new ActorProgramStrategy(AkkaGraphActors.class, new HashPartitioner(graph.partitioner(), new Random().nextInt(10) + 1)));
+            return RANDOM.nextBoolean() ?
+                    g.withProcessor(Actors.of(AkkaGraphActors.class).partitioner(new HashPartitioner(graph.partitioner(), new Random().nextInt(15) + 1))) :
+                    g.withProcessor(Actors.of(AkkaGraphActors.class));
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/AkkaPlayTest.java
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/AkkaPlayTest.java b/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/AkkaPlayTest.java
index 6338706..93fac3d 100644
--- a/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/AkkaPlayTest.java
+++ b/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/AkkaPlayTest.java
@@ -20,17 +20,17 @@
 package org.apache.tinkerpop.gremlin.akka.process;
 
 import org.apache.tinkerpop.gremlin.akka.process.actor.AkkaGraphActors;
-import org.apache.tinkerpop.gremlin.process.actor.traversal.strategy.decoration.ActorProgramStrategy;
+import org.apache.tinkerpop.gremlin.process.actor.Actors;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
 import org.apache.tinkerpop.gremlin.structure.util.partitioner.HashPartitioner;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.in;
 import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.out;
-import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.outE;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -38,14 +38,15 @@ import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.outE;
 public class AkkaPlayTest {
 
     @Test
+    @Ignore
     public void testPlay1() throws Exception {
         final Graph graph = TinkerGraph.open();
         graph.io(GryoIo.build()).readGraph("../data/tinkerpop-modern.kryo");
-        GraphTraversalSource g = graph.traversal().withStrategies(new ActorProgramStrategy(AkkaGraphActors.class, new HashPartitioner(graph.partitioner(), 3)));
+        GraphTraversalSource g = graph.traversal().withProcessor(Actors.of(AkkaGraphActors.class).partitioner(new HashPartitioner(graph.partitioner(), 3)));
         // System.out.println(g.V().group().by("name").by(outE().values("weight").fold()).toList());
 
-        for (int i = 0; i < 10000; i++) {
-            if(12l != g.V().union(out(), in()).values("name").count().next())
+        for (int i = 0; i < 1000; i++) {
+            if (12l != g.V().union(out(), in()).values("name").count().next())
                 System.out.println(i);
         }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java
index 2244ae9..493806b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java
@@ -72,6 +72,8 @@ import org.apache.tinkerpop.gremlin.structure.Direction;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Element;
 import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Partition;
+import org.apache.tinkerpop.gremlin.structure.Partitioner;
 import org.apache.tinkerpop.gremlin.structure.Property;
 import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Transaction;
@@ -83,6 +85,7 @@ import org.apache.tinkerpop.gremlin.structure.io.Io;
 import org.apache.tinkerpop.gremlin.structure.io.IoCore;
 import org.apache.tinkerpop.gremlin.structure.io.Storage;
 import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
+import org.apache.tinkerpop.gremlin.structure.util.partitioner.HashPartitioner;
 import org.apache.tinkerpop.gremlin.util.Gremlin;
 import org.apache.tinkerpop.gremlin.util.TimeUtil;
 import org.javatuples.Pair;
@@ -116,6 +119,8 @@ public final class CoreImports {
         CLASS_IMPORTS.add(Transaction.class);
         CLASS_IMPORTS.add(Vertex.class);
         CLASS_IMPORTS.add(VertexProperty.class);
+        CLASS_IMPORTS.add(Partitioner.class);
+        CLASS_IMPORTS.add(Partition.class);
         // tokens
         CLASS_IMPORTS.add(SackFunctions.class);
         CLASS_IMPORTS.add(SackFunctions.Barrier.class);
@@ -185,6 +190,7 @@ public final class CoreImports {
         // utils
         CLASS_IMPORTS.add(Gremlin.class);
         CLASS_IMPORTS.add(TimeUtil.class);
+        CLASS_IMPORTS.add(HashPartitioner.class);
 
         /////////////
         // METHODS //

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/Processor.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/Processor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/Processor.java
new file mode 100644
index 0000000..b55415c
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/Processor.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;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+
+import java.io.Serializable;
+
+/**
+ * This is a marker interface that denotes that the respective implementation is able to evaluate/execute/process a
+ * {@link org.apache.tinkerpop.gremlin.process.traversal.Traversal}.
+ *
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public interface Processor {
+
+    /**
+     * A {@link Processor} description provides the necessary configuration to create a {@link Processor}.
+     * This also entails {@link org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy} creation
+     * for a {@link TraversalSource}.
+     *
+     * @param <P> The type of {@link Processor} this description is used for.
+     */
+    public static interface Description<P extends Processor> extends Cloneable, Serializable {
+
+        /**
+         * Add respective {@link org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies} to the
+         * provided {@link TraversalSource}.
+         *
+         * @param traversalSource the traversal source to add processor-specific strategies to
+         */
+        public void addTraversalStrategies(final TraversalSource traversalSource);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/Actors.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/Actors.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/Actors.java
new file mode 100644
index 0000000..0822017
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/Actors.java
@@ -0,0 +1,76 @@
+/*
+ *  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.actor;
+
+import org.apache.tinkerpop.gremlin.process.Processor;
+import org.apache.tinkerpop.gremlin.process.actor.traversal.strategy.decoration.ActorProgramStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.structure.Partitioner;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class Actors implements Processor.Description<GraphActors> {
+
+    private final Class<? extends GraphActors> graphActorsClass;
+    private Partitioner partitioner = null;
+
+    private Actors(final Class<? extends GraphActors> graphActorsClass) {
+        this.graphActorsClass = graphActorsClass;
+    }
+
+    public static Actors of(final Class<? extends GraphActors> graphActorsClass) {
+        return new Actors(graphActorsClass);
+    }
+
+    public Actors partitioner(final Partitioner partitioner) {
+        final Actors clone = this.clone();
+        clone.partitioner = partitioner;
+        return clone;
+    }
+
+    public Class<? extends GraphActors> getGraphActorsClass() {
+        return this.graphActorsClass;
+    }
+
+    public Partitioner getPartitioner() {
+        return this.partitioner;
+    }
+
+
+    @Override
+    public String toString() {
+        return this.graphActorsClass.getSimpleName().toLowerCase();
+    }
+
+    public Actors clone() {
+        try {
+            return (Actors) super.clone();
+        } catch (final CloneNotSupportedException e) {
+            throw new IllegalStateException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public void addTraversalStrategies(final TraversalSource traversalSource) {
+        final ActorProgramStrategy actorProgramStrategy = new ActorProgramStrategy(this);
+        traversalSource.getStrategies().addStrategies(actorProgramStrategy);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/Address.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/Address.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/Address.java
index ff45e30..9f59e5e 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/Address.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/Address.java
@@ -20,49 +20,56 @@
 package org.apache.tinkerpop.gremlin.process.actor;
 
 import java.io.Serializable;
+import java.net.InetAddress;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
 public abstract class Address implements Serializable {
 
-    private final String location;
+    private final String id;
+    private final InetAddress location;
 
-    public Address(final String location) {
+    public Address(final String id, final InetAddress location) {
+        this.id = id;
         this.location = location;
     }
 
-    public String location() {
+    public InetAddress getLocation() {
         return this.location;
     }
 
+    public String getId() {
+        return this.id;
+    }
+
     @Override
     public boolean equals(final Object other) {
-        return other instanceof Address && ((Address) other).location.equals(this.location);
+        return other instanceof Address && ((Address) other).id.equals(this.id);
     }
 
     @Override
     public int hashCode() {
-        return this.location.hashCode();
+        return this.id.hashCode();
     }
 
     @Override
     public String toString() {
-        return this.location();
+        return this.id;
     }
 
     public static final class Master extends Address {
 
-        public Master(final String location) {
-            super(location);
+        public Master(final String id, final InetAddress location) {
+            super(id, location);
         }
 
     }
 
     public static final class Worker extends Address {
 
-        public Worker(final String location) {
-            super(location);
+        public Worker(final String id, final InetAddress location) {
+            super(id, location);
         }
 
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/GraphActors.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/GraphActors.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/GraphActors.java
index c0cdc9e..1b01f36 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/GraphActors.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/GraphActors.java
@@ -19,12 +19,14 @@
 
 package org.apache.tinkerpop.gremlin.process.actor;
 
+import org.apache.tinkerpop.gremlin.process.Processor;
+
 import java.util.concurrent.Future;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-public interface GraphActors<R> {
+public interface GraphActors<R> extends Processor {
 
     public Address.Master master();
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/TraversalMasterProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/TraversalMasterProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/TraversalMasterProgram.java
index 2cd5f7f..87ed4e6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/TraversalMasterProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/TraversalMasterProgram.java
@@ -43,6 +43,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.OrderedTrav
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMatrix;
 import org.apache.tinkerpop.gremlin.structure.Element;
+import org.apache.tinkerpop.gremlin.structure.Partition;
 import org.apache.tinkerpop.gremlin.structure.Partitioner;
 
 import java.util.HashMap;
@@ -62,11 +63,12 @@ final class TraversalMasterProgram<M> implements ActorProgram.Master<M> {
     private final TraverserSet<?> results;
     private Address.Worker leaderWorker;
     private int orderCounter = -1;
+    private final Map<Partition,Address.Worker> partitionToWorkerMap = new HashMap<>();
 
     public TraversalMasterProgram(final Actor.Master master, final Traversal.Admin<?, ?> traversal, final Partitioner partitioner, final TraverserSet<?> results) {
         this.traversal = traversal;
-        //System.out.println("master[created]: " + master.address().location());
-        //System.out.println(this.traversal);
+        // System.out.println("master[created]: " + master.address().getId());
+        // System.out.println(this.traversal);
         this.matrix = new TraversalMatrix<>(this.traversal);
         this.partitioner = partitioner;
         this.results = results;
@@ -78,6 +80,9 @@ final class TraversalMasterProgram<M> implements ActorProgram.Master<M> {
     @Override
     public void setup() {
         this.leaderWorker = this.master.workers().get(0);
+        for(int i=0; i<this.partitioner.getPartitions().size(); i++) {
+            this.partitionToWorkerMap.put(this.partitioner.getPartitions().get(i),this.master.workers().get(i));
+        }
         this.broadcast(StartMessage.instance());
         this.master.send(this.leaderWorker, Terminate.MAYBE);
     }
@@ -162,7 +167,7 @@ final class TraversalMasterProgram<M> implements ActorProgram.Master<M> {
         if (traverser.isHalted())
             this.results.add(traverser);
         else if (traverser.get() instanceof Element)
-            this.master.send(this.master.workers().get(this.partitioner.getPartitions().indexOf(this.partitioner.getPartition((Element) traverser.get()))), traverser);
+            this.master.send(this.partitionToWorkerMap.get(this.partitioner.getPartition((Element) traverser.get())), traverser);
         else
             this.master.send(this.master.address(), traverser);
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/TraversalWorkerProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/TraversalWorkerProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/TraversalWorkerProgram.java
index dc03b7d..f01c138 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/TraversalWorkerProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/TraversalWorkerProgram.java
@@ -33,7 +33,6 @@ 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.Bypassing;
 import org.apache.tinkerpop.gremlin.process.traversal.step.Distributing;
-import org.apache.tinkerpop.gremlin.process.traversal.step.GraphComputing;
 import org.apache.tinkerpop.gremlin.process.traversal.step.Pushing;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
@@ -58,6 +57,7 @@ final class TraversalWorkerProgram<M> implements ActorProgram.Worker<M> {
     private final TraversalMatrix<?, ?> matrix;
     private final Partition localPartition;
     private final Partitioner partitioner;
+    private final Map<Partition, Address.Worker> partitionToWorkerMap = new HashMap<>();
     //
     private Address.Worker neighborWorker;
     private boolean isLeader;
@@ -67,7 +67,7 @@ final class TraversalWorkerProgram<M> implements ActorProgram.Worker<M> {
 
     public TraversalWorkerProgram(final Actor.Worker self, final Traversal.Admin<?, ?> traversal, final Partitioner partitioner) {
         this.self = self;
-        // System.out.println("worker[created]: " + this.self.address().location());
+        // System.out.println("worker[created]: " + this.self.address().getId());
         // set up partition and traversal information
         this.partitioner = partitioner;
         this.localPartition = self.partition();
@@ -96,6 +96,9 @@ final class TraversalWorkerProgram<M> implements ActorProgram.Worker<M> {
         final int i = this.self.workers().indexOf(this.self.address());
         this.neighborWorker = this.self.workers().get(i == this.self.workers().size() - 1 ? 0 : i + 1);
         this.isLeader = i == 0;
+        for (int j = 0; j < this.partitioner.getPartitions().size(); j++) {
+            this.partitionToWorkerMap.put(this.partitioner.getPartitions().get(j), this.self.workers().get(j));
+        }
     }
 
     @Override
@@ -152,7 +155,6 @@ final class TraversalWorkerProgram<M> implements ActorProgram.Worker<M> {
     private void processTraverser(final Traverser.Admin traverser) {
         assert !(traverser.get() instanceof Element) || !traverser.isHalted() || this.localPartition.contains((Element) traverser.get());
         final Step<?, ?> step = this.matrix.<Object, Object, Step<Object, Object>>getStepById(traverser.getStepId());
-        if (step instanceof Bypassing) ((Bypassing) step).setBypass(true);
         step.addStart(traverser);
         if (step instanceof Barrier) {
             this.barriers.put(step.getId(), (Barrier) step);
@@ -168,7 +170,7 @@ final class TraversalWorkerProgram<M> implements ActorProgram.Worker<M> {
         if (traverser.isHalted())
             this.self.send(this.self.master(), traverser);
         else if (traverser.get() instanceof Element && !this.localPartition.contains((Element) traverser.get()))
-            this.self.send(this.self.workers().get(this.partitioner.getPartitions().indexOf(this.partitioner.getPartition((Element) traverser.get()))), traverser);
+            this.self.send(this.partitionToWorkerMap.get(this.partitioner.getPartition((Element) traverser.get())), traverser);
         else
             this.self.send(this.self.address(), traverser);
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/strategy/decoration/ActorProgramStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/strategy/decoration/ActorProgramStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/strategy/decoration/ActorProgramStrategy.java
index 1ab13fc..26d3eec 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/strategy/decoration/ActorProgramStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actor/traversal/strategy/decoration/ActorProgramStrategy.java
@@ -19,6 +19,7 @@
 
 package org.apache.tinkerpop.gremlin.process.actor.traversal.strategy.decoration;
 
+import org.apache.tinkerpop.gremlin.process.actor.Actors;
 import org.apache.tinkerpop.gremlin.process.actor.GraphActors;
 import org.apache.tinkerpop.gremlin.process.actor.traversal.step.map.TraversalActorProgramStep;
 import org.apache.tinkerpop.gremlin.process.remote.traversal.strategy.decoration.RemoteStrategy;
@@ -29,6 +30,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversal
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
 import org.apache.tinkerpop.gremlin.structure.Partitioner;
+import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
 
 import java.util.Collections;
 import java.util.Set;
@@ -39,17 +41,20 @@ import java.util.Set;
 public final class ActorProgramStrategy extends AbstractTraversalStrategy<TraversalStrategy.DecorationStrategy>
         implements TraversalStrategy.DecorationStrategy {
 
-
     private static final Set<Class<? extends DecorationStrategy>> PRIORS = Collections.singleton(RemoteStrategy.class);
 
     private final Partitioner partitioner;
     private final Class<? extends GraphActors> actors;
 
-    public ActorProgramStrategy(final Class<? extends GraphActors> actors, final Partitioner partitioner) {
+    private ActorProgramStrategy(final Class<? extends GraphActors> actors, final Partitioner partitioner) {
         this.actors = actors;
         this.partitioner = partitioner;
     }
 
+    public ActorProgramStrategy(final Actors actors) {
+        this(actors.getGraphActorsClass(), actors.getPartitioner());
+    }
+
     @Override
     public void apply(final Traversal.Admin<?, ?> traversal) {
         ReadOnlyStrategy.instance().apply(traversal);
@@ -57,7 +62,10 @@ public final class ActorProgramStrategy extends AbstractTraversalStrategy<Traver
         if (!(traversal.getParent() instanceof EmptyStep))
             return;
 
-        final TraversalActorProgramStep<?, ?> actorStep = new TraversalActorProgramStep<>(traversal, this.actors, this.partitioner);
+        final TraversalActorProgramStep<?, ?> actorStep = new TraversalActorProgramStep<>(traversal, this.actors,
+                null == this.partitioner ?
+                        traversal.getGraph().orElse(EmptyGraph.instance()).partitioner() :
+                        this.partitioner);
         TraversalHelper.removeAllSteps(traversal);
         traversal.addStep(actorStep);
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
index 34b1fa4..d0baec0 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
@@ -19,12 +19,14 @@
 
 package org.apache.tinkerpop.gremlin.process.computer;
 
+import org.apache.tinkerpop.gremlin.process.Processor;
+import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 
-import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.function.Function;
@@ -32,7 +34,7 @@ import java.util.function.Function;
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-public final class Computer implements Function<Graph, GraphComputer>, Serializable, Cloneable {
+public final class Computer implements Processor.Description<GraphComputer>, Function<Graph, GraphComputer> {
 
     private Class<? extends GraphComputer> graphComputerClass = GraphComputer.class;
     private Map<String, Object> configuration = new HashMap<>();
@@ -50,10 +52,20 @@ public final class Computer implements Function<Graph, GraphComputer>, Serializa
 
     }
 
+    public static Computer of() {
+        return new Computer(GraphComputer.class);
+    }
+
+    public static Computer of(final Class<? extends GraphComputer> graphComputerClass) {
+        return new Computer(graphComputerClass);
+    }
+
+    @Deprecated
     public static Computer compute() {
         return new Computer(GraphComputer.class);
     }
 
+    @Deprecated
     public static Computer compute(final Class<? extends GraphComputer> graphComputerClass) {
         return new Computer(graphComputerClass);
     }
@@ -145,6 +157,13 @@ public final class Computer implements Function<Graph, GraphComputer>, Serializa
         }
     }
 
+    @Override
+    public void addTraversalStrategies(final TraversalSource traversalSource) {
+        final VertexProgramStrategy vertexProgramStrategy = new VertexProgramStrategy(this);
+        traversalSource.getStrategies().addStrategies(vertexProgramStrategy);
+        vertexProgramStrategy.addGraphComputerStrategies(traversalSource);
+    }
+
     /////////////////
     /////////////////
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputer.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputer.java
index 50c8015..d63b9e8 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputer.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.process.computer;
 
+import org.apache.tinkerpop.gremlin.process.Processor;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
@@ -32,7 +33,7 @@ import java.util.concurrent.Future;
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  * @author Matthias Broecheler (me@matthiasb.com)
  */
-public interface GraphComputer {
+public interface GraphComputer extends Processor {
 
     public enum ResultGraph {
         /**

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/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 8fd8c99..b6d948d 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
@@ -20,6 +20,7 @@ package org.apache.tinkerpop.gremlin.process.traversal;
 
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.tinkerpop.gremlin.process.Processor;
 import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy;
@@ -92,6 +93,7 @@ public interface TraversalSource extends Cloneable, AutoCloseable {
         public static final String withComputer = "withComputer";
         public static final String withSideEffect = "withSideEffect";
         public static final String withRemote = "withRemote";
+        public static final String withProcessor = "withProcessor";
     }
 
     /////////////////////////////
@@ -108,7 +110,7 @@ public interface TraversalSource extends Cloneable, AutoCloseable {
         clone.getBytecode().addSource(TraversalSource.Symbols.withStrategies, traversalStrategies);
         for (final TraversalStrategy traversalStrategy : traversalStrategies) {
             if (traversalStrategy instanceof VertexProgramStrategy) {
-                ((VertexProgramStrategy) traversalStrategy).addGraphComputerStrategies(clone);
+                ((VertexProgramStrategy) traversalStrategy).addGraphComputerStrategies(clone); // TODO: this is not generalized
             }
         }
         return clone;
@@ -129,6 +131,19 @@ public interface TraversalSource extends Cloneable, AutoCloseable {
     }
 
     /**
+     * Define the type of {@link Processor} that will evaluate all subsequent {@link Traversal}s spawned from this source.
+     *
+     * @param processor the description of the processor to use
+     * @return a new traversal source with updated strategies
+     */
+    public default TraversalSource withProcessor(final Processor.Description processor) {
+        final TraversalSource clone = this.clone();
+        processor.addTraversalStrategies(clone);
+        clone.getBytecode().addSource(Symbols.withProcessor, processor);
+        return clone;
+    }
+
+    /**
      * Using the provided {@link Bindings} to create {@link org.apache.tinkerpop.gremlin.process.traversal.Bytecode.Binding}.
      * The bindings serve as a relay for ensure bound arguments are encoded as {@link org.apache.tinkerpop.gremlin.process.traversal.Bytecode.Binding} in {@link Bytecode}.
      *
@@ -160,7 +175,7 @@ public interface TraversalSource extends Cloneable, AutoCloseable {
      * @return a new traversal source with updated strategies
      */
     public default TraversalSource withComputer(final Class<? extends GraphComputer> graphComputerClass) {
-        return this.withStrategies(new VertexProgramStrategy(Computer.compute(graphComputerClass)));
+        return this.withStrategies(new VertexProgramStrategy(Computer.of(graphComputerClass)));
     }
 
     /**
@@ -170,7 +185,7 @@ public interface TraversalSource extends Cloneable, AutoCloseable {
      * @return a new traversal source with updated strategies
      */
     public default TraversalSource withComputer() {
-        return this.withStrategies(new VertexProgramStrategy(Computer.compute()));
+        return this.withStrategies(new VertexProgramStrategy(Computer.of()));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/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 af78add..d6facb7 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,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.process.traversal.dsl.graph;
 
 import org.apache.commons.configuration.Configuration;
+import org.apache.tinkerpop.gremlin.process.Processor;
 import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection;
@@ -133,6 +134,11 @@ public class GraphTraversalSource implements TraversalSource {
     }
 
     @Override
+    public GraphTraversalSource withProcessor(final Processor.Description processor) {
+        return (GraphTraversalSource) TraversalSource.super.withProcessor(processor);
+    }
+
+    @Override
     @Deprecated
     public GraphTraversalSource withBindings(final Bindings bindings) {
         return (GraphTraversalSource) TraversalSource.super.withBindings(bindings);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b67a7a/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py b/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
index df61495..8af82d7 100644
--- a/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
+++ b/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
@@ -46,6 +46,10 @@ class GraphTraversalSource(object):
     source = GraphTraversalSource(self.graph, TraversalStrategies(self.traversal_strategies), Bytecode(self.bytecode))
     source.bytecode.add_source("withPath", *args)
     return source
+  def withProcessor(self, *args):
+    source = GraphTraversalSource(self.graph, TraversalStrategies(self.traversal_strategies), Bytecode(self.bytecode))
+    source.bytecode.add_source("withProcessor", *args)
+    return source
   def withSack(self, *args):
     source = GraphTraversalSource(self.graph, TraversalStrategies(self.traversal_strategies), Bytecode(self.bytecode))
     source.bytecode.add_source("withSack", *args)