tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject incubator-tinkerpop git commit: Removed one more restriction in ComputerVerificationStartegy. Found a hard coded IgnoreEngine(COMPUTER) test in OrderTest -- remove it, test now passes (bam). Some minor optimizations to XXXGlobalSteps to limit memory cons
Date Tue, 01 Mar 2016 22:25:53 GMT
Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1188 2f13cb2a4 -> 7054359b9


Removed one more restriction in ComputerVerificationStartegy. Found a hard coded IgnoreEngine(COMPUTER)
test in OrderTest -- remove it, test now passes (bam). Some minor optimizations to XXXGlobalSteps
to limit memory consumption. Sweet.


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

Branch: refs/heads/TINKERPOP-1188
Commit: 7054359b9e96e5cb9751972e9b73b30d2991b06f
Parents: 2f13cb2
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Tue Mar 1 15:25:50 2016 -0700
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Tue Mar 1 15:25:50 2016 -0700

----------------------------------------------------------------------
 .../process/computer/traversal/TraversalVertexProgram.java  | 1 +
 .../process/traversal/step/filter/DedupGlobalStep.java      | 3 ++-
 .../process/traversal/step/filter/RangeGlobalStep.java      | 3 ++-
 .../process/traversal/step/filter/TailGlobalStep.java       | 4 ++--
 .../process/traversal/step/util/CollectingBarrierStep.java  | 2 +-
 .../strategy/verification/ComputerVerificationStrategy.java | 9 +++++----
 .../gremlin/process/traversal/step/map/OrderTest.java       | 1 -
 7 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7054359b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
index 7da6984..edbb4ad 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
@@ -430,6 +430,7 @@ public final class TraversalVertexProgram implements VertexProgram<TraverserSet<
                 traversal.getGraph().ifPresent(parentTraversal::setGraph);
                 parentTraversal.setStrategies(traversal.getStrategies());
                 parentTraversal.getStrategies().addStrategies(ComputerVerificationStrategy.instance(),
new VertexProgramStrategy(Graph::compute));
+                parentTraversal.setSideEffects(traversal.getSideEffects());
                 parentTraversal.addStep(new TraversalVertexProgramStep(parentTraversal, traversal));
                 traversal = ((TraversalVertexProgramStep) parentTraversal.getStartStep()).getGlobalChildren().get(0);
             }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7054359b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DedupGlobalStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DedupGlobalStep.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DedupGlobalStep.java
