tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject tinkerpop git commit: what I thought was a fix to my cap().cap() bug was not. race condition where the second cap() is pulling data before the first cap() fininshes. Has to do with the order in which messages are received by workers and for some reason,
Date Fri, 20 Jan 2017 19:18:00 GMT
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1564 f76d5a98e -> 1c4f6f547


what I thought was a fix to my cap().cap() bug was not. race condition where the second cap()
is pulling data before the first cap() fininshes. Has to do with the order in which messages
are received by workers and for some reason, a Terminate is just happening too quickly. dah.....
3 hours down the drain.


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

Branch: refs/heads/TINKERPOP-1564
Commit: 1c4f6f54747f48edddfa09aabddc98efd2105521
Parents: f76d5a9
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Fri Jan 20 12:17:54 2017 -0700
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Fri Jan 20 12:17:54 2017 -0700

----------------------------------------------------------------------
 .../akka/process/actors/AkkaActorsProvider.java |  1 +
 .../akka/process/actors/AkkaPlayTest.java       | 20 +++++++++++---------
 .../actors/traversal/TraversalActorProgram.java |  4 +---
 .../traversal/TraversalWorkerProgram.java       |  4 +---
 4 files changed, 14 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1c4f6f54/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaActorsProvider.java
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaActorsProvider.java
b/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaActorsProvider.java
index 27e9c7e..34b4542 100644
--- a/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaActorsProvider.java
+++ b/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaActorsProvider.java
@@ -55,6 +55,7 @@ public class AkkaActorsProvider extends AbstractTinkerGraphProvider {
             "g_withSackXmap__map_cloneX_V_out_out_sackXmap_a_nameX_sack",
             "g_V_out_group_byXlabelX_selectXpersonX_unfold_outXcreatedX_name_limitX2X",
             "g_V_group_byXlabelX_byXbothE_groupXaX_byXlabelX_byXweight_sumX_weight_sumX",
+            "g_V_both_groupCountXaX_out_capXaX_selectXkeysX_unfold_both_groupCountXaX_capXaX",
             "classicRecommendation",
             "coworkerSummaryOLTP",
             GraphTest.Traversals.class.getCanonicalName(),

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1c4f6f54/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaPlayTest.java
----------------------------------------------------------------------
diff --git a/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaPlayTest.java
b/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaPlayTest.java
index 67e1ddc..f1bce08 100644
--- a/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaPlayTest.java
+++ b/akka-gremlin/src/test/java/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaPlayTest.java
@@ -21,20 +21,15 @@ package org.apache.tinkerpop.gremlin.akka.process.actors;
 
 import org.apache.commons.configuration.BaseConfiguration;
 import org.apache.commons.configuration.Configuration;
-import org.apache.tinkerpop.gremlin.akka.process.actors.AkkaGraphActors;
 import org.apache.tinkerpop.gremlin.process.actors.GraphActors;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Column;
 import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.T;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
 import org.junit.Ignore;
 import org.junit.Test;
 
-import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.in;
-import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.out;
-import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.outE;
+import java.util.Map;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -47,15 +42,22 @@ public class AkkaPlayTest {
         final Configuration configuration = new BaseConfiguration();
         configuration.setProperty(Graph.GRAPH, TinkerGraph.class.getCanonicalName());
         configuration.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, "/Users/marko/software/tinkerpop/data/tinkerpop-modern.kryo");
-        configuration.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT,"gryo");
+        configuration.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, "gryo");
         final Graph graph = TinkerGraph.open(configuration);
         //graph.io(GryoIo.build()).readGraph("../data/tinkerpop-modern.kryo");
         GraphTraversalSource g = graph.traversal().withProcessor(GraphActors.open(AkkaGraphActors.class).workers(15));
-     //  System.out.println(g.V().group().by("name").by(outE().values("weight").fold()).toList());
+        //  System.out.println(g.V().group().by("name").by(outE().values("weight").fold()).toList());
 
         //  [{v[1]=6, v[2]=2, v[3]=6, v[4]=6, v[5]=2, v[6]=2}]
         System.out.println(g.V().both().groupCount("a").out().cap("a").select(Column.keys).unfold().both().groupCount("a").cap("a").toList());
-
+        System.out.println(g.V().both().groupCount("a").out().cap("a").select(Column.keys).unfold().both().groupCount("a").cap("a").toList());
+        for (int i = 0; i < 1000; i++) {
+            Map<Object, Long> map = g.V().both().groupCount("a").out().cap("a").select(Column.keys).unfold().both().groupCount("a").<Map>cap("a").next();
+            if (24L != map.values().stream().reduce((a, b) -> a + b).get()) {
+                System.out.println(i + " -- " + map);
+                assert false;
+            }
+        }
 
 
         //3, 1.9, 1

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1c4f6f54/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalActorProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalActorProgram.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalActorProgram.java
index 591d959..c772ebc 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalActorProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalActorProgram.java
@@ -188,9 +188,7 @@ public final class TraversalActorProgram<R> implements ActorProgram
{
                 final Set set = (Set) object;
                 final Set newSet = set instanceof HashSet ? new HashSet<>(set.size())
: new LinkedHashSet<>(set.size());
                 set.forEach(o -> newSet.add(TraversalActorProgram.attach(o, host)));
-                set.clear();
-                set.addAll(newSet);
-                return (A) set;
+                return (A) newSet;
             } else if (object instanceof Traverser.Admin) {
                 final Traverser.Admin traverser = (Traverser.Admin) object;
                 traverser.attach(host);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1c4f6f54/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalWorkerProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalWorkerProgram.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalWorkerProgram.java
index 1e69c5c..5ea7d07 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalWorkerProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalWorkerProgram.java
@@ -35,7 +35,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.Distributing;
 import org.apache.tinkerpop.gremlin.process.traversal.step.LocalBarrier;
 import org.apache.tinkerpop.gremlin.process.traversal.step.Pushing;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectCapStep;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMatrix;
 import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -127,14 +126,13 @@ final class TraversalWorkerProgram implements ActorProgram.Worker<Object>
{
                     if (barrier instanceof LocalBarrier) {
                         barrier.processAllStarts();
                         this.self.send(this.self.master(), new BarrierAddMessage(barrier));
-                    } else if(!(barrier instanceof SideEffectCapStep)) { // why is this needed?
+                    } else { // why is this needed?
                         while (barrier.hasNextBarrier()) {
                             this.self.send(this.self.master(), new BarrierAddMessage(barrier));
                         }
                     }
                 }
                 this.barriers.clear();
-                this.voteToHalt = false; // is this necessary?
             }
             // use termination token to determine termination condition
             if (this.isLeader) {


Mime
View raw message