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 2015/03/31 18:43:09 UTC

[1/2] incubator-tinkerpop git commit: Removed LambdaVertexProgram and LambdaMapReduce as it is one less thing to maintain. Rewrote GraphComputerTest so its ONLY for Java8 and is much easier to extend now that it no longer uses LambdaXXX.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 92ce07d79 -> 4435485b6


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4435485b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
index 778b998..96ab10d 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
@@ -22,10 +22,11 @@ import org.apache.tinkerpop.gremlin.ExceptionCoverage;
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
 import org.apache.tinkerpop.gremlin.process.UseEngine;
-import org.apache.tinkerpop.gremlin.process.computer.lambda.LambdaMapReduce;
-import org.apache.tinkerpop.gremlin.process.computer.lambda.LambdaVertexProgram;
+import org.apache.tinkerpop.gremlin.process.computer.util.StaticMapReduce;
+import org.apache.tinkerpop.gremlin.process.computer.util.StaticVertexProgram;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 import org.apache.tinkerpop.gremlin.util.StreamFactory;
@@ -34,10 +35,13 @@ import org.junit.Test;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
 import java.util.concurrent.Future;
 
 import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
@@ -60,38 +64,13 @@ import static org.junit.Assert.*;
         "onlyOneOrNoGraphComputerClass"
 })
 @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