index 899478e..cdd9564 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DedupGlobalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DedupGlobalStep.java
@@ -34,6 +34,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementExce
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalUtil;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -152,7 +153,7 @@ public final class DedupGlobalStep<S> extends FilterStep<S>
implements Traversal
 
     @Override
     public void addBarrier(final TraverserSet<S> barrier) {
-        barrier.iterator().forEachRemaining(traverser -> {
+        IteratorUtils.removeOnNext(barrier.iterator()).forEachRemaining(traverser -> {
             traverser.setSideEffects(this.getTraversal().getSideEffects());
             this.addStart(traverser);
         });

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7054359b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java
index 3f619e4..7dff803 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java
@@ -29,6 +29,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequire
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
 import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 
 import java.io.Serializable;
 import java.util.Collections;
@@ -165,7 +166,7 @@ public final class RangeGlobalStep<S> extends FilterStep<S>
implements Ranging,
 
     @Override
     public void addBarrier(final TraverserSet<S> barrier) {
-        barrier.iterator().forEachRemaining(traverser -> {
+        IteratorUtils.removeOnNext(barrier.iterator()).forEachRemaining(traverser -> {
             traverser.setSideEffects(this.getTraversal().getSideEffects());
             this.addStart(traverser);
         });

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7054359b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java
index 09e5faf..78320b5 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java
@@ -28,11 +28,11 @@ import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequire
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
 import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 
 import java.util.ArrayDeque;
 import java.util.Collections;
 import java.util.Deque;
-import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.Set;
 
@@ -152,7 +152,7 @@ public final class TailGlobalStep<S> extends AbstractStep<S,
S> implements Bypas
 
     @Override
     public void addBarrier(final TraverserSet<S> barrier) {
-        barrier.iterator().forEachRemaining(traverser -> {
+        IteratorUtils.removeOnNext(barrier.iterator()).forEachRemaining(traverser -> {
             traverser.setSideEffects(this.getTraversal().getSideEffects());
             this.addStart(traverser);
         });

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7054359b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/CollectingBarrierStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/CollectingBarrierStep.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/CollectingBarrierStep.java
index 3979874..5119c4c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/CollectingBarrierStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/CollectingBarrierStep.java
@@ -97,7 +97,7 @@ public abstract class CollectingBarrierStep<S> extends AbstractStep<S,
S> implem
     public void addBarrier(final TraverserSet<S> barrier) {
         this.traverserSet = barrier;
         this.traverserSet.forEach(traverser -> traverser.setSideEffects(this.getTraversal().getSideEffects()));
-        this.barrierConsumer(barrier);
+        this.barrierConsumer(this.traverserSet);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7054359b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
index e07522e..9cde2de 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
@@ -101,12 +101,12 @@ public final class ComputerVerificationStrategy extends AbstractTraversalStrateg
             // collecting barriers and dedup global use can only operate on the element and
its properties (no incidences)
             if ((step instanceof CollectingBarrierStep || step instanceof DedupGlobalStep)
&& step instanceof TraversalParent) {
                 if (((TraversalParent) step).getLocalChildren().stream().filter(t -> !TraversalHelper.isLocalVertex(t)).findAny().isPresent())
-                    throw new VerificationException("A CollectingBarrierStep can not process
the incident edges of a vertex: " + step, traversal);
+                    throw new VerificationException("A barrier-steps can not process the
incident edges of a vertex: " + step, traversal);
             }
 
             // this is due to how reducing works and can be fixed by generalizing the current
simple model
             // we need to make it so dedup global does its project post reduction (easy to
do, just do it)
-            if ((step instanceof DedupGlobalStep) && (!((DedupGlobalStep) step).getScopeKeys().isEmpty()
|| !((DedupGlobalStep) step).getLocalChildren().isEmpty())) {
+            if ((step instanceof DedupGlobalStep) && (!((DedupGlobalStep) step).getScopeKeys().isEmpty()))
{
                 throw new VerificationException("A dedup()-step can not process scoped elements:
" + step, traversal);
             }
 
@@ -117,11 +117,12 @@ public final class ComputerVerificationStrategy extends AbstractTraversalStrateg
             if ((step instanceof WhereTraversalStep && TraversalHelper.getVariableLocations(((WhereTraversalStep<?>)
step).getLocalChildren().get(0)).contains(Scoping.Variable.START)))
                 throw new VerificationException("A where()-step that has a start variable
is not allowed because the variable value is retrieved from the path: " + step, traversal);
 
+            if (step instanceof PathProcessor && ((PathProcessor) step).getMaxRequirement()
!= PathProcessor.ElementRequirement.ID)
+                throw new VerificationException("The following path processor step requires
more than the element id: " + step + " requires " + ((PathProcessor) step).getMaxRequirement(),
traversal);
+
             if (UNSUPPORTED_STEPS.stream().filter(c -> c.isAssignableFrom(step.getClass())).findFirst().isPresent())
                 throw new VerificationException("The following step is currently not supported
by GraphComputer traversals: " + step, traversal);
 
-            if (step instanceof PathProcessor && ((PathProcessor) step).getMaxRequirement()
!= PathProcessor.ElementRequirement.ID)
-                throw new VerificationException("The following path processor step requires
more than the element id: " + step + " requires " + ((PathProcessor) step).getMaxRequirement(),
traversal);
         }
 
         Step<?, ?> nextParentStep = traversal.getParent().asStep();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7054359b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
index 80c3a74..b1d94cc 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
@@ -263,7 +263,6 @@ public abstract class OrderTest extends AbstractGremlinProcessTest {
 
     @Test
     @LoadGraphWith(MODERN)
-    @IgnoreEngine(TraversalEngine.Type.COMPUTER) // FOLD NEEDS TO BE SEEDED
     public void g_V_localXbothE_weight_foldX_order_byXsumXlocalX_decrX() {
         final Traversal<Vertex, List<Double>> traversal = get_g_V_localXbothE_weight_foldX_order_byXsumXlocalX_decrX();
         final List<List<Double>> list = traversal.toList();


Mime
View raw message