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/06/17 23:21:39 UTC

[05/11] incubator-tinkerpop git commit: integration of WhereStep and XMatchStep children now occurs after pre-processing with respective Start/End steps.

integration of WhereStep and XMatchStep children now occurs after pre-processing with respective Start/End steps.


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

Branch: refs/heads/master
Commit: f65c1706fe7256ad83f2bf31fcd1681770ff8517
Parents: 1c7d404
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Jun 16 19:11:41 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jun 17 15:21:13 2015 -0600

----------------------------------------------------------------------
 .../gremlin/process/traversal/step/filter/WhereStep.java         | 4 +++-
 .../gremlin/process/traversal/step/filter/exp/XMatchStep.java    | 3 ++-
 .../tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java | 4 ++--
 3 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f65c1706/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereStep.java
index ac03d29..0197ced 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WhereStep.java
@@ -67,8 +67,10 @@ public final class WhereStep<S> extends FilterStep<S> implements TraversalParent
         this.startKey = null;
         this.selectKey = null;
         this.predicate = null;
-        this.traversal = this.integrateChild(whereTraversal.asAdmin());
+        this.traversal = whereTraversal.asAdmin();
         this.configureStartAndEndSteps(this.traversal);
+        this.traversal = this.integrateChild(this.traversal);
+
     }
 
     private void configureStartAndEndSteps(final Traversal.Admin<?, ?> whereTraversal) {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f65c1706/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/exp/XMatchStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/exp/XMatchStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/exp/XMatchStep.java
index 15143a6..90ff03a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/exp/XMatchStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/exp/XMatchStep.java
@@ -80,8 +80,9 @@ public final class XMatchStep<S, E> extends ComputerAwareStep<S, Map<String, E>>
         if (this.traversal.getEndStep() instanceof StartStep)  // in case a match() is after the start step
             this.traversal.addStep(new IdentityStep<>(this.traversal));
         this.traversal.getEndStep().addLabel(this.startKey = startKey);
-        this.conjunctionTraversals = (List) Stream.of(conjunctionTraversals).map(Traversal::asAdmin).map(this::integrateChild).collect(Collectors.toList());
+        this.conjunctionTraversals = (List) Stream.of(conjunctionTraversals).map(Traversal::asAdmin).collect(Collectors.toList());
         this.conjunctionTraversals.forEach(this::configureStartAndEndSteps); // recursively convert to XMatchStep, XMatchStartStep, or XMatchEndStep
+        this.conjunctionTraversals.forEach(this::integrateChild);
     }
 
     private void configureStartAndEndSteps(final Traversal.Admin<?, ?> conjunctionTraversal) {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f65c1706/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
index e8a0f35..59d3f05 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
@@ -250,7 +250,7 @@ public class TinkerGraphTest {
     @Ignore
     public void testPlay6() throws Exception {
         final Graph graph = TinkerGraph.open();
-        final GraphTraversalSource g = graph.traversal(GraphTraversalSource.computer());
+        final GraphTraversalSource g = graph.traversal(GraphTraversalSource.standard());
         for (int i = 0; i < 1000; i++) {
             graph.addVertex(T.label, "person", T.id, i);
         }
@@ -262,7 +262,7 @@ public class TinkerGraphTest {
             });
         });
         graph.vertices(50).next().addEdge("uncle", graph.vertices(70).next());
-        System.out.println(TimeUtil.clockWithResult(100, () -> g.V().xmatch("a", as("a").out("knows").as("b"), as("a").out("uncle").as("b")).toList()));
+        System.out.println(TimeUtil.clockWithResult(500, () -> g.V().xmatch("a", as("a").out("knows").as("b"), as("a").out("uncle").as("b")).toList()));
     }
 
     @Test