tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject [47/50] [abbrv] tinkerpop git commit: okay, more tests exposed. The final issue is nested group().groupCount().select(keys) style traversals. I believe I have attachment covered in this situation, but obviously not. I'm blasted.... done for the day.
Date Mon, 23 Jan 2017 21:24:43 GMT
okay, more tests exposed. The final issue is nested group().groupCount().select(keys) style
traversals. I believe I have attachment covered in this situation, but obviously not. I'm
blasted.... done for the day.


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

Branch: refs/heads/TINKERPOP-1564
Commit: 5b3f29a7e2ad833ea085de7b758a77fcaae6b419
Parents: 51f0898
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Thu Jan 19 15:46:31 2017 -0700
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Mon Jan 23 14:22:53 2017 -0700

----------------------------------------------------------------------
 .../akka/process/actors/AkkaActorsProvider.java |  6 ++++--
 .../actors/traversal/TraversalActorProgram.java | 21 ++++++++++++++++++++
 .../traversal/TraversalMasterProgram.java       |  2 +-
 .../traversal/TraversalWorkerProgram.java       |  3 ++-
 .../gremlin/process/ProcessActorsSuite.java     |  2 +-
 5 files changed, 29 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5b3f29a7/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 7bc88fb..1309491 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
@@ -27,10 +27,10 @@ import org.apache.tinkerpop.gremlin.akka.process.actors.io.gryo.GryoSerializer;
 import org.apache.tinkerpop.gremlin.process.actors.GraphActors;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionTest;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.process.traversal.step.ComplexTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProfileTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategyProcessTest;
@@ -70,9 +70,11 @@ public class AkkaActorsProvider extends AbstractGraphProvider {
             "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",
+            "classicRecommendation",
+            "coworkerSummaryOLTP",
             GraphTest.Traversals.class.getCanonicalName(),
-            ComplexTest.Traversals.class.getCanonicalName(),
             SideEffectTest.Traversals.class.getCanonicalName(),
+            SubgraphTest.Traversals.class.getCanonicalName(),
             ProfileTest.Traversals.class.getCanonicalName(),
             PartitionStrategyProcessTest.class.getCanonicalName(),
             EventStrategyProcessTest.class.getCanonicalName(),

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5b3f29a7/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 bad0931..591d959 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
@@ -36,6 +36,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.InlineFilterStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.LazyBarrierStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.MatchPredicateStrategy;
@@ -48,11 +49,15 @@ import org.apache.tinkerpop.gremlin.structure.Partition;
 import org.apache.tinkerpop.gremlin.structure.util.Attachable;
 import org.apache.tinkerpop.gremlin.structure.util.Host;
 
+import java.util.AbstractMap;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
+import java.util.Set;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -167,9 +172,25 @@ public final class TraversalActorProgram<R> implements ActorProgram
{
                     list.set(i, TraversalActorProgram.attach(list.get(i), host));
                 }
                 return (A) list;
+            } else if (object instanceof Map.Entry) {
+                final Map.Entry entry = (Map.Entry) object;
+                entry.setValue(TraversalActorProgram.attach(entry.getValue(), host));
+                return (A) entry;
             } else if (object instanceof TraverserSet) {
                 ((TraverserSet<?>) object).forEach(traverser -> TraversalActorProgram.attach(traverser,
host));
                 return object;
+            } else if (object instanceof BulkSet) {
+                final BulkSet<?> set = (BulkSet) object;
+                final BulkSet newSet = new BulkSet();
+                set.forEach((o, b) -> newSet.add(TraversalActorProgram.attach(o, host),
b));
+                return (A) newSet;
+            } else if (object instanceof Set) {
+                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;
             } 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/5b3f29a7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalMasterProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalMasterProgram.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalMasterProgram.java
index e28919b..08f9198 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalMasterProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/actors/traversal/TraversalMasterProgram.java
@@ -99,7 +99,7 @@ final class TraversalMasterProgram implements ActorProgram.Master<Object>
{
             this.barriers.put(((Step) barrier).getId(), barrier);
         } else if (message instanceof SideEffectAddMessage) {
             final SideEffectAddMessage sideEffectAddMessage = (SideEffectAddMessage) message;
-            this.traversal.getSideEffects().add(sideEffectAddMessage.getKey(), sideEffectAddMessage.getValue());
+            this.traversal.getSideEffects().add(sideEffectAddMessage.getKey(), TraversalActorProgram.attach(sideEffectAddMessage.getValue(),
this.master.partitioner().getGraph()));
             this.sideEffects.add(sideEffectAddMessage.getKey());
         } else if (message instanceof Terminate) {
             assert Terminate.YES == message;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5b3f29a7/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 05735a4..b3b73d5 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
@@ -108,7 +108,8 @@ final class TraversalWorkerProgram implements ActorProgram.Worker<Object>
{
         } else if (message instanceof Traverser.Admin) {
             this.processTraverser((Traverser.Admin) message);
         } else if (message instanceof SideEffectSetMessage) {
-            this.matrix.getTraversal().getSideEffects().set(((SideEffectSetMessage) message).getKey(),
((SideEffectSetMessage) message).getValue());
+            this.matrix.getTraversal().getSideEffects().
+                    set(((SideEffectSetMessage) message).getKey(), TraversalActorProgram.attach(((SideEffectSetMessage)
message).getValue(), this.self.partition()));
         } else if (message instanceof BarrierDoneMessage) {
             final Step<?, ?> step = (Step) this.matrix.getStepById(((BarrierDoneMessage)
message).getStepId());
             while (step.hasNext()) {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5b3f29a7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessActorsSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessActorsSuite.java
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessActorsSuite.java
index 5e06d94..465d3ac 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessActorsSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessActorsSuite.java
@@ -182,7 +182,7 @@ public class ProcessActorsSuite extends AbstractGremlinSuite {
             EventStrategyProcessTest.class,
             ReadOnlyStrategyProcessTest.class,
             PartitionStrategyProcessTest.class,
-            // SubgraphStrategyProcessTest.class
+            SubgraphStrategyProcessTest.class
     };
 
     /**


Mime
View raw message