You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2018/08/01 19:29:49 UTC

[25/50] [abbrv] tinkerpop git commit: TINKERPOP-1996 Prevent OLTP style execution in Hadoop of io()

TINKERPOP-1996 Prevent OLTP style execution in Hadoop of io()


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

Branch: refs/heads/TINKERPOP-1990
Commit: fdb35c69422f95199563e938ec30a2408d419a58
Parents: e9ebacf
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jul 20 16:13:47 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Jul 20 16:13:47 2018 -0400

----------------------------------------------------------------------
 .../process/computer/traversal/strategy/HadoopIoStrategy.java  | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdb35c69/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/strategy/HadoopIoStrategy.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/strategy/HadoopIoStrategy.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/strategy/HadoopIoStrategy.java
index af3db6e..3614745 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/strategy/HadoopIoStrategy.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/traversal/strategy/HadoopIoStrategy.java
@@ -29,6 +29,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.step.ReadWriting;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.IoStep;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.VerificationException;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
 
 import java.util.Arrays;
@@ -54,6 +55,11 @@ public final class HadoopIoStrategy extends AbstractTraversalStrategy<TraversalS
 
     @Override
     public void apply(final Traversal.Admin<?, ?> traversal) {
+        // since hadoopgraph can't be modified we can't try to use the existing IoStep for standard processing
+        // without graphcomputer
+        if (traversal.getStartStep() instanceof IoStep)
+            throw new VerificationException("HadoopGraph requires a GraphComputer for io() step", traversal);
+
         // VertexProgramStrategy should wrap up the IoStep in a TraversalVertexProgramStep. use that to grab the
         // GraphComputer that was injected in there and push that in to the HadoopIoStep. this step pattern match
         // is fairly specific and since you really can't chain together steps after io() this approach should work