-public abstract class GraphComputerTest extends AbstractGremlinProcessTest {
-
-    public abstract GraphComputer get_g_compute();
-
-    public abstract GraphComputer get_g_compute_setupXX_executeXX_terminateXtrueX();
-
-    public abstract GraphComputer get_g_compute_setupXX_executeXX_terminateXtrueX_memoryKeysXset_incr_and_orX();
-
-    public abstract GraphComputer get_g_compute_setupXX_executeXX_terminateXtrueX_memoryKeysXnullX();
-
-    public abstract GraphComputer get_g_compute_setupXX_executeXX_terminateXtrueX_memoryKeysX_X();
-
-    public abstract GraphComputer get_g_compute_setupXsetXa_trueXX_executeXX_terminateXtrueX();
-
-    public abstract GraphComputer get_g_compute_setupXX_executeXv_blah_m_incrX_terminateX1X_elementKeysXnameLengthCounterX_memoryKeysXa_bX();
-
-    public abstract GraphComputer get_g_compute_setupXabcdeX_executeXtestMemoryX_terminateXtestMemoryXmemoryKeysXabcdeX();
-
-    public abstract GraphComputer get_g_compute_mapXageX_reduceXsumX_memoryXnextX_memoryKeyXageSumX();
-
-    public abstract GraphComputer get_g_compute_executeXcounterX_terminateX8X_mapreduceXcounter_aX_mapreduceXcounter_bX();
-
-    public abstract GraphComputer get_g_compute_mapXidX_reduceXidX_reduceKeySortXreverseX_memoryKeyXidsX();
-
-    public abstract GraphComputer get_g_compute_programXTraversalVertexProgram_build_traversalXg_V_both_hasXlabel_personX_age_groupCountXaXX_create();
-
-    public abstract GraphComputer get_g_compute_mapXoutE_countX_reduceXsumX();
+@UseEngine(TraversalEngine.Type.COMPUTER)
+public class GraphComputerTest extends AbstractGremlinProcessTest {
 
     @Test
     @LoadGraphWith(MODERN)
     public void shouldHaveStandardStringRepresentation() {
-        final GraphComputer computer = get_g_compute();
+        final GraphComputer computer = graph.compute(graphComputerClass.get());
         assertEquals(StringFactory.graphComputerString(computer), computer.toString());
     }
 
@@ -99,7 +78,7 @@ public abstract class GraphComputerTest extends AbstractGremlinProcessTest {
     @LoadGraphWith(MODERN)
     public void shouldNotAllowWithNoVertexProgramNorMapReducers() throws Exception {
         try {
-            get_g_compute().submit().get();
+            graph.compute(graphComputerClass.get()).submit().get();
             fail("Should throw an IllegalStateException when there is no vertex program nor map reducers");
         } catch (Exception ex) {
             validateException(GraphComputer.Exceptions.computerHasNoVertexProgramNorMapReducers(), ex);
@@ -109,7 +88,8 @@ public abstract class GraphComputerTest extends AbstractGremlinProcessTest {
     @Test
     @LoadGraphWith(MODERN)
     public void shouldFailIfIsolationIsNotSupported() {
-        final GraphComputer computer = get_g_compute();
+        final GraphComputer computer = graph.compute(graphComputerClass.get());
+        ;
         if (!computer.features().supportsIsolation(GraphComputer.Isolation.BSP)) {
             try {
                 computer.isolation(GraphComputer.Isolation.BSP);
@@ -129,6 +109,7 @@ public abstract class GraphComputerTest extends AbstractGremlinProcessTest {
         assertEquals(StringFactory.graphComputerString(computer), computer.toString());
     }
 
+    /////////////////////////////////////////////
     @Test
     @LoadGraphWith(MODERN)
     public void shouldNotAllowBadGraphComputers() {
@@ -140,10 +121,45 @@ public abstract class GraphComputerTest extends AbstractGremlinProcessTest {
         }
     }
 
+    public static class BadGraphComputer implements GraphComputer {
+        @Override
+        public GraphComputer isolation(final Isolation isolation) {
+            return null;
+        }
+
+        @Override
+        public GraphComputer result(final ResultGraph resultGraph) {
+            return null;
+        }
+
+        @Override
+        public GraphComputer persist(final Persist persist) {
+            return null;
+        }
+
+        @Override
+        public GraphComputer program(final VertexProgram vertexProgram) {
+            return null;
+        }
+
+        @Override
+        public GraphComputer mapReduce(final MapReduce mapReduce) {
+            return null;
+        }
+
+        @Override
+        public Future<ComputerResult> submit() {
+            return null;
+        }
+
+    }
+    /////////////////////////////////////////////
+
+    /////////////////////////////////////////////
     @Test
     @LoadGraphWith(MODERN)
     public void shouldHaveImmutableComputeResultMemory() throws Exception {
-        final ComputerResult results = this.get_g_compute_setupXX_executeXX_terminateXtrueX_memoryKeysXset_incr_and_orX().submit().get();
+        final ComputerResult results = graph.compute(graphComputerClass.get()).program(new VertexProgramB()).submit().get();
 
         try {
             results.memory().set("set", "test");
@@ -170,44 +186,194 @@ public abstract class GraphComputerTest extends AbstractGremlinProcessTest {
         }
     }
 
+    public static class VertexProgramB extends StaticVertexProgram {
+        @Override
+        public void setup(final Memory memory) {
+
+        }
+
+        @Override
+        public void execute(final Vertex vertex, final Messenger messenger, final Memory memory) {
+
+        }
+
+        @Override
+        public boolean terminate(final Memory memory) {
+            return true;
+        }
+
+        @Override
+        public Set<String> getMemoryComputeKeys() {
+            return new HashSet<>(Arrays.asList("set", "incr", "and", "or"));
+        }
+
+        @Override
+        public Set<MessageScope> getMessageScopes(final Memory memory) {
+            return Collections.emptySet();
+        }
+
+        @Override
+        public GraphComputer.ResultGraph getPreferredResultGraph() {
+            return GraphComputer.ResultGraph.ORIGINAL;
+        }
+
+        @Override
+        public GraphComputer.Persist getPreferredPersist() {
+            return GraphComputer.Persist.NOTHING;
+        }
+    }
+    /////////////////////////////////////////////
+
     @Test
     @LoadGraphWith(MODERN)
     public void shouldNotAllowNullMemoryKeys() throws Exception {
         try {
-            get_g_compute_setupXX_executeXX_terminateXtrueX_memoryKeysXnullX().submit().get();
+            graph.compute(graphComputerClass.get()).program(new VertexProgramC()).submit().get();
             fail("Providing null memory key should fail");
         } catch (Exception ex) {
-            // TODO ex.printStackTrace();
-            //validateException(Memory.Exceptions.memoryKeyCanNotBeNull(), ex);
+            // validateException(Memory.Exceptions.memoryKeyCanNotBeNull(), ex);
+        }
+    }
+
+    public static class VertexProgramC extends StaticVertexProgram {
+        @Override
+        public void setup(final Memory memory) {
+
+        }
+
+        @Override
+        public void execute(final Vertex vertex, final Messenger messenger, final Memory memory) {
+
+        }
+
+        @Override
+        public boolean terminate(final Memory memory) {
+            return true;
+        }
+
+        @Override
+        public Set<String> getMemoryComputeKeys() {
+            return new HashSet<>(Arrays.asList(null));
+        }
+
+        @Override
+        public Set<MessageScope> getMessageScopes(final Memory memory) {
+            return Collections.emptySet();
+        }
+
+        @Override
+        public GraphComputer.ResultGraph getPreferredResultGraph() {
+            return GraphComputer.ResultGraph.ORIGINAL;
+        }
+
+        @Override
+        public GraphComputer.Persist getPreferredPersist() {
+            return GraphComputer.Persist.NOTHING;
         }
     }
+    /////////////////////////////////////////////
 
+    /////////////////////////////////////////////
     @Test
     @LoadGraphWith(MODERN)
     public void shouldNotAllowEmptyMemoryKeys() throws Exception {
         try {
-            get_g_compute_setupXX_executeXX_terminateXtrueX_memoryKeysX_X().submit().get();
+            graph.compute(graphComputerClass.get()).program(new VertexProgramD()).submit().get();
             fail("Providing empty memory key should fail");
         } catch (Exception ex) {
             validateException(Memory.Exceptions.memoryKeyCanNotBeEmpty(), ex);
         }
     }
 
+    public static class VertexProgramD extends StaticVertexProgram {
+        @Override
+        public void setup(final Memory memory) {
+
+        }
+
+        @Override
+        public void execute(final Vertex vertex, final Messenger messenger, final Memory memory) {
+
+        }
+
+        @Override
+        public boolean terminate(final Memory memory) {
+            return true;
+        }
+
+        @Override
+        public Set<String> getMemoryComputeKeys() {
+            return new HashSet<>(Arrays.asList(""));
+        }
+
+        @Override
+        public Set<MessageScope> getMessageScopes(final Memory memory) {
+            return Collections.emptySet();
+        }
+
+        @Override
+        public GraphComputer.ResultGraph getPreferredResultGraph() {
+            return GraphComputer.ResultGraph.ORIGINAL;
+        }
+
+        @Override
+        public GraphComputer.Persist getPreferredPersist() {
+            return GraphComputer.Persist.NOTHING;
+        }
+    }
+    ////////////////////////////////////////////
+
+    ////////////////////////////////////////////
     @Test
     @LoadGraphWith(MODERN)
     public void shouldNotAllowSettingUndeclaredMemoryKeys() throws Exception {
         try {
-            get_g_compute_setupXsetXa_trueXX_executeXX_terminateXtrueX().submit().get();
+            graph.compute(graphComputerClass.get()).program(new VertexProgramE()).submit().get();
             fail("Setting a memory key that wasn't declared should fail");
         } catch (Exception ex) {
             // TODO: validateException(GraphComputer.Exceptions.providedKeyIsNotAMemoryComputeKey("a"), ex.getCause());
         }
     }
 
+    public static class VertexProgramE extends StaticVertexProgram {
+        @Override
+        public void setup(final Memory memory) {
+            memory.set("a", true);
+        }
+
+        @Override
+        public void execute(final Vertex vertex, final Messenger messenger, final Memory memory) {
+
+        }
+
+        @Override
+        public boolean terminate(final Memory memory) {
+            return true;
+        }
+
+
+        @Override
+        public Set<MessageScope> getMessageScopes(final Memory memory) {
+            return Collections.emptySet();
+        }
+
+        @Override
+        public GraphComputer.ResultGraph getPreferredResultGraph() {
+            return GraphComputer.ResultGraph.ORIGINAL;
+        }
+
+        @Override
+        public GraphComputer.Persist getPreferredPersist() {
+            return GraphComputer.Persist.NOTHING;
+        }
+    }
+    ////////////////////////////////////////////
+
+    /////////////////////////////////////////////
     @Test
     @LoadGraphWith(MODERN)
     public void shouldNotAllowTheSameComputerToExecutedTwice() throws Exception {
-        final GraphComputer computer = get_g_compute_setupXX_executeXX_terminateXtrueX();
+        final GraphComputer computer = graph.compute(graphComputerClass.get()).program(new VertexProgramA());
         computer.submit().get(); // this should work as its the first run of the graph computer
 
         try {
@@ -230,10 +396,45 @@ public abstract class GraphComputerTest extends AbstractGremlinProcessTest {
         }
     }
 
+    public static class VertexProgramA extends StaticVertexProgram {
+
+        @Override
+        public void setup(final Memory memory) {
+
+        }
+
+        @Override
+        public void execute(final Vertex vertex, final Messenger messenger, final Memory memory) {
+
+        }
+
+        @Override
+        public boolean terminate(final Memory memory) {
+            return true;
+        }
+
+        @Override
+        public Set<MessageScope> getMessageScopes(final Memory memory) {
+            return Collections.emptySet();
+        }
+
+        @Override
+        public GraphComputer.ResultGraph getPreferredResultGraph() {
+            return GraphComputer.ResultGraph.ORIGINAL;
+        }
+
+        @Override
+        public GraphComputer.Persist getPreferredPersist() {
+            return GraphComputer.Persist.NOTHING;
+        }
+    }
+    /////////////////////////////////////////////
+
+    /////////////////////////////////////////////
     @Test
     @LoadGraphWith(MODERN)
     public void shouldHaveConsistentMemoryVertexPropertiesAndExceptions() throws Exception {
-        ComputerResult results = get_g_compute_setupXX_executeXv_blah_m_incrX_terminateX1X_elementKeysXnameLengthCounterX_memoryKeysXa_bX().submit().get();
+        ComputerResult results = graph.compute(graphComputerClass.get()).program(new VertexProgramF()).submit().get();
         assertEquals(1, results.memory().getIteration());
         assertEquals(2, results.memory().asMap().size());
         assertEquals(2, results.memory().keys().size());
@@ -257,10 +458,70 @@ public abstract class GraphComputerTest extends AbstractGremlinProcessTest {
         });
     }
 
+    public static class VertexProgramF extends StaticVertexProgram<Object> {
+
+        @Override
+        public void setup(final Memory memory) {
+
+        }
+
+        @Override
+        public void execute(final Vertex vertex, final Messenger<Object> messenger, final Memory memory) {
+            try {
+                vertex.property("blah", "blah");
+                fail("Should throw an IllegalArgumentException");
+            } catch (final IllegalArgumentException e) {
+                assertEquals(GraphComputer.Exceptions.providedKeyIsNotAnElementComputeKey("blah").getMessage(), e.getMessage());
+            } catch (final Exception e) {
+                fail("Should throw an IllegalArgumentException: " + e);
+            }
+
+            memory.incr("a", 1);
+            if (memory.isInitialIteration()) {
+                vertex.property("nameLengthCounter", vertex.<String>value("name").length());
+                memory.incr("b", vertex.<String>value("name").length());
+            } else {
+                vertex.property(VertexProperty.Cardinality.single, "nameLengthCounter", vertex.<String>value("name").length() + vertex.<Integer>value("nameLengthCounter"));
+            }
+        }
+
+        @Override
+        public boolean terminate(final Memory memory) {
+            return memory.getIteration() == 1;
+        }
+
+        @Override
+        public Set<String> getElementComputeKeys() {
+            return new HashSet<>(Arrays.asList("nameLengthCounter"));
+        }
+
+        @Override
+        public Set<String> getMemoryComputeKeys() {
+            return new HashSet<>(Arrays.asList("a", "b"));
+        }
+
+        @Override
+        public Set<MessageScope> getMessageScopes(Memory memory) {
+            return Collections.emptySet();
+        }
+
+        @Override
+        public GraphComputer.ResultGraph getPreferredResultGraph() {
+            return GraphComputer.ResultGraph.NEW;
+        }
+
+        @Override
+        public GraphComputer.Persist getPreferredPersist() {
+            return GraphComputer.Persist.EDGES;
+        }
+    }
+    /////////////////////////////////////////////
+
+    /////////////////////////////////////////////
     @Test
     @LoadGraphWith(MODERN)
     public void shouldAndOrIncrCorrectlyThroughSubStages() throws Exception {
-        ComputerResult results = get_g_compute_setupXabcdeX_executeXtestMemoryX_terminateXtestMemoryXmemoryKeysXabcdeX().submit().get();
+        ComputerResult results = graph.compute(graphComputerClass.get()).program(new VertexProgramG()).submit().get();
         assertEquals(2, results.memory().getIteration());
         assertEquals(5, results.memory().asMap().size());
         assertEquals(5, results.memory().keys().size());
@@ -277,368 +538,303 @@ public abstract class GraphComputerTest extends AbstractGremlinProcessTest {
         assertTrue(results.memory().get("e"));
     }
 
+    public static class VertexProgramG extends StaticVertexProgram {
 
+        @Override
+        public void setup(final Memory memory) {
+            memory.set("a", 0l);
+            memory.set("b", 0l);
+            memory.set("c", true);
+            memory.set("d", false);
+            memory.set("e", true);
+        }
+
+        @Override
+        public void execute(Vertex vertex, Messenger messenger, Memory memory) {
+            // test current step values
+            assertEquals(Long.valueOf(6 * memory.getIteration()), memory.get("a"));
+            assertEquals(Long.valueOf(0), memory.get("b"));
+            if (memory.isInitialIteration()) {
+                assertTrue(memory.get("c"));
+                assertFalse(memory.get("d"));
+            } else {
+                assertFalse(memory.get("c"));
+                assertTrue(memory.get("d"));
+            }
+            assertTrue(memory.get("e"));
+
+            // update current step values
+            memory.incr("a", 1l);
+            memory.incr("b", 1l);
+            memory.and("c", false);
+            memory.or("d", true);
+            memory.and("e", false);
+
+            // test current step values, should be the same as previous prior to update
+            assertEquals(Long.valueOf(6 * memory.getIteration()), memory.get("a"));
+            assertEquals(Long.valueOf(0), memory.get("b"));
+            if (memory.isInitialIteration()) {
+                assertTrue(memory.get("c"));
+                assertFalse(memory.get("d"));
+            } else {
+                assertFalse(memory.get("c"));
+                assertTrue(memory.get("d"));
+            }
+            assertTrue(memory.get("e"));
+        }
+
+        @Override
+        public boolean terminate(Memory memory) {
+            assertEquals(Long.valueOf(6 * (memory.getIteration() + 1)), memory.get("a"));
+            assertEquals(Long.valueOf(6), memory.get("b"));
+            assertFalse(memory.get("c"));
+            assertTrue(memory.get("d"));
+            assertFalse(memory.get("e"));
+            memory.set("b", 0l);
+            memory.set("e", true);
+            return memory.getIteration() > 1;
+        }
+
+        @Override
+        public Set<String> getElementComputeKeys() {
+            return null;
+        }
+
+        @Override
+        public Set<String> getMemoryComputeKeys() {
+            return new HashSet<>(Arrays.asList("a", "b", "c", "d", "e"));
+        }
+
+        @Override
+        public Set<MessageScope> getMessageScopes(Memory memory) {
+            return Collections.emptySet();
+        }
+
+        @Override
+        public GraphComputer.ResultGraph getPreferredResultGraph() {
+            return GraphComputer.ResultGraph.NEW;
+        }
+
+        @Override
+        public GraphComputer.Persist getPreferredPersist() {
+            return GraphComputer.Persist.NOTHING;
+        }
+    }
+    /////////////////////////////////////////////
+
+    /////////////////////////////////////////////
     @Test
     @LoadGraphWith(MODERN)
     public void shouldAllowMapReduceWithNoVertexProgram() throws Exception {
-        final ComputerResult results = get_g_compute_mapXageX_reduceXsumX_memoryXnextX_memoryKeyXageSumX().submit().get();
+        final ComputerResult results = graph.compute(graphComputerClass.get()).mapReduce(new MapReduceA()).submit().get();
         assertEquals(123, results.memory().<Integer>get("ageSum").intValue());
     }
 
+    private static class MapReduceA extends StaticMapReduce<MapReduce.NullObject, Integer, MapReduce.NullObject, Integer, Integer> {
+
+        @Override
+        public boolean doStage(final Stage stage) {
+            return stage.equals(Stage.MAP) || stage.equals(Stage.REDUCE);
+        }
+
+        @Override
+        public void map(final Vertex vertex, final MapEmitter<NullObject, Integer> emitter) {
+            vertex.<Integer>property("age").ifPresent(emitter::emit);
+        }
+
+        @Override
+        public void reduce(NullObject key, Iterator<Integer> values, ReduceEmitter<NullObject, Integer> emitter) {
+            emitter.emit(StreamFactory.stream(values).mapToInt(i -> i).sum());
+        }
+
+        @Override
+        public Integer generateFinalResult(Iterator<KeyValue<NullObject, Integer>> keyValues) {
+            return keyValues.next().getValue();
+        }
+
+        @Override
+        public String getMemoryKey() {
+            return "ageSum";
+        }
+    }
+    /////////////////////////////////////////////
+
     @Test
     @LoadGraphWith(MODERN)
     public void shouldSupportMultipleMapReduceJobs() throws Exception {
-        final ComputerResult results = get_g_compute_executeXcounterX_terminateX8X_mapreduceXcounter_aX_mapreduceXcounter_bX().submit().get();
+        final ComputerResult results = graph.compute(graphComputerClass.get())
+                .program(new VertexProgramH())
+                .mapReduce(new MapReduceH1())
+                .mapReduce(new MapReduceH2()).submit().get();
         assertEquals(60, results.memory().<Integer>get("a").intValue());
         assertEquals(1, results.memory().<Integer>get("b").intValue());
     }
 
-    @Test
-    @LoadGraphWith(MODERN)
-    public void shouldSortReduceOutput() throws Exception {
-        final ComputerResult results = get_g_compute_mapXidX_reduceXidX_reduceKeySortXreverseX_memoryKeyXidsX().submit().get();
-        final List<Long> ids = results.memory().get("ids");
-        assertEquals(6, ids.size());
-        for (int i = 1; i < ids.size(); i++) {
-            assertTrue(ids.get(i) < ids.get(i - 1));
+    public static class VertexProgramH extends StaticVertexProgram {
+
+        @Override
+        public void setup(final Memory memory) {
+
         }
-    }
 
-    @Test
-    @Ignore("Because of Graph.engine()")
-    @LoadGraphWith(MODERN)
-    public void shouldSupportStringTraversalVertexProgramExecution() throws Exception {
-        final ComputerResult result = get_g_compute_programXTraversalVertexProgram_build_traversalXg_V_both_hasXlabel_personX_age_groupCountXaXX_create().submit().get();
-        final Map<Integer, Long> map = result.memory().get("a");
-        assertEquals(4, map.size());
-        assertEquals(3, map.get(32).intValue());
-        assertEquals(1, map.get(35).intValue());
-        assertEquals(1, map.get(27).intValue());
-        assertEquals(3, map.get(29).intValue());
-    }
+        @Override
+        public void execute(Vertex vertex, Messenger messenger, Memory memory) {
+            vertex.property(VertexProperty.Cardinality.single, "counter", memory.isInitialIteration() ? 1 : vertex.<Integer>value("counter") + 1);
+        }
 
-    @Test
-    @LoadGraphWith(MODERN)
-    public void shouldNotAllowEdgeAccessInMapReduce() throws Exception {
-        try {
-            get_g_compute_mapXoutE_countX_reduceXsumX().submit().get();
-            fail("Should not allow incident edges to be accessed in MapReduce");
-        } catch (Exception ex) {
-            // ex.printStackTrace();
+        @Override
+        public boolean terminate(final Memory memory) {
+            return memory.getIteration() > 8;
         }
-    }
 
+        @Override
+        public Set<String> getElementComputeKeys() {
+            return new HashSet<>(Arrays.asList("counter"));
+        }
 
-    @UseEngine(TraversalEngine.Type.COMPUTER)
-    public static class ComputerTest extends GraphComputerTest {
         @Override
-        public GraphComputer get_g_compute() {
-            return graph.compute();
+        public Set<String> getMemoryComputeKeys() {
+            return Collections.emptySet();
         }
 
         @Override
-        public GraphComputer get_g_compute_setupXX_executeXX_terminateXtrueX() {
-            return graph.compute().program(LambdaVertexProgram.build().create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_setupXX_executeXX_terminateXtrueX_memoryKeysXset_incr_and_orX() {
-            return graph.compute().program(LambdaVertexProgram.build().memoryComputeKeys("set", "incr", "and", "or").create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_setupXX_executeXX_terminateXtrueX_memoryKeysXnullX() {
-            return graph.compute().program(LambdaVertexProgram.build().memoryComputeKeys(new HashSet<String>() {{
-                add(null);
-            }}).create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_setupXX_executeXX_terminateXtrueX_memoryKeysX_X() {
-            return graph.compute().program(LambdaVertexProgram.build().memoryComputeKeys("").create());
+        public Set<MessageScope> getMessageScopes(Memory memory) {
+            return Collections.emptySet();
         }
 
         @Override
-        public GraphComputer get_g_compute_setupXsetXa_trueXX_executeXX_terminateXtrueX() {
-            return graph.compute().program(LambdaVertexProgram.build().setup(m -> m.set("a", true)).create());
+        public GraphComputer.ResultGraph getPreferredResultGraph() {
+            return GraphComputer.ResultGraph.NEW;
         }
-
-        @Override
-        public GraphComputer get_g_compute_setupXX_executeXv_blah_m_incrX_terminateX1X_elementKeysXnameLengthCounterX_memoryKeysXa_bX() {
-            return graph.compute().program(LambdaVertexProgram.build().
-                    setup(memory -> {
-                    }).
-                    execute((vertex, messenger, memory) -> {
-                        // TODO: Implement wrapper for GiraphGraph internal TinkerVertex
-                        try {
-                            vertex.property("blah", "blah");
-                            fail("Should throw an IllegalArgumentException");
-                        } catch (IllegalArgumentException e) {
-                            assertEquals(GraphComputer.Exceptions.providedKeyIsNotAnElementComputeKey("blah").getMessage(), e.getMessage());
-                        } catch (Exception e) {
-                            fail("Should throw an IllegalArgumentException: " + e);
-                        }
-
-                        memory.incr("a", 1);
-                        if (memory.isInitialIteration()) {
-                            vertex.property("nameLengthCounter", vertex.<String>value("name").length());
-                            memory.incr("b", vertex.<String>value("name").length());
-                        } else {
-                            vertex.property(VertexProperty.Cardinality.single, "nameLengthCounter", vertex.<String>value("name").length() + vertex.<Integer>value("nameLengthCounter"));
-                        }
-                    }).
-                    terminate(memory -> memory.getIteration() == 1).
-                    elementComputeKeys("nameLengthCounter").
-                    memoryComputeKeys("a", "b").create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_setupXabcdeX_executeXtestMemoryX_terminateXtestMemoryXmemoryKeysXabcdeX() {
-            return graph.compute().program(LambdaVertexProgram.build().
-                    setup(memory -> {
-                        memory.set("a", 0l);
-                        memory.set("b", 0l);
-                        memory.set("c", true);
-                        memory.set("d", false);
-                        memory.set("e", true);
-                    }).
-                    execute((vertex, messenger, memory) -> {
-                        // test current step values
-                        assertEquals(Long.valueOf(6 * memory.getIteration()), memory.get("a"));
-                        assertEquals(Long.valueOf(0), memory.get("b"));
-                        if (memory.isInitialIteration()) {
-                            assertTrue(memory.get("c"));
-                            assertFalse(memory.get("d"));
-                        } else {
-                            assertFalse(memory.get("c"));
-                            assertTrue(memory.get("d"));
-                        }
-                        assertTrue(memory.get("e"));
-
-                        // update current step values
-                        memory.incr("a", 1l);
-                        memory.incr("b", 1l);
-                        memory.and("c", false);
-                        memory.or("d", true);
-                        memory.and("e", false);
-
-                        // test current step values, should be the same as previous prior to update
-                        assertEquals(Long.valueOf(6 * memory.getIteration()), memory.get("a"));
-                        assertEquals(Long.valueOf(0), memory.get("b"));
-                        if (memory.isInitialIteration()) {
-                            assertTrue(memory.get("c"));
-                            assertFalse(memory.get("d"));
-                        } else {
-                            assertFalse(memory.get("c"));
-                            assertTrue(memory.get("d"));
-                        }
-                        assertTrue(memory.get("e"));
-                    }).
-                    terminate(memory -> {
-                        assertEquals(Long.valueOf(6 * (memory.getIteration() + 1)), memory.get("a"));
-                        assertEquals(Long.valueOf(6), memory.get("b"));
-                        assertFalse(memory.get("c"));
-                        assertTrue(memory.get("d"));
-                        assertFalse(memory.get("e"));
-                        memory.set("b", 0l);
-                        memory.set("e", true);
-                        return memory.getIteration() > 1;
-                    }).
-                    memoryComputeKeys("a", "b", "c", "d", "e").create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_mapXageX_reduceXsumX_memoryXnextX_memoryKeyXageSumX() {
-            return graph.compute().mapReduce(LambdaMapReduce.<MapReduce.NullObject, Integer, MapReduce.NullObject, Integer, Integer>build()
-                    .map((v, e) -> v.<Integer>property("age").ifPresent(age -> e.emit(MapReduce.NullObject.instance(), age)))
-                    .reduce((k, vv, e) -> e.emit(StreamFactory.stream(vv).mapToInt(i -> i).sum()))
-                    .memory(i -> i.next().getValue())
-                    .memoryKey("ageSum").create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_executeXcounterX_terminateX8X_mapreduceXcounter_aX_mapreduceXcounter_bX() {
-            return graph.compute().program(LambdaVertexProgram.build()
-                    .execute((vertex, messenger, memory) -> {
-                        vertex.property(VertexProperty.Cardinality.single, "counter", memory.isInitialIteration() ? 1 : vertex.<Integer>value("counter") + 1);
-                    })
-                    .terminate(memory -> memory.getIteration() > 8)
-                    .elementComputeKeys(new HashSet<>(Arrays.asList("counter"))).create())
-                    .mapReduce(LambdaMapReduce.<MapReduce.NullObject, Integer, MapReduce.NullObject, Integer, Integer>build()
-                            .map((v, e) -> e.emit(v.value("counter")))
-                            .reduce((k, vv, e) -> {
-                                int counter = 0;
-                                while (vv.hasNext()) {
-                                    counter = counter + vv.next();
-                                }
-                                e.emit(MapReduce.NullObject.instance(), counter);
-
-                            })
-                            .memory(i -> i.next().getValue())
-                            .memoryKey("a").create())
-                    .mapReduce(LambdaMapReduce.<MapReduce.NullObject, Integer, MapReduce.NullObject, Integer, Integer>build()
-                            .map((v, e) -> e.emit(MapReduce.NullObject.instance(), v.value("counter")))
-                            .combine((k, vv, e) -> e.emit(1))
-                            .reduce((k, vv, e) -> e.emit(1))
-                            .memory(i -> i.next().getValue())
-                            .memoryKey("b").create());
-
-        }
-
-        @Override
-        public GraphComputer get_g_compute_mapXidX_reduceXidX_reduceKeySortXreverseX_memoryKeyXidsX() {
-            return graph.compute().mapReduce(LambdaMapReduce.<Long, Long, Long, Long, List<Long>>build()
-                    .map((vertex, emitter) -> emitter.emit(Long.valueOf(vertex.id().toString()), Long.valueOf(vertex.id().toString())))
-                    .reduce((key, values, emitter) -> values.forEachRemaining(id -> emitter.emit(id, id)))
-                    .memoryKey("ids")
-                    .reduceKeySort(Comparator::reverseOrder)
-                    .memory(itty -> {
-                        final List<Long> list = new ArrayList<>();
-                        itty.forEachRemaining(id -> list.add(id.getKey()));
-                        return list;
-                    })
-                    .create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_programXTraversalVertexProgram_build_traversalXg_V_both_hasXlabel_personX_age_groupCountXaXX_create() {
-            /*return graph.compute().program(TraversalVertexProgram.build().
-                    // TODO: need to set the engine to be computer
-                            traversal("GraphFactory.open(['gremlin.graph':'" + g.getClass().getCanonicalName() + "']).V().both().has(label,'person').values('age').groupCount('a')").
-                    create()); */
-            return null;
+
+        @Override
+        public GraphComputer.Persist getPreferredPersist() {
+            return GraphComputer.Persist.NOTHING;
         }
+    }
+
+    private static class MapReduceH1 extends StaticMapReduce<MapReduce.NullObject, Integer, MapReduce.NullObject, Integer, Integer> {
 
         @Override
-        public GraphComputer get_g_compute_mapXoutE_countX_reduceXsumX() {
-            return null;
+        public boolean doStage(final Stage stage) {
+            return stage.equals(Stage.MAP) || stage.equals(Stage.REDUCE);
         }
 
+        @Override
+        public void map(final Vertex vertex, final MapEmitter<NullObject, Integer> emitter) {
+            vertex.<Integer>property("counter").ifPresent(emitter::emit);
+        }
+
+        @Override
+        public void reduce(NullObject key, Iterator<Integer> values, ReduceEmitter<NullObject, Integer> emitter) {
+            emitter.emit(StreamFactory.stream(values).mapToInt(i -> i).sum());
+        }
+
+        @Override
+        public Integer generateFinalResult(Iterator<KeyValue<NullObject, Integer>> keyValues) {
+            return keyValues.next().getValue();
+        }
+
+        @Override
+        public String getMemoryKey() {
+            return "a";
+        }
     }
 
+    private static class MapReduceH2 extends StaticMapReduce<Integer, Integer, Integer, Integer, Integer> {
+
+        @Override
+        public boolean doStage(final Stage stage) {
+            return true;
+        }
+
+        @Override
+        public void map(final Vertex vertex, final MapEmitter<Integer, Integer> emitter) {
+            vertex.<Integer>property("age").ifPresent(age -> emitter.emit(age,age));
+        }
+
+        @Override
+        public void combine(Integer key, Iterator<Integer> values, ReduceEmitter<Integer, Integer> emitter) {
+            values.forEachRemaining(i -> emitter.emit(i, 1));
+        }
+
+        @Override
+        public void reduce(Integer key, Iterator<Integer> values, ReduceEmitter<Integer, Integer> emitter) {
+            values.forEachRemaining(i -> emitter.emit(i, 1));
+        }
 
+        @Override
+        public Integer generateFinalResult(Iterator<KeyValue<Integer, Integer>> keyValues) {
+            return keyValues.next().getValue();
+        }
 
+        @Override
+        public String getMemoryKey() {
+            return "b";
+        }
+    }
+    /////////////////////////////////////////////
 
-   /*
+    /////////////////////////////////////////////
     @Test
     @LoadGraphWith(MODERN)
-    @FeatureRequirement(featureClass = Graph.Features.GraphFeatures.class, feature = Graph.Features.GraphFeatures.FEATURE_COMPUTER)
-    public void shouldSupportVertexProperties() throws Exception {
-        GraphComputer computer = g.compute();
-        ComputerResult results = computer.program(LambdaVertexProgram.build().
-                execute((vertex, messenger, memory) -> {
-
-                    if (memory.getIteration() == 0) {
-                        assertEquals(VertexProperty.empty(), vertex.property("a"));
-                        assertEquals(VertexProperty.empty(), vertex.property("b"));
-                        assertFalse(vertex.property("a").isPresent());
-                        assertFalse(vertex.property("b").isPresent());
-                    } else if (memory.getIteration() == 1) {
-                        assertEquals(1, vertex.property("a").value());
-                        assertEquals(1, vertex.property("b").value());
-                    } else if (memory.getIteration() == 2) {
-                        assertEquals(2, vertex.properties("a").count().next().intValue());
-                        assertEquals(1, vertex.properties("a").has(T.value, 1).count().next().intValue());
-                        assertEquals(1, vertex.properties("a").has(T.value, 2).count().next().intValue());
-                        assertEquals(2, vertex.property("b").value());
-                    } else if (memory.getIteration() == 3) {
-                        assertEquals(3, vertex.properties("a").count().next().intValue());
-                        assertEquals(1, vertex.properties("a").has(T.value, 1).count().next().intValue());
-                        assertEquals(2, vertex.properties("a").has(T.value, 2).count().next().intValue());
-                        assertEquals(2, vertex.property("b").value());
-                    } else {
-                        fail("There should not be more than 3 iterations in this vertex program");
-                    }
-
-                    ///////////////////////////
-
-
-                    if (memory.isInitialIteration()) {
-                        vertex.property("a", 1);
-                        vertex.property("b", 1);
-                    } else {
-                        vertex.property("a", 2);
-                        vertex.property(single, ("b", 2);
-                        try {
-                            vertex.property("a");
-                            fail("Should fail with IllegalStateException");
-                        } catch (IllegalStateException e) {
-                            assertEquals(Vertex.Exceptions.multiplePropertiesExistForProvidedKey("a").getMessage(), e.getMessage());
-                        } catch (Exception e) {
-                            fail("Should fail with IllegalStateException");
-                        }
-                        vertex.property("b");
-                    }
-
-
-                    ///////////////////////////
-
-                    if (memory.getIteration() == 0) {
-                        assertEquals(1, vertex.properties("a").count().next().intValue());
-                        assertEquals(1, vertex.property("a").value());
-                        assertEquals(1, vertex.property("b").value());
-                    } else if (memory.getIteration() == 1) {
-                        assertEquals(2, vertex.properties("a").count().next().intValue());
-                        assertEquals(1, vertex.properties("a").has(T.value, 1).count().next().intValue());
-                        assertEquals(1, vertex.properties("a").has(T.value, 2).count().next().intValue());
-                        assertEquals(2, vertex.property("b").value());
-                    } else if (memory.getIteration() == 2) {
-                        assertEquals(3, vertex.properties("a").count().next().intValue());
-                        assertEquals(1, vertex.properties("a").has(T.value, 1).count().next().intValue());
-                        assertEquals(2, vertex.properties("a").has(T.value, 2).count().next().intValue());
-                        assertEquals(2, vertex.property("b").value());
-                    } else if (memory.getIteration() == 3) {
-                        assertEquals(4, vertex.properties("a").count().next().intValue());
-                        assertEquals(1, vertex.properties("a").has(T.value, 1).count().next().intValue());
-                        assertEquals(3, vertex.properties("a").has(T.value, 2).count().next().intValue());
-                        assertEquals(2, vertex.property("b").value());
-                    } else {
-                        fail("There should not be more than 3 iterators in this vertex program");
-                    }
-
-                }).
-                terminate(memory -> memory.getIteration() > 2).
-                elementComputeKeys(new HashSet<>(Arrays.asList("a", "b"))).create())
-                .submit().get();
-        assertEquals(3, results.getMemory().getIteration());
-        final Vertex vertex = results.getGraph().V().next();
-        assertEquals(2, vertex.property("b").value());
-        assertEquals(4, vertex.properties("a").count().next().intValue());
-        assertEquals(1, vertex.properties("a").has(T.value, 1).count().next().intValue());
-        assertEquals(3, vertex.properties("a").has(T.value, 2).count().next().intValue());
-        assertEquals(1, vertex.properties("b").count().next().intValue());
-    }*/
-
-    class BadGraphComputer implements GraphComputer {
+    public void shouldSortReduceOutput() throws Exception {
+        final ComputerResult results = graph.compute(graphComputerClass.get()).mapReduce(new MapReduceB()).submit().get();
+        final List<Long> ids = results.memory().get("ids");
+        assertEquals(6, ids.size());
+        for (int i = 1; i < ids.size(); i++) {
+            assertTrue(ids.get(i) < ids.get(i - 1));
+        }
+    }
+
+    public static class MapReduceB extends StaticMapReduce<Long, Long, Long, Long, List<Long>> {
+
         @Override
-        public GraphComputer isolation(final Isolation isolation) {
-            return null;
+        public boolean doStage(final Stage stage) {
+            return stage.equals(Stage.REDUCE) || stage.equals(Stage.MAP);
         }
 
         @Override
-        public GraphComputer result(final ResultGraph resultGraph) {
-            return null;
+        public void map(final Vertex vertex, final MapEmitter<Long, Long> emitter) {
+            emitter.emit(Long.valueOf(vertex.id().toString()), Long.valueOf(vertex.id().toString()));
         }
 
         @Override
-        public GraphComputer persist(final Persist persist) {
-            return null;
+        public void reduce(Long key, Iterator<Long> values, ReduceEmitter<Long, Long> emitter) {
+            values.forEachRemaining(id -> emitter.emit(id, id));
         }
 
         @Override
-        public GraphComputer program(final VertexProgram vertexProgram) {
-            return null;
+        public Optional<Comparator<Long>> getReduceKeySort() {
+            return Optional.of(Comparator.<Long>reverseOrder());
         }
 
         @Override
-        public GraphComputer mapReduce(final MapReduce mapReduce) {
-            return null;
+        public String getMemoryKey() {
+            return "ids";
         }
 
         @Override
-        public Future<ComputerResult> submit() {
-            return null;
+        public List<Long> generateFinalResult(final Iterator<KeyValue<Long, Long>> keyValues) {
+            final List<Long> list = new ArrayList<>();
+            keyValues.forEachRemaining(id -> list.add(id.getKey()));
+            return list;
         }
+    }
+    /////////////////////////////////////////////
+
+    @Test
+    @Ignore("Because of Graph.engine()")
+    @LoadGraphWith(MODERN)
+    public void shouldSupportStringTraversalVertexProgramExecution() throws Exception {
+
+    }
+
+    @Test
+    @Ignore
+    @LoadGraphWith(MODERN)
+    public void shouldNotAllowEdgeAccessInMapReduce() throws Exception {
 
     }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4435485b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphComputeVertex.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphComputeVertex.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphComputeVertex.java
index 3cd32d5..5e0ee42 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphComputeVertex.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphComputeVertex.java
@@ -55,12 +55,12 @@ public final class GiraphComputeVertex extends Vertex<ObjectWritable, VertexWrit
         final org.apache.tinkerpop.gremlin.structure.Vertex wrappedVertex = ComputerGraph.of(this.getValue().get(), vertexProgram.getElementComputeKeys());
         ///////////
         if (!(Boolean) ((RuleWritable) this.getAggregatedValue(Constants.GREMLIN_HADOOP_HALT)).getObject()) {
-            vertexProgram.execute(wrappedVertex, messenger, memory);  // TODO provide a wrapper around TinkerVertex for Edge and non-ComputeKeys manipulation
+            vertexProgram.execute(wrappedVertex, messenger, memory);
         } else if (workerContext.deriveMemory()) {
             final MapMemory mapMemory = new MapMemory();
             memory.asMap().forEach(mapMemory::set);
             mapMemory.setIteration(memory.getIteration() - 1);
-            wrappedVertex.property(VertexProperty.Cardinality.single, Constants.GREMLIN_HADOOP_MAP_MEMORY, mapMemory);  // TODO: this is a "computer key"
+            this.getValue().get().property(VertexProperty.Cardinality.single, Constants.GREMLIN_HADOOP_MAP_MEMORY, mapMemory);  // TODO: this is a "computer key"
         }
         workerContext.getVertexProgramPool().offer(vertexProgram);
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4435485b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphMemory.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphMemory.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphMemory.java
index 07cdc51..eaac36f 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphMemory.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/giraph/GiraphMemory.java
@@ -37,7 +37,7 @@ import java.util.Set;
  */
 public class GiraphMemory extends MasterCompute implements Memory {
 
-    private VertexProgram vertexProgram;
+    private VertexProgram<?> vertexProgram;
     private GiraphWorkerContext worker;
     private Set<String> memoryKeys;
     private boolean isMasterCompute = true;
@@ -46,10 +46,10 @@ public class GiraphMemory extends MasterCompute implements Memory {
         // Giraph ReflectionUtils requires this to be public at minimum
     }
 
-    public GiraphMemory(final GiraphWorkerContext worker, final VertexProgram vertexProgram) {
+    public GiraphMemory(final GiraphWorkerContext worker, final VertexProgram<?> vertexProgram) {
         this.worker = worker;
         this.vertexProgram = vertexProgram;
-        this.memoryKeys = new HashSet<String>(this.vertexProgram.getMemoryComputeKeys());
+        this.memoryKeys = new HashSet<>(this.vertexProgram.getMemoryComputeKeys());
         this.isMasterCompute = false;
     }
 
@@ -65,7 +65,7 @@ public class GiraphMemory extends MasterCompute implements Memory {
         this.isMasterCompute = true;
         if (0 == this.getSuperstep()) { // setup
             this.vertexProgram = VertexProgram.createVertexProgram(ConfUtil.makeApacheConfiguration(this.getConf()));
-            this.memoryKeys = new HashSet<String>(this.vertexProgram.getMemoryComputeKeys());
+            this.memoryKeys = new HashSet<>(this.vertexProgram.getMemoryComputeKeys());
             try {
                 for (final String key : this.memoryKeys) {
                     MemoryHelper.validateKey(key);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4435485b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java
index 5413f2b..5355e33 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java
@@ -100,17 +100,17 @@ import java.util.Optional;
         method = "g_V_repeatXoutX_timesX8X_count",
         reason = "Hadoop-Gremlin is OLAP-oriented and for OLTP operations, linear-scan joins are required. This particular tests takes many minutes to execute.")
 @Graph.OptOut(
-        test = "org.apache.tinkerpop.gremlin.process.computer.GroovyGraphComputerTest$ComputerTraversals",
+        test = "org.apache.tinkerpop.gremlin.process.computer.GraphComputerTest",
         method = "shouldNotAllowNullMemoryKeys",
-        reason = "Hadoop does a hard kill on failure and stops threads which stops test cases. Exception handling semantics are correct though.")
+        reason = "Giraph does a hard kill on failure and stops threads which stops test cases. Exception handling semantics are correct though.")
 @Graph.OptOut(
-        test = "org.apache.tinkerpop.gremlin.process.computer.GroovyGraphComputerTest$ComputerTraversals",
+        test = "org.apache.tinkerpop.gremlin.process.computer.GraphComputerTest",
         method = "shouldNotAllowSettingUndeclaredMemoryKeys",
-        reason = "Hadoop does a hard kill on failure and stops threads which stops test cases. Exception handling semantics are correct though.")
+        reason = "Giraph does a hard kill on failure and stops threads which stops test cases. Exception handling semantics are correct though.")
 @Graph.OptOut(
-        test = "org.apache.tinkerpop.gremlin.process.computer.GroovyGraphComputerTest$ComputerTraversals",
+        test = "org.apache.tinkerpop.gremlin.process.computer.GraphComputerTest",
         method = "shouldHaveConsistentMemoryVertexPropertiesAndExceptions",
-        reason = "Hadoop does a hard kill on failure and stops threads which stops test cases. Exception handling semantics are correct though.")
+        reason = "Giraph does a hard kill on failure and stops threads which stops test cases. Exception handling semantics are correct though.")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.ProfileTest$Traversals",
         method = "g_V_out_out_grateful_profile",


[2/2] incubator-tinkerpop git commit: Removed LambdaVertexProgram and LambdaMapReduce as it is one less thing to maintain. Rewrote GraphComputerTest so its ONLY for Java8 and is much easier to extend now that it no longer uses LambdaXXX.

Posted by ok...@apache.org.
Removed LambdaVertexProgram and LambdaMapReduce as it is one less thing to maintain. Rewrote GraphComputerTest so its ONLY for Java8 and is much easier to extend now that it no longer uses LambdaXXX.


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

Branch: refs/heads/master
Commit: 4435485b62d7c5a154bd96f7d68740f48e061611
Parents: 92ce07d
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Mar 31 10:42:42 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Mar 31 10:43:00 2015 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   2 +
 .../computer/lambda/LambdaMapReduce.java        | 290 ------
 .../computer/lambda/LambdaVertexProgram.java    | 254 ------
 .../process/computer/util/ComputerGraph.java    |   6 +
 .../computer/util/VertexProgramPool.java        |   2 +-
 .../computer/GroovyGraphComputerTest.groovy     | 228 -----
 .../process/GroovyProcessComputerSuite.java     |   3 -
 .../AbstractImportCustomizerProvider.java       |  12 +-
 .../tinkerpop/gremlin/AbstractGremlinTest.java  |   4 +
 .../gremlin/process/ProcessComputerSuite.java   |   4 +
 .../process/computer/GraphComputerTest.java     | 890 +++++++++++--------
 .../computer/giraph/GiraphComputeVertex.java    |   4 +-
 .../process/computer/giraph/GiraphMemory.java   |   8 +-
 .../gremlin/hadoop/structure/HadoopGraph.java   |  12 +-
 14 files changed, 577 insertions(+), 1142 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4435485b/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index b55f219..8e17241 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,6 +25,8 @@ image::http://www.tinkerpop.com/docs/current/images/gremlin-hindu.png[width=225]
 TinkerPop 3.0.0.M8 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* `GraphComputerTest` is now Java8 specific and much easier to extend with new test cases.
+* Removed `LambdaVertexProgram` and `LambdaMapReduce` as it will be one less thing to maintain.
 * Gremlin Console accepts a `max-iteration` configuration via the standard `:set` command to limit result iteration.
 * `Vertex.property()` default behavior is now `Cardinality.single`.
 * Added `ElementIdStrategy` as a `TraversalStrategy`.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4435485b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/lambda/LambdaMapReduce.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/lambda/LambdaMapReduce.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/lambda/LambdaMapReduce.java
deleted file mode 100644
index 5c35656..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/lambda/LambdaMapReduce.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * 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.computer.lambda;
-
-import org.apache.tinkerpop.gremlin.process.computer.KeyValue;
-import org.apache.tinkerpop.gremlin.process.computer.MapReduce;
-import org.apache.tinkerpop.gremlin.process.computer.util.AbstractVertexProgramBuilder;
-import org.apache.tinkerpop.gremlin.process.computer.util.LambdaHolder;
-import org.apache.tinkerpop.gremlin.process.computer.util.StaticMapReduce;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.apache.tinkerpop.gremlin.util.function.TriConsumer;
-import org.apache.commons.configuration.BaseConfiguration;
-import org.apache.commons.configuration.Configuration;
-
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.Optional;
-import java.util.function.BiConsumer;
-import java.util.function.Function;
-import java.util.function.Supplier;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public class LambdaMapReduce<MK, MV, RK, RV, R> extends StaticMapReduce<MK, MV, RK, RV, R> {
-
-    public static final String MAP_LAMBDA = "gremlin.lambdaMapReduce.mapLambda";
-    public static final String MAP_KEY_SORT = "gremlin.lambdaMapReduce.mapKeySort";
-    public static final String COMBINE_LAMBDA = "gremlin.lambdaMapReduce.combineLambda";
-    public static final String REDUCE_LAMBDA = "gremlin.lambdaMapReduce.reduceLambda";
-    public static final String REDUCE_KEY_SORT = "gremlin.lambdaMapReduce.reduceKeySort";
-    public static final String MEMORY_LAMBDA = "gremlin.lambdaMapReduce.memoryLambda";
-    public static final String MEMORY_KEY = "gremlin.lambdaMapReduce.memoryKey";
-
-    private LambdaHolder<BiConsumer<Vertex, MapEmitter<MK, MV>>> mapLambdaHolder;
-    private LambdaHolder<Supplier<Comparator<MK>>> mapKeySortLambdaHolder;
-    private LambdaHolder<TriConsumer<MK, Iterator<MV>, ReduceEmitter<RK, RV>>> combineLambdaHolder;
-    private LambdaHolder<TriConsumer<MK, Iterator<MV>, ReduceEmitter<RK, RV>>> reduceLambdaHolder;
-    private LambdaHolder<Supplier<Comparator<RK>>> reduceKeySortLambdaHolder;
-    private LambdaHolder<Function<Iterator<KeyValue<RK, RV>>, R>> memoryLambdaHolder;
-    private String memoryKey;
-
-    private LambdaMapReduce() {
-
-    }
-
-    @Override
-    public void loadState(final Configuration configuration) {
-        this.mapLambdaHolder = LambdaHolder.loadState(configuration, MAP_LAMBDA);
-        this.mapKeySortLambdaHolder = LambdaHolder.loadState(configuration, MAP_KEY_SORT);
-        this.combineLambdaHolder = LambdaHolder.loadState(configuration, COMBINE_LAMBDA);
-        this.reduceLambdaHolder = LambdaHolder.loadState(configuration, REDUCE_LAMBDA);
-        this.reduceKeySortLambdaHolder = LambdaHolder.loadState(configuration, REDUCE_KEY_SORT);
-        this.memoryLambdaHolder = LambdaHolder.loadState(configuration, MEMORY_LAMBDA);
-        this.memoryKey = configuration.getString(MEMORY_KEY, null);
-    }
-
-    @Override
-    public void storeState(final Configuration configuration) {
-        super.storeState(configuration);
-        if (null != this.mapLambdaHolder)
-            this.mapLambdaHolder.storeState(configuration);
-        if (null != this.mapKeySortLambdaHolder)
-            this.mapKeySortLambdaHolder.storeState(configuration);
-        if (null != this.combineLambdaHolder)
-            this.combineLambdaHolder.storeState(configuration);
-        if (null != this.reduceLambdaHolder)
-            this.reduceLambdaHolder.storeState(configuration);
-        if (null != this.reduceKeySortLambdaHolder)
-            this.reduceKeySortLambdaHolder.storeState(configuration);
-        if (null != this.memoryLambdaHolder)
-            this.memoryLambdaHolder.storeState(configuration);
-        configuration.setProperty(MEMORY_KEY, this.memoryKey);
-    }
-
-    @Override
-    public boolean doStage(final Stage stage) {
-        if (stage.equals(Stage.MAP))
-            return null != this.mapLambdaHolder;
-        else if (stage.equals(Stage.COMBINE))
-            return null != this.combineLambdaHolder;
-        else
-            return null != this.reduceLambdaHolder;
-    }
-
-    @Override
-    public void map(final Vertex vertex, final MapEmitter<MK, MV> emitter) {
-        this.mapLambdaHolder.get().accept(vertex, emitter);
-    }
-
-    @Override
-    public void combine(final MK key, final Iterator<MV> values, final ReduceEmitter<RK, RV> emitter) {
-        this.combineLambdaHolder.get().accept(key, values, emitter);
-    }
-
-    @Override
-    public void reduce(final MK key, final Iterator<MV> values, final ReduceEmitter<RK, RV> emitter) {
-        this.reduceLambdaHolder.get().accept(key, values, emitter);
-    }
-
-    @Override
-    public Optional<Comparator<MK>> getMapKeySort() {
-        return null == this.mapKeySortLambdaHolder ? Optional.empty() : Optional.of(this.mapKeySortLambdaHolder.get().get());
-    }
-
-    @Override
-    public Optional<Comparator<RK>> getReduceKeySort() {
-        return null == this.reduceKeySortLambdaHolder ? Optional.empty() : Optional.of(this.reduceKeySortLambdaHolder.get().get());
-    }
-
-    @Override
-    public R generateFinalResult(final Iterator<KeyValue<RK, RV>> keyValues) {
-        return null == this.memoryLambdaHolder ? (R) keyValues : this.memoryLambdaHolder.get().apply(keyValues);
-    }
-
-    @Override
-    public String getMemoryKey() {
-        return this.memoryKey;
-    }
-
-    @Override
-    public String toString() {
-        return StringFactory.mapReduceString(this, this.memoryKey);
-    }
-
-    //////////////////
-
-    public static <MK, MV, RK, RV, R> Builder<MK, MV, RK, RV, R> build() {
-        return new Builder<>();
-    }
-
-    public static class Builder<MK, MV, RK, RV, R> {
-
-        private final Configuration configuration = new BaseConfiguration();
-
-        public Builder<MK, MV, RK, RV, R> map(final BiConsumer<Vertex, MapReduce.MapEmitter<MK, MV>> mapLambda) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.OBJECT, MAP_LAMBDA, mapLambda);
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> map(final Class<? extends BiConsumer<Vertex, MapReduce.MapEmitter<MK, MV>>> mapClass) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.SCRIPT, MAP_LAMBDA, mapClass);
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> map(final String scriptEngine, final String mapScript) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.SCRIPT, MAP_LAMBDA, new String[]{scriptEngine, mapScript});
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> map(final String setupScript) {
-            return map(AbstractVertexProgramBuilder.GREMLIN_GROOVY, setupScript);
-        }
-
-        //
-
-        public Builder<MK, MV, RK, RV, R> mapKeySort(final Comparator<MK> comparator) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.OBJECT, MAP_KEY_SORT, comparator);
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> mapKeySort(final Class<? extends Comparator<MK>> comparatorClass) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.CLASS, MAP_KEY_SORT, comparatorClass);
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> mapKeySort(final String scriptEngine, final String reduceScript) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.SCRIPT, MAP_KEY_SORT, new String[]{scriptEngine, reduceScript});
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> mapKeySort(final String setupScript) {
-            return mapKeySort(AbstractVertexProgramBuilder.GREMLIN_GROOVY, setupScript);
-        }
-
-        ////////////
-
-        public Builder<MK, MV, RK, RV, R> combine(TriConsumer<MK, Iterator<MV>, MapReduce.ReduceEmitter<RK, RV>> combineLambda) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.OBJECT, COMBINE_LAMBDA, combineLambda);
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> combine(final Class<? extends TriConsumer<MK, Iterator<MV>, MapReduce.ReduceEmitter<RK, RV>>> combineClass) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.CLASS, COMBINE_LAMBDA, combineClass);
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> combine(final String scriptEngine, final String combineScript) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.SCRIPT, COMBINE_LAMBDA, new String[]{scriptEngine, combineScript});
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> combine(final String setupScript) {
-            return combine(AbstractVertexProgramBuilder.GREMLIN_GROOVY, setupScript);
-        }
-
-        ////////////
-
-        public Builder<MK, MV, RK, RV, R> reduce(TriConsumer<MK, Iterator<MV>, MapReduce.ReduceEmitter<RK, RV>> reduceLambda) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.OBJECT, REDUCE_LAMBDA, reduceLambda);
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> reduce(Class<? extends TriConsumer<MK, Iterator<MV>, MapReduce.ReduceEmitter<RK, RV>>> reduceClass) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.CLASS, REDUCE_LAMBDA, reduceClass);
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> reduce(final String scriptEngine, final String reduceScript) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.SCRIPT, REDUCE_LAMBDA, new String[]{scriptEngine, reduceScript});
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> reduce(final String setupScript) {
-            return reduce(AbstractVertexProgramBuilder.GREMLIN_GROOVY, setupScript);
-        }
-
-        //
-
-        public Builder<MK, MV, RK, RV, R> reduceKeySort(final Supplier<Comparator<RK>> comparator) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.OBJECT, REDUCE_KEY_SORT, comparator);
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> reduceKeySort(final Class<? extends Supplier<Comparator<RK>>> comparatorClass) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.CLASS, REDUCE_KEY_SORT, comparatorClass);
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> reduceKeySort(final String scriptEngine, final String reduceScript) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.SCRIPT, REDUCE_KEY_SORT, new String[]{scriptEngine, reduceScript});
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> reduceKeySort(final String setupScript) {
-            return reduceKeySort(AbstractVertexProgramBuilder.GREMLIN_GROOVY, setupScript);
-        }
-
-        ////////////
-
-        public Builder<MK, MV, RK, RV, R> memory(Function<Iterator<KeyValue<RK, RV>>, R> memoryLambda) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.OBJECT, MEMORY_LAMBDA, memoryLambda);
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> memory(Class<? extends Function<Iterator<KeyValue<RK, RV>>, R>> memoryClass) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.CLASS, MEMORY_LAMBDA, memoryClass);
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> memory(final String scriptEngine, final String memoryScript) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.SCRIPT, MEMORY_LAMBDA, new String[]{scriptEngine, memoryScript});
-            return this;
-        }
-
-        public Builder<MK, MV, RK, RV, R> memory(final String setupScript) {
-            return memory(AbstractVertexProgramBuilder.GREMLIN_GROOVY, setupScript);
-        }
-
-        ////////////
-
-        public Builder<MK, MV, RK, RV, R> memoryKey(final String memoryKey) {
-            this.configuration.setProperty(LambdaMapReduce.MEMORY_KEY, memoryKey);
-            return this;
-        }
-
-        public LambdaMapReduce<MK, MV, RK, RV, R> create() {
-            LambdaMapReduce<MK, MV, RK, RV, R> lambdaMapReduce = new LambdaMapReduce<>();
-            lambdaMapReduce.loadState(this.configuration);
-            return lambdaMapReduce;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4435485b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/lambda/LambdaVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/lambda/LambdaVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/lambda/LambdaVertexProgram.java
deleted file mode 100644
index 4181ba8..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/lambda/LambdaVertexProgram.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * 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.computer.lambda;
-
-import org.apache.commons.configuration.Configuration;
-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.computer.util.AbstractVertexProgramBuilder;
-import org.apache.tinkerpop.gremlin.process.computer.util.LambdaHolder;
-import org.apache.tinkerpop.gremlin.process.computer.util.StaticVertexProgram;
-import org.apache.tinkerpop.gremlin.process.computer.util.VertexProgramHelper;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.apache.tinkerpop.gremlin.util.function.TriConsumer;
-
-import java.io.Serializable;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.function.Consumer;
-import java.util.function.Predicate;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public class LambdaVertexProgram<M extends Serializable> extends StaticVertexProgram<M> {
-
-    private static final Set<MessageScope> MESSAGE_SCOPES = new HashSet<>(Collections.singletonList(MessageScope.Global.instance()));
-
-    private static final String SETUP_LAMBDA = "gremlin.lambdaVertexProgram.setupLambda";
-    private static final String EXECUTE_LAMBDA = "gremlin.lambdaVertexProgram.executeLambda";
-    private static final String TERMINATE_LAMBDA = "gremlin.lambdaVertexProgram.terminateLambda";
-    private static final String ELEMENT_COMPUTE_KEYS = "gremlin.lambdaVertexProgram.elementComputeKeys";
-    private static final String MEMORY_COMPUTE_KEYS = "gremlin.lambdaVertexProgram.memoryComputeKeys";
-
-    private LambdaHolder<Consumer<Memory>> setupLambdaHolder;
-    private Consumer<Memory> setupLambda;
-    private LambdaHolder<TriConsumer<Vertex, Messenger<M>, Memory>> executeLambdaHolder;
-    private TriConsumer<Vertex, Messenger<M>, Memory> executeLambda;
-    private LambdaHolder<Predicate<Memory>> terminateLambdaHolder;
-    private Predicate<Memory> terminateLambda;
-    private Set<String> elementComputeKeys;
-    private Set<String> memoryComputeKeys;
-
-    private LambdaVertexProgram() {
-    }
-
-    @Override
-    public void loadState(final Configuration configuration) {
-        this.setupLambdaHolder = LambdaHolder.loadState(configuration, SETUP_LAMBDA);
-        this.executeLambdaHolder = LambdaHolder.loadState(configuration, EXECUTE_LAMBDA);
-        this.terminateLambdaHolder = LambdaHolder.loadState(configuration, TERMINATE_LAMBDA);
-        this.setupLambda = null == this.setupLambdaHolder ? s -> {
-        } : this.setupLambdaHolder.get();
-        this.executeLambda = null == this.executeLambdaHolder ? (v, m, s) -> {
-        } : this.executeLambdaHolder.get();
-        this.terminateLambda = null == this.terminateLambdaHolder ? s -> true : this.terminateLambdaHolder.get();
-
-        try {
-            this.elementComputeKeys = configuration.containsKey(ELEMENT_COMPUTE_KEYS) ?
-                    VertexProgramHelper.deserialize(configuration, ELEMENT_COMPUTE_KEYS) : Collections.emptySet();
-            this.memoryComputeKeys = configuration.containsKey(MEMORY_COMPUTE_KEYS) ?
-                    VertexProgramHelper.deserialize(configuration, MEMORY_COMPUTE_KEYS) : Collections.emptySet();
-        } catch (Exception e) {
-            throw new IllegalStateException(e.getMessage(), e);
-        }
-    }
-
-    @Override
-    public void storeState(final Configuration configuration) {
-        super.storeState(configuration);
-        if (null != this.setupLambdaHolder)
-            this.setupLambdaHolder.storeState(configuration);
-        if (null != this.executeLambdaHolder)
-            this.executeLambdaHolder.storeState(configuration);
-        if (null != this.terminateLambdaHolder)
-            this.terminateLambdaHolder.storeState(configuration);
-
-        try {
-            VertexProgramHelper.serialize(this.elementComputeKeys, configuration, ELEMENT_COMPUTE_KEYS);
-            VertexProgramHelper.serialize(this.memoryComputeKeys, configuration, MEMORY_COMPUTE_KEYS);
-        } catch (Exception e) {
-            throw new IllegalStateException(e.getMessage(), e);
-        }
-    }
-
-    @Override
-    public void setup(final Memory memory) {
-        this.setupLambda.accept(memory);
-    }
-
-
-    @Override
-    public void execute(final Vertex vertex, final Messenger<M> messenger, final Memory memory) {
-        this.executeLambda.accept(vertex, messenger, memory);
-    }
-
-    @Override
-    public boolean terminate(final Memory memory) {
-        return this.terminateLambda.test(memory);
-    }
-
-    @Override
-    public Set<String> getElementComputeKeys() {
-        return this.elementComputeKeys;
-    }
-
-    @Override
-    public Set<String> getMemoryComputeKeys() {
-        return this.memoryComputeKeys;
-    }
-
-    @Override
-    public Set<MessageScope> getMessageScopes(final Memory memory) {
-        return MESSAGE_SCOPES;
-    }
-
-    @Override
-    public GraphComputer.ResultGraph getPreferredResultGraph() {
-        return GraphComputer.ResultGraph.ORIGINAL;
-    }
-
-    @Override
-    public GraphComputer.Persist getPreferredPersist() {
-        return GraphComputer.Persist.NOTHING;
-    }
-
-    @Override
-    public String toString() {
-        return StringFactory.vertexProgramString(this);
-    }
-
-    //////////////////////////////
-
-    public static Builder build() {
-        return new Builder();
-    }
-
-    public static class Builder extends AbstractVertexProgramBuilder<Builder> {
-
-
-        private Builder() {
-            super(LambdaVertexProgram.class);
-        }
-
-        public Builder setup(final Consumer<Memory> setupLambda) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.OBJECT, SETUP_LAMBDA, setupLambda);
-            return this;
-        }
-
-        public Builder setup(final Class<? extends Consumer<Memory>> setupClass) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.CLASS, SETUP_LAMBDA, setupClass);
-            return this;
-        }
-
-        public Builder setup(final String scriptEngine, final String setupScript) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.SCRIPT, SETUP_LAMBDA, new String[]{scriptEngine, setupScript});
-            return this;
-        }
-
-        public Builder setup(final String setupScript) {
-            return setup(GREMLIN_GROOVY, setupScript);
-        }
-
-        ///////
-
-        public Builder execute(final TriConsumer<Vertex, Messenger, Memory> executeLambda) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.OBJECT, EXECUTE_LAMBDA, executeLambda);
-            return this;
-        }
-
-        public Builder execute(final Class<? extends TriConsumer<Vertex, Messenger, Memory>> executeClass) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.CLASS, EXECUTE_LAMBDA, executeClass);
-            return this;
-        }
-
-        public Builder execute(final String scriptEngine, final String executeScript) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.SCRIPT, EXECUTE_LAMBDA, new String[]{scriptEngine, executeScript});
-            return this;
-        }
-
-        public Builder execute(final String setupScript) {
-            return execute(GREMLIN_GROOVY, setupScript);
-        }
-
-        ///////
-
-        public Builder terminate(final Predicate<Memory> terminateLambda) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.OBJECT, TERMINATE_LAMBDA, terminateLambda);
-            return this;
-        }
-
-        public Builder terminate(final Class<? extends Predicate<Memory>> terminateClass) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.CLASS, TERMINATE_LAMBDA, terminateClass);
-            return this;
-        }
-
-        public Builder terminate(final String scriptEngine, final String terminateScript) {
-            LambdaHolder.storeState(this.configuration, LambdaHolder.Type.SCRIPT, TERMINATE_LAMBDA, new String[]{scriptEngine, terminateScript});
-            return this;
-        }
-
-        public Builder terminate(final String setupScript) {
-            return terminate(GREMLIN_GROOVY, setupScript);
-        }
-
-        ///////
-
-        public Builder memoryComputeKeys(final Set<String> memoryComputeKeys) {
-            try {
-                VertexProgramHelper.serialize(memoryComputeKeys, configuration, MEMORY_COMPUTE_KEYS);
-                return this;
-            } catch (Exception e) {
-                throw new IllegalStateException(e.getMessage(), e);
-            }
-        }
-
-        public Builder elementComputeKeys(final Set<String> elementComputeKeys) {
-            try {
-                VertexProgramHelper.serialize(elementComputeKeys, configuration, ELEMENT_COMPUTE_KEYS);
-                return this;
-            } catch (Exception e) {
-                throw new IllegalStateException(e.getMessage(), e);
-            }
-        }
-
-        public Builder memoryComputeKeys(final String... memoryComputeKeys) {
-            return this.memoryComputeKeys(new HashSet<>(Arrays.asList(memoryComputeKeys)));
-        }
-
-        public Builder elementComputeKeys(final String... elementComputeKeys) {
-            return this.elementComputeKeys(new HashSet<>(Arrays.asList(elementComputeKeys)));
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4435485b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerGraph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerGraph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerGraph.java
index 3f52244..7f93b50 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerGraph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerGraph.java
@@ -210,16 +210,22 @@ public class ComputerGraph implements Graph {
 
         @Override
         public <V> VertexProperty<V> property(final String key, final V value) {
+            if(!computeKeys.contains(key))
+                throw GraphComputer.Exceptions.providedKeyIsNotAnElementComputeKey(key);
             return new ComputerVertexProperty<>(this.asVertex().property(key, value));
         }
 
         @Override
         public <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues) {
+            if(!computeKeys.contains(key))
+                throw GraphComputer.Exceptions.providedKeyIsNotAnElementComputeKey(key);
             return new ComputerVertexProperty<>(this.asVertex().property(key, value, keyValues));
         }
 
         @Override
         public <V> VertexProperty<V> property(final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {
+            if(!computeKeys.contains(key))
+                throw GraphComputer.Exceptions.providedKeyIsNotAnElementComputeKey(key);
             return new ComputerVertexProperty<>(this.asVertex().property(cardinality, key, value, keyValues));
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4435485b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramPool.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramPool.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramPool.java
index 0632708..b77c310 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramPool.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramPool.java
@@ -30,7 +30,7 @@ import java.util.concurrent.TimeUnit;
 public final class VertexProgramPool {
 
     private final LinkedBlockingQueue<VertexProgram<?>> pool;
-    private static final int TIMEOUT_MS = 2500;
+    private static final int TIMEOUT_MS = 10000;
 
     public VertexProgramPool(final VertexProgram vertexProgram, final int poolSize) {
         this.pool = new LinkedBlockingQueue<>(poolSize);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4435485b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/computer/GroovyGraphComputerTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/computer/GroovyGraphComputerTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/computer/GroovyGraphComputerTest.groovy
deleted file mode 100644
index e953d24..0000000
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/computer/GroovyGraphComputerTest.groovy
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * 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.computer
-
-import org.apache.tinkerpop.gremlin.process.computer.lambda.LambdaMapReduce
-import org.apache.tinkerpop.gremlin.process.computer.lambda.LambdaVertexProgram
-import org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public abstract class GroovyGraphComputerTest {
-
-    public static class ComputerTraversals extends GraphComputerTest {
-        public GraphComputer get_g_compute() {
-            g.getGraphComputer().get();
-        }
-
-        @Override
-        public GraphComputer get_g_compute_setupXX_executeXX_terminateXtrueX_memoryKeysXset_incr_and_orX() {
-            g.getGraphComputer().get().program(LambdaVertexProgram.build().memoryComputeKeys("set", "incr", "and", "or").create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_setupXX_executeXX_terminateXtrueX_memoryKeysXnullX() {
-            g.getGraphComputer().get().program(LambdaVertexProgram.build().memoryComputeKeys([null] as Set).create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_setupXX_executeXX_terminateXtrueX_memoryKeysX_X() {
-            g.getGraphComputer().get().program(LambdaVertexProgram.build().memoryComputeKeys('').create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_setupXsetXa_trueXX_executeXX_terminateXtrueX() {
-            g.getGraphComputer().get().program(LambdaVertexProgram.build().setup("gremlin-groovy", "a.set('a', true)").create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_setupXX_executeXX_terminateXtrueX() {
-            g.getGraphComputer().get().program(LambdaVertexProgram.build().create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_setupXX_executeXv_blah_m_incrX_terminateX1X_elementKeysXnameLengthCounterX_memoryKeysXa_bX() {
-            return g.getGraphComputer().get().program(LambdaVertexProgram.build().
-                    execute("gremlin-groovy", """
-                        import static org.junit.Assert.*;
-                        try {
-                            a.property("blah", "blah");
-                            fail("Should throw an IllegalArgumentException");
-                        } catch (IllegalArgumentException e) {
-                            assertEquals(GraphComputer.Exceptions.providedKeyIsNotAnElementComputeKey("blah").getMessage(), e.getMessage());
-                        } catch (Exception e) {
-                            fail("Should throw an IllegalArgumentException: " + e);
-                        }
-
-                        c.incr("a", 1);
-                        if (c.isInitialIteration()) {
-                            a.property("nameLengthCounter", a.<String>value("name").length());
-                            c.incr("b", a.<String>value("name").length());
-                        } else {
-                            a.property(VertexProperty.Cardinality.single,"nameLengthCounter", a.<String>value("name").length() + a.<Integer>value("nameLengthCounter"));
-                        }
-                    """).terminate("gremlin-groovy", "a.getIteration() == 1")
-                    .elementComputeKeys("nameLengthCounter").
-                    memoryComputeKeys("a", "b").create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_setupXabcdeX_executeXtestMemoryX_terminateXtestMemoryXmemoryKeysXabcdeX() {
-            g.getGraphComputer().get().program(LambdaVertexProgram.build().
-                    setup("gremlin-groovy", """
-                        a.set("a", 0l);
-                        a.set("b", 0l);
-                        a.set("c", true);
-                        a.set("d", false);
-                        a.set("e", true);
-                    """).
-                    execute("gremlin-groovy", """
-                        import static org.junit.Assert.*;
-                        // test current step values
-                        assertEquals(Long.valueOf(6 * c.getIteration()), c.get("a"));
-                        assertEquals(Long.valueOf(0), c.get("b"));
-                        if (c.isInitialIteration()) {
-                            assertTrue(c.get("c"));
-                            assertFalse(c.get("d"));
-                        } else {
-                            assertFalse(c.get("c"));
-                            assertTrue(c.get("d"));
-                        }
-                        assertTrue(c.get("e"));
-
-                        // update current step values and make sure returns are correct
-                        c.incr("a", 1l);
-                        c.incr("b", 1l);
-                        c.and("c", false);
-                        c.or("d", true);
-                        c.and("e", false);
-
-                        // test current step values, should be the same as previous prior to update
-                        assertEquals(Long.valueOf(6 * c.getIteration()), c.get("a"));
-                        assertEquals(Long.valueOf(0), c.get("b"));
-                        if (c.isInitialIteration()) {
-                            assertTrue(c.get("c"));
-                            assertFalse(c.get("d"));
-                        } else {
-                            assertFalse(c.get("c"));
-                            assertTrue(c.get("d"));
-                        }
-                        assertTrue(c.get("e"));
-                    """).
-                    terminate("gremlin-groovy", """
-                        import static org.junit.Assert.*;
-                        assertEquals(Long.valueOf(6 * (a.getIteration() + 1)), a.get("a"));
-                        assertEquals(Long.valueOf(6), a.get("b"));
-                        assertFalse(a.get("c"));
-                        assertTrue(a.get("d"));
-                        assertFalse(a.get("e"));
-                        a.set("b", 0l);
-                        a.set("e", true);
-                        return a.getIteration() > 1;
-                    """).
-                    memoryComputeKeys("a", "b", "c", "d", "e").create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_mapXageX_reduceXsumX_memoryXnextX_memoryKeyXageSumX() {
-            g.getGraphComputer().get().mapReduce(LambdaMapReduce.<MapReduce.NullObject, Integer, MapReduce.NullObject, Integer, Integer> build()
-                    .map("gremlin-groovy", "if(a.property('age').isPresent()) b.emit(a.value('age'))")
-                    .reduce("gremlin-groovy", "c.emit(b.sum())")
-                    .memory("gremlin-groovy", "a.next().getValue()")
-                    .memoryKey("ageSum").create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_executeXcounterX_terminateX8X_mapreduceXcounter_aX_mapreduceXcounter_bX() {
-            g.getGraphComputer().get().program(LambdaVertexProgram.build()
-                    .execute("gremlin-groovy", "a.property(VertexProperty.Cardinality.single,'counter', c.isInitialIteration() ? 1 : a.value('counter') + 1)")
-                    .terminate("gremlin-groovy", "a.getIteration() > 8")
-                    .elementComputeKeys(["counter"] as Set).create())
-                    .mapReduce(LambdaMapReduce.<MapReduce.NullObject, Integer, MapReduce.NullObject, Integer, Integer> build()
-                    .map("gremlin-groovy", "b.emit(a.value('counter'))")
-                    .reduce("gremlin-groovy",
-                    """
-                        int counter = 0;
-                        while (b.hasNext()) {
-                            counter = counter + b.next();
-                        }
-                        c.emit(MapReduce.NullObject.instance(), counter);
-                        """)
-                    .memory("gremlin-groovy", "a.next().getValue()")
-                    .memoryKey("a").create())
-                    .mapReduce(LambdaMapReduce.<MapReduce.NullObject, Integer, MapReduce.NullObject, Integer, Integer> build()
-                    .map("gremlin-groovy", "b.emit(a.value('counter'))")
-                    .combine("gremlin-groovy", "c.emit(1)")
-                    .reduce("gremlin-groovy", "c.emit(1)")
-                    .memory("gremlin-groovy", "a.next().getValue()")
-                    .memoryKey("b").create());
-
-        }
-
-        @Override
-        public GraphComputer get_g_compute_mapXidX_reduceXidX_reduceKeySortXreverseX_memoryKeyXidsX() {
-            g.getGraphComputer().get().mapReduce(LambdaMapReduce.<Long, Long, Long, Long, List<Long>> build()
-                    .map("b.emit(a.id() as Long, a.id() as Long)")
-                    .reduce("b.forEachRemaining{c.emit(it, it)}")
-                    .memoryKey("ids")
-                    .reduceKeySort("Comparator.reverseOrder()")
-                    .memory("""
-                        temp = []
-                        a.forEachRemaining{temp.add(it.getKey())}
-                        temp
-                    """)
-                    .create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_programXTraversalVertexProgram_build_traversalXg_V_both_hasXlabel_personX_age_groupCountXaXX_create() {
-            g.getGraphComputer().get().program(TraversalVertexProgram.build().
-                    traversal("GraphFactory.open(['gremlin.graph':'${graph.metaClass.theClass.getCanonicalName()}']).V().both().has(label,'person').values('age').groupCount('a')").
-                    create());
-        }
-
-        @Override
-        public GraphComputer get_g_compute_mapXoutE_countX_reduceXsumX() {
-            g.getGraphComputer().get().mapReduce(LambdaMapReduce.<MapReduce.NullObject, Long, Long, Long, List<Long>> build()
-                    .map("""
-                        import static org.junit.Assert.*;
-                        try {
-                          b.emit(org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.count(a.edges(OUT)))
-                        } catch (IllegalStateException e) {
-                            assertEquals(GraphComputer.Exceptions.incidentAndAdjacentElementsCanNotBeAccessedInMapReduce().getMessage(), e.getMessage());
-                            throw e;
-                        } catch (Exception e) {
-                            fail("Should throw an IllegalArgumentException (incidentAndAdjacentElementsCanNotBeAccessedInMapReduce): " + e);
-                        }
-                    """)
-                    .reduce(
-                    """
-                        int counter = 0;
-                        while (b.hasNext()) {
-                            counter = counter + b.next();
-                        }
-                        c.emit(MapReduce.NullObject.instance(), counter);
-                        """)
-                    .memoryKey("count")
-                    .memory("gremlin-groovy", "a.next().getValue()")
-                    .create());
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4435485b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
index 6279643..90c1a7f 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
@@ -22,7 +22,6 @@ import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
 import org.apache.tinkerpop.gremlin.GraphManager;
 import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader;
 import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper;
-import org.apache.tinkerpop.gremlin.process.computer.GroovyGraphComputerTest;
 import org.apache.tinkerpop.gremlin.process.computer.ranking.PageRankVertexProgramTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.GroovyBranchTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.GroovyChooseTest;
@@ -81,8 +80,6 @@ public class GroovyProcessComputerSuite extends ProcessComputerSuite {
      */
     private static final Class<?>[] testsToExecute = new Class<?>[]{
 
-            GroovyGraphComputerTest.ComputerTraversals.class,
-
             //branch
             GroovyBranchTest.ComputerTraversals.class,
             GroovyChooseTest.ComputerTraversals.class,

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4435485b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
index 1579d1a..568748d 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
@@ -23,19 +23,18 @@ import groovy.json.JsonBuilder;
 import org.apache.commons.configuration.Configuration;
 import org.apache.tinkerpop.gremlin.groovy.function.GFunction;
 import org.apache.tinkerpop.gremlin.groovy.loaders.GremlinLoader;
-import org.apache.tinkerpop.gremlin.process.traversal.Scope;
-import org.apache.tinkerpop.gremlin.process.traversal.T;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.PeerPressureVertexProgram;
-import org.apache.tinkerpop.gremlin.process.computer.lambda.LambdaVertexProgram;
 import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankVertexProgram;
 import org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram;
+import org.apache.tinkerpop.gremlin.process.traversal.Scope;
+import org.apache.tinkerpop.gremlin.process.traversal.T;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
-import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
 import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine;
+import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy;
@@ -55,8 +54,8 @@ import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
 import org.apache.tinkerpop.gremlin.structure.util.batch.BatchGraph;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedElement;
 import org.apache.tinkerpop.gremlin.util.Gremlin;
-import org.apache.tinkerpop.gremlin.util.function.FunctionUtils;
 import org.apache.tinkerpop.gremlin.util.TimeUtil;
+import org.apache.tinkerpop.gremlin.util.function.FunctionUtils;
 import org.codehaus.groovy.control.customizers.CompilationCustomizer;
 import org.codehaus.groovy.control.customizers.ImportCustomizer;
 
@@ -114,7 +113,6 @@ public abstract class AbstractImportCustomizerProvider implements ImportCustomiz
         imports.add(PeerPressureVertexProgram.class.getPackage().getName() + DOT_STAR);
         imports.add(PageRankVertexProgram.class.getPackage().getName() + DOT_STAR);
         imports.add(TraversalVertexProgram.class.getPackage().getName() + DOT_STAR);
-        imports.add(LambdaVertexProgram.class.getPackage().getName() + DOT_STAR);
 
         // groovy extras
         imports.add(Grape.class.getCanonicalName());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4435485b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
index db98150..b1fcc42 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin;
 
 import org.apache.commons.configuration.Configuration;
+import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -35,6 +36,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Optional;
 import java.util.Random;
 import java.util.Set;
 import java.util.function.Consumer;
@@ -54,6 +56,7 @@ import static org.junit.Assume.assumeThat;
 public abstract class AbstractGremlinTest {
     protected Graph graph;
     protected GraphTraversalSource g;
+    protected Optional<Class<? extends GraphComputer>> graphComputerClass;
     protected Configuration config;
     protected GraphProvider graphProvider;
 
@@ -72,6 +75,7 @@ public abstract class AbstractGremlinTest {
         // not sure how the strategy can ever be null, but it seems to happen in the performance tests
         graph = graphProvider.openTestGraph(config);
         g = graphProvider.traversal(graph);
+        graphComputerClass = g.getGraphComputer().isPresent() ? Optional.of(g.getGraphComputer().get().getClass()) : Optional.empty();
 
         final Method testMethod = this.getClass().getMethod(cleanMethodName(name.getMethodName()));
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4435485b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
index 32336ba..1487ee8 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
@@ -20,6 +20,7 @@ package org.apache.tinkerpop.gremlin.process;
 
 import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
 import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
+import org.apache.tinkerpop.gremlin.process.computer.GraphComputerTest;
 import org.apache.tinkerpop.gremlin.process.computer.ranking.PageRankVertexProgramTest;
 import org.apache.tinkerpop.gremlin.process.computer.util.ComputerGraphTest;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
@@ -111,6 +112,9 @@ public class ProcessComputerSuite extends AbstractGremlinSuite {
      */
     private static final Class<?>[] allTests = new Class<?>[]{
 
+            // computer, vertex program, and map/reduce semantics
+            GraphComputerTest.class,
+
             // branch
             BranchTest.Traversals.class,
             ChooseTest.Traversals.class,