You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2018/03/02 16:42:06 UTC
[01/12] tinkerpop git commit: TinkerMessenger proper handling of
Direction.BOTH
Repository: tinkerpop
Updated Branches:
refs/heads/TINKERPOP-1862 [created] 7956b481b
TinkerMessenger proper handling of Direction.BOTH
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f02ea338
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f02ea338
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f02ea338
Branch: refs/heads/TINKERPOP-1862
Commit: f02ea338a8d039c50896f7c65ca57a695975fc43
Parents: 072f112
Author: Graff, Philip B <Ph...@jhuapl.edu>
Authored: Thu Jan 4 13:27:44 2018 -0500
Committer: Graff, Philip B <Ph...@jhuapl.edu>
Committed: Sun Feb 25 10:43:57 2018 -0500
----------------------------------------------------------------------
.../tinkergraph/process/computer/TinkerMessenger.java | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f02ea338/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java
index 5a0f478..3e49c34 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerMessenger.java
@@ -68,7 +68,16 @@ public final class TinkerMessenger<M> implements Messenger<M> {
final Direction direction = TinkerMessenger.getDirection(incidentTraversal);
final Edge[] edge = new Edge[1]; // simulates storage side-effects available in Gremlin, but not Java8 streams
multiIterator.addIterator(StreamSupport.stream(Spliterators.spliteratorUnknownSize(VertexProgramHelper.reverse(incidentTraversal.asAdmin()), Spliterator.IMMUTABLE | Spliterator.SIZED), false)
- .map(e -> this.messageBoard.receiveMessages.get(messageScope).get((edge[0] = e).vertices(direction).next()))
+ .map((Edge e) -> {
+ edge[0] = e;
+ Vertex vv;
+ if (direction.equals(Direction.IN) || direction.equals(Direction.OUT)) {
+ vv = e.vertices(direction).next();
+ } else {
+ vv = e.outVertex() == this.vertex ? e.inVertex() : e.outVertex();
+ }
+ return this.messageBoard.receiveMessages.get(messageScope).get(vv);
+ })
.filter(q -> null != q)
.flatMap(Queue::stream)
.map(message -> localMessageScope.getEdgeFunction().apply(message, edge[0]))
[06/12] tinkerpop git commit: Updating kitchen sink graph
Posted by sp...@apache.org.
Updating kitchen sink graph
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/febe0ac8
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/febe0ac8
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/febe0ac8
Branch: refs/heads/TINKERPOP-1862
Commit: febe0ac8ecdf1828233017864b629a644c7260a8
Parents: 5467a33
Author: Graff, Philip B <Ph...@jhuapl.edu>
Authored: Sun Feb 25 12:22:39 2018 -0500
Committer: Graff, Philip B <Ph...@jhuapl.edu>
Committed: Sun Feb 25 12:22:39 2018 -0500
----------------------------------------------------------------------
data/tinkerpop-sink-typed.json | 2 ++
data/tinkerpop-sink-v2d0-typed.json | 2 ++
data/tinkerpop-sink-v2d0.json | 2 ++
data/tinkerpop-sink.json | 2 ++
data/tinkerpop-sink.kryo | Bin 76 -> 291 bytes
5 files changed, 8 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/febe0ac8/data/tinkerpop-sink-typed.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink-typed.json b/data/tinkerpop-sink-typed.json
index f62a717..1bbdcff 100644
--- a/data/tinkerpop-sink-typed.json
+++ b/data/tinkerpop-sink-typed.json
@@ -1 +1,3 @@
{"@class":"java.util.HashMap","id":["java.lang.Long",0],"label":"loops","inE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"outV":["java.lang.Long",0]}]]},"outE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"inV":["java.lang.Long",0]}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",1],"value":"loop"}]]}}
+{"@class":"java.util.HashMap","id":["java.lang.Long",1],"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",6],"outV":["java.lang.Long",1]}]]},"outE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",5],"inV":["java.lang.Long",2]},{"@class":"java.util.HashMap","id":["java.lang.Long",6],"inV":["java.lang.Long",1]}]]},"properties":{"@class":"java.util.HashMap","propertyin":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",3],"value":"a"}]]}}
+{"@class":"java.util.HashMap","id":["java.lang.Long",2],"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",5],"outV":["java.lang.Long",1]}]]},"properties":{"@class":"java.util.HashMap","propertyin":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",4],"value":"b"}]]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/febe0ac8/data/tinkerpop-sink-v2d0-typed.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink-v2d0-typed.json b/data/tinkerpop-sink-v2d0-typed.json
index df22167..ecb5c52 100644
--- a/data/tinkerpop-sink-v2d0-typed.json
+++ b/data/tinkerpop-sink-v2d0-typed.json
@@ -1 +1,3 @@
{"id":{"@type":"g:Int64","@value":0},"label":"loops","inE":{"self":[{"id":{"@type":"g:Int64","@value":2},"outV":{"@type":"g:Int64","@value":0}}]},"outE":{"self":[{"id":{"@type":"g:Int64","@value":2},"inV":{"@type":"g:Int64","@value":0}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":1},"value":"loop"}]}}
+{"id":{"@type":"g:Int64","@value":1},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int64","@value":6},"outV":{"@type":"g:Int64","@value":1}}]},"outE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int64","@value":5},"inV":{"@type":"g:Int64","@value":2}},{"id":{"@type":"g:Int64","@value":6},"inV":{"@type":"g:Int64","@value":1}}]},"properties":{"propertyin":[{"id":{"@type":"g:Int64","@value":3},"value":"a"}]}}
+{"id":{"@type":"g:Int64","@value":2},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int64","@value":5},"outV":{"@type":"g:Int64","@value":1}}]},"properties":{"propertyin":[{"id":{"@type":"g:Int64","@value":4},"value":"b"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/febe0ac8/data/tinkerpop-sink-v2d0.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink-v2d0.json b/data/tinkerpop-sink-v2d0.json
index 39496ba..1eade99 100644
--- a/data/tinkerpop-sink-v2d0.json
+++ b/data/tinkerpop-sink-v2d0.json
@@ -1 +1,3 @@
{"id":0,"label":"loops","inE":{"self":[{"id":2,"outV":0}]},"outE":{"self":[{"id":2,"inV":0}]},"properties":{"name":[{"id":1,"value":"loop"}]}}
+{"id":1,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":1}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2},{"id":5,"inV":1}]},"properties":{"propertyin":[{"id":0,"value":"a"}]}}
+{"id":2,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":1}]},"properties":{"propertyin":[{"id":3,"value":"b"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/febe0ac8/data/tinkerpop-sink.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink.json b/data/tinkerpop-sink.json
index 39496ba..1eade99 100644
--- a/data/tinkerpop-sink.json
+++ b/data/tinkerpop-sink.json
@@ -1 +1,3 @@
{"id":0,"label":"loops","inE":{"self":[{"id":2,"outV":0}]},"outE":{"self":[{"id":2,"inV":0}]},"properties":{"name":[{"id":1,"value":"loop"}]}}
+{"id":1,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":1}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2},{"id":5,"inV":1}]},"properties":{"propertyin":[{"id":0,"value":"a"}]}}
+{"id":2,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":1}]},"properties":{"propertyin":[{"id":3,"value":"b"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/febe0ac8/data/tinkerpop-sink.kryo
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink.kryo b/data/tinkerpop-sink.kryo
index 9a26e15..5f5da45 100644
Binary files a/data/tinkerpop-sink.kryo and b/data/tinkerpop-sink.kryo differ
[11/12] tinkerpop git commit: TINKERPOP-1862 Fix Messenger
implementations for Spark/Giraph handling BOTH
Posted by sp...@apache.org.
TINKERPOP-1862 Fix Messenger implementations for Spark/Giraph handling BOTH
These now behave like TinkerMessenger and in the case of BOTH pass the message to the opposite vertex in the StarGraph
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/26a5770e
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/26a5770e
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/26a5770e
Branch: refs/heads/TINKERPOP-1862
Commit: 26a5770efb288d60150cf9db60a5dd67568179f2
Parents: 027ae27
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Mar 2 11:29:57 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Mar 2 11:29:57 2018 -0500
----------------------------------------------------------------------
.../process/computer/GiraphMessenger.java | 14 +-
.../gremlin/process/ProcessComputerSuite.java | 168 +++++++++----------
.../process/computer/GraphComputerTest.java | 41 +++--
.../computer/util/ComputerSubmissionHelper.java | 2 +-
.../spark/process/computer/SparkMessenger.java | 12 +-
.../spark/structure/io/ToyGraphInputRDD.java | 2 +
6 files changed, 136 insertions(+), 103 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/26a5770e/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphMessenger.java
----------------------------------------------------------------------
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphMessenger.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphMessenger.java
index 03818b2..36e641e 100644
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphMessenger.java
+++ b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphMessenger.java
@@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import java.util.Iterator;
@@ -57,10 +58,19 @@ public final class GiraphMessenger<M> implements Messenger<M> {
final MessageScope.Local<M> localMessageScope = (MessageScope.Local) messageScope;
final Traversal.Admin<Vertex, Edge> incidentTraversal = GiraphMessenger.setVertexStart(localMessageScope.getIncidentTraversal().get().asAdmin(), this.giraphVertex.getValue().get());
final Direction direction = GiraphMessenger.getOppositeDirection(incidentTraversal);
- incidentTraversal.forEachRemaining(edge ->
+
+ // handle processing for BOTH given TINKERPOP-1862 where the target of the message is the one opposite
+ // the current vertex
+ incidentTraversal.forEachRemaining(edge -> {
+ if (direction.equals(Direction.IN) || direction.equals(Direction.OUT))
this.giraphComputation.sendMessage(
new ObjectWritable<>(edge.vertices(direction).next().id()),
- new ObjectWritable<>(localMessageScope.getEdgeFunction().apply(message, edge))));
+ new ObjectWritable<>(localMessageScope.getEdgeFunction().apply(message, edge)));
+ else
+ this.giraphComputation.sendMessage(
+ new ObjectWritable<>(edge instanceof StarGraph.StarOutEdge ? edge.inVertex().id() : edge.outVertex().id()),
+ new ObjectWritable<>(localMessageScope.getEdgeFunction().apply(message, edge)));
+ });
} else {
final MessageScope.Global globalMessageScope = (MessageScope.Global) messageScope;
globalMessageScope.vertices().forEach(vertex ->
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/26a5770e/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
index 1d69a76..e1c97df 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
@@ -117,90 +117,90 @@ public class ProcessComputerSuite extends AbstractGremlinSuite {
GraphComputerTest.class,
// branch
- BranchTest.Traversals.class,
- ChooseTest.Traversals.class,
- OptionalTest.Traversals.class,
- LocalTest.Traversals.class,
- RepeatTest.Traversals.class,
- UnionTest.Traversals.class,
-
- // filter
- AndTest.Traversals.class,
- CoinTest.Traversals.class,
- CyclicPathTest.Traversals.class,
- DedupTest.Traversals.class,
- FilterTest.Traversals.class,
- HasTest.Traversals.class,
- IsTest.Traversals.class,
- OrTest.Traversals.class,
- RangeTest.Traversals.class,
- SampleTest.Traversals.class,
- SimplePathTest.Traversals.class,
- TailTest.Traversals.class,
- WhereTest.Traversals.class,
-
- // map
- CoalesceTest.Traversals.class,
- ConstantTest.Traversals.class,
- CountTest.Traversals.class,
- FlatMapTest.Traversals.class,
- FoldTest.Traversals.class,
- GraphTest.Traversals.class,
- LoopsTest.Traversals.class,
- MapTest.Traversals.class,
- MapKeysTest.Traversals.class,
- MapValuesTest.Traversals.class,
- MatchTest.CountMatchTraversals.class,
- MatchTest.GreedyMatchTraversals.class,
- MaxTest.Traversals.class,
- MeanTest.Traversals.class,
- MinTest.Traversals.class,
- SumTest.Traversals.class,
- OrderTest.Traversals.class,
- PageRankTest.Traversals.class,
- PathTest.Traversals.class,
- PeerPressureTest.Traversals.class,
- ProfileTest.Traversals.class,
- ProjectTest.Traversals.class,
- ProgramTest.Traversals.class,
- PropertiesTest.Traversals.class,
- SelectTest.Traversals.class,
- UnfoldTest.Traversals.class,
- ValueMapTest.Traversals.class,
- VertexTest.Traversals.class,
-
- // sideEffect
- AddEdgeTest.Traversals.class,
- AggregateTest.Traversals.class,
- ExplainTest.Traversals.class,
- GroupTest.Traversals.class,
- GroupTestV3d0.Traversals.class,
- GroupCountTest.Traversals.class,
- InjectTest.Traversals.class,
- ProfileTest.Traversals.class,
- SackTest.Traversals.class,
- SideEffectCapTest.Traversals.class,
- SideEffectTest.Traversals.class,
- StoreTest.Traversals.class,
- SubgraphTest.Traversals.class,
- TreeTest.Traversals.class,
-
- // compliance
- ComplexTest.Traversals.class,
- TraversalInterruptionComputerTest.class,
-
- // algorithms
- PageRankVertexProgramTest.class,
- PeerPressureVertexProgramTest.class,
- BulkLoaderVertexProgramTest.class,
- BulkDumperVertexProgramTest.class,
-
- // creations
- TranslationStrategyProcessTest.class,
-
- // decorations
- ReadOnlyStrategyProcessTest.class,
- SubgraphStrategyProcessTest.class
+// BranchTest.Traversals.class,
+// ChooseTest.Traversals.class,
+// OptionalTest.Traversals.class,
+// LocalTest.Traversals.class,
+// RepeatTest.Traversals.class,
+// UnionTest.Traversals.class,
+//
+// // filter
+// AndTest.Traversals.class,
+// CoinTest.Traversals.class,
+// CyclicPathTest.Traversals.class,
+// DedupTest.Traversals.class,
+// FilterTest.Traversals.class,
+// HasTest.Traversals.class,
+// IsTest.Traversals.class,
+// OrTest.Traversals.class,
+// RangeTest.Traversals.class,
+// SampleTest.Traversals.class,
+// SimplePathTest.Traversals.class,
+// TailTest.Traversals.class,
+// WhereTest.Traversals.class,
+//
+// // map
+// CoalesceTest.Traversals.class,
+// ConstantTest.Traversals.class,
+// CountTest.Traversals.class,
+// FlatMapTest.Traversals.class,
+// FoldTest.Traversals.class,
+// GraphTest.Traversals.class,
+// LoopsTest.Traversals.class,
+// MapTest.Traversals.class,
+// MapKeysTest.Traversals.class,
+// MapValuesTest.Traversals.class,
+// MatchTest.CountMatchTraversals.class,
+// MatchTest.GreedyMatchTraversals.class,
+// MaxTest.Traversals.class,
+// MeanTest.Traversals.class,
+// MinTest.Traversals.class,
+// SumTest.Traversals.class,
+// OrderTest.Traversals.class,
+// PageRankTest.Traversals.class,
+// PathTest.Traversals.class,
+// PeerPressureTest.Traversals.class,
+// ProfileTest.Traversals.class,
+// ProjectTest.Traversals.class,
+// ProgramTest.Traversals.class,
+// PropertiesTest.Traversals.class,
+// SelectTest.Traversals.class,
+// UnfoldTest.Traversals.class,
+// ValueMapTest.Traversals.class,
+// VertexTest.Traversals.class,
+//
+// // sideEffect
+// AddEdgeTest.Traversals.class,
+// AggregateTest.Traversals.class,
+// ExplainTest.Traversals.class,
+// GroupTest.Traversals.class,
+// GroupTestV3d0.Traversals.class,
+// GroupCountTest.Traversals.class,
+// InjectTest.Traversals.class,
+// ProfileTest.Traversals.class,
+// SackTest.Traversals.class,
+// SideEffectCapTest.Traversals.class,
+// SideEffectTest.Traversals.class,
+// StoreTest.Traversals.class,
+// SubgraphTest.Traversals.class,
+// TreeTest.Traversals.class,
+//
+// // compliance
+// ComplexTest.Traversals.class,
+// TraversalInterruptionComputerTest.class,
+//
+// // algorithms
+// PageRankVertexProgramTest.class,
+// PeerPressureVertexProgramTest.class,
+// BulkLoaderVertexProgramTest.class,
+// BulkDumperVertexProgramTest.class,
+//
+// // creations
+// TranslationStrategyProcessTest.class,
+//
+// // decorations
+// ReadOnlyStrategyProcessTest.class,
+// SubgraphStrategyProcessTest.class
};
/**
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/26a5770e/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
index 9157571..f9e79ae 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
@@ -2726,23 +2726,27 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
runMPTest(Direction.BOTH).forEachRemaining(v -> {
vertexPropertyChecks(v);
final String in = v.value(VertexProgramR.PROPERTY_IN);
- if (in.equals("a"))
- assertEquals("aab", v.value(VertexProgramR.PROPERTY_OUT).toString());
- else if (in.equals("b"))
- assertEquals("a", v.value(VertexProgramR.PROPERTY_OUT).toString());
- else
- throw new IllegalStateException("This vertex should not exist: " + VertexProgramR.PROPERTY_IN
- + "=" + String.valueOf(in));
+ switch (in) {
+ case "a":
+ assertEquals("aab", v.value(VertexProgramR.PROPERTY_OUT).toString());
+ break;
+ case "b":
+ assertEquals("a", v.value(VertexProgramR.PROPERTY_OUT).toString());
+ break;
+ default:
+ throw new IllegalStateException("This vertex should not exist: " + VertexProgramR.PROPERTY_IN
+ + "=" + String.valueOf(in));
+ }
});
}
- private GraphTraversal<Vertex, Vertex> runMPTest(Direction direction) throws Exception {
+ private GraphTraversal<Vertex, Vertex> runMPTest(final Direction direction) throws Exception {
final VertexProgramR svp = VertexProgramR.build().direction(direction).create();
final ComputerResult result = graphProvider.getGraphComputer(graph).program(svp).vertices(__.hasLabel(VertexProgramR.VERTEX_LABEL)).submit().get();
return result.graph().traversal().V().hasLabel(VertexProgramR.VERTEX_LABEL);
}
- private static void vertexPropertyChecks(Vertex v) {
+ private static void vertexPropertyChecks(final Vertex v) {
assertEquals(2, v.keys().size());
assertTrue(v.keys().contains(VertexProgramR.PROPERTY_IN));
assertTrue(v.keys().contains(VertexProgramR.PROPERTY_OUT));
@@ -2757,6 +2761,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
private static final String VERTEX_LABEL = "message_passing_test";
private static final String DIRECTION_CFG_KEY = SIMPLE_VERTEX_PROGRAM_CFG_PREFIX + ".direction";
+ private Direction direction;
private final MessageScope.Local<String> inMessageScope = MessageScope.Local.of(__::inE);
private final MessageScope.Local<String> outMessageScope = MessageScope.Local.of(__::outE);
private final MessageScope.Local<String> bothMessageScope = MessageScope.Local.of(__::bothE);
@@ -2774,7 +2779,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
@Override
public void loadState(final Graph graph, final Configuration configuration) {
- Direction direction = Direction.valueOf(configuration.getString(DIRECTION_CFG_KEY));
+ direction = Direction.valueOf(configuration.getString(DIRECTION_CFG_KEY));
switch (direction) {
case IN:
this.messageScope = this.inMessageScope;
@@ -2791,27 +2796,33 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
}
@Override
- public void setup(Memory memory) {
+ public void storeState(final Configuration configuration) {
+ VertexProgram.super.storeState(configuration);
+ configuration.setProperty(DIRECTION_CFG_KEY, direction.name());
+ }
+
+ @Override
+ public void setup(final Memory memory) {
}
@Override
- public void execute(Vertex vertex, Messenger<String> messenger, Memory memory) {
+ public void execute(final Vertex vertex, final Messenger<String> messenger, final Memory memory) {
if (memory.isInitialIteration()) {
messenger.sendMessage(this.messageScope, vertex.value(PROPERTY_IN).toString());
} else {
- char[] composite = IteratorUtils.reduce(messenger.receiveMessages(), "", (a, b) -> a + b).toCharArray();
+ final char[] composite = IteratorUtils.reduce(messenger.receiveMessages(), "", (a, b) -> a + b).toCharArray();
Arrays.sort(composite);
vertex.property(PROPERTY_OUT, new String(composite));
}
}
@Override
- public boolean terminate(Memory memory) {
+ public boolean terminate(final Memory memory) {
return !memory.isInitialIteration();
}
@Override
- public Set<MessageScope> getMessageScopes(Memory memory) {
+ public Set<MessageScope> getMessageScopes(final Memory memory) {
return Collections.singleton(this.messageScope);
}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/26a5770e/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/util/ComputerSubmissionHelper.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/util/ComputerSubmissionHelper.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/util/ComputerSubmissionHelper.java
index 1229440..e010bee 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/util/ComputerSubmissionHelper.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/util/ComputerSubmissionHelper.java
@@ -66,7 +66,7 @@ public final class ComputerSubmissionHelper {
try {
submissionExecutor = Executors.newSingleThreadExecutor(runnable -> {
- Thread t = new Thread(threadGroup, runnable, threadName + "-TP-" + threadNameSuffix);
+ final Thread t = new Thread(threadGroup, runnable, threadName + "-TP-" + threadNameSuffix);
t.setContextClassLoader(classLoader);
return t;
});
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/26a5770e/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkMessenger.java
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkMessenger.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkMessenger.java
index 53a755c..77df48b 100644
--- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkMessenger.java
+++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkMessenger.java
@@ -26,6 +26,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import scala.Tuple2;
@@ -63,7 +64,16 @@ public final class SparkMessenger<M> implements Messenger<M> {
final MessageScope.Local<M> localMessageScope = (MessageScope.Local) messageScope;
final Traversal.Admin<Vertex, Edge> incidentTraversal = SparkMessenger.setVertexStart(localMessageScope.getIncidentTraversal().get().asAdmin(), this.vertex);
final Direction direction = SparkMessenger.getOppositeDirection(incidentTraversal);
- incidentTraversal.forEachRemaining(edge -> this.outgoingMessages.add(new Tuple2<>(edge.vertices(direction).next().id(), localMessageScope.getEdgeFunction().apply(message, edge))));
+
+ // handle processing for BOTH given TINKERPOP-1862 where the target of the message is the one opposite
+ // the current vertex
+ incidentTraversal.forEachRemaining(edge -> {
+ if (direction.equals(Direction.IN) || direction.equals(Direction.OUT))
+ this.outgoingMessages.add(new Tuple2<>(edge.vertices(direction).next().id(), localMessageScope.getEdgeFunction().apply(message, edge)));
+ else
+ this.outgoingMessages.add(new Tuple2<>(edge instanceof StarGraph.StarOutEdge ? edge.inVertex().id() : edge.outVertex().id(), localMessageScope.getEdgeFunction().apply(message, edge)));
+
+ });
} else {
((MessageScope.Global) messageScope).vertices().forEach(v -> this.outgoingMessages.add(new Tuple2<>(v.id(), message)));
}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/26a5770e/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/ToyGraphInputRDD.java
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/ToyGraphInputRDD.java b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/ToyGraphInputRDD.java
index 4cd8cea..72b5b9a 100644
--- a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/ToyGraphInputRDD.java
+++ b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/ToyGraphInputRDD.java
@@ -55,6 +55,8 @@ public final class ToyGraphInputRDD implements InputRDD {
vertices = IteratorUtils.list(IteratorUtils.map(TinkerFactory.createClassic().vertices(), VertexWritable::new));
else if (configuration.getString(Constants.GREMLIN_HADOOP_INPUT_LOCATION).contains("crew"))
vertices = IteratorUtils.list(IteratorUtils.map(TinkerFactory.createTheCrew().vertices(), VertexWritable::new));
+ else if (configuration.getString(Constants.GREMLIN_HADOOP_INPUT_LOCATION).contains("sink"))
+ vertices = IteratorUtils.list(IteratorUtils.map(TinkerFactory.createKitchenSink().vertices(), VertexWritable::new));
else if (configuration.getString(Constants.GREMLIN_HADOOP_INPUT_LOCATION).contains("grateful")) {
try {
final Graph graph = TinkerGraph.open();
[08/12] tinkerpop git commit: Revert "Updating kitchen sink graph"
Posted by sp...@apache.org.
Revert "Updating kitchen sink graph"
This reverts commit febe0ac8ecdf1828233017864b629a644c7260a8.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b0b124b8
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b0b124b8
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b0b124b8
Branch: refs/heads/TINKERPOP-1862
Commit: b0b124b84c597079b271adb0dec2044f0c2ec9b3
Parents: f03c4df
Author: Graff, Philip B <Ph...@jhuapl.edu>
Authored: Sun Feb 25 16:15:40 2018 -0500
Committer: Graff, Philip B <Ph...@jhuapl.edu>
Committed: Sun Feb 25 16:15:40 2018 -0500
----------------------------------------------------------------------
data/tinkerpop-sink-typed.json | 2 --
data/tinkerpop-sink-v2d0-typed.json | 2 --
data/tinkerpop-sink-v2d0.json | 2 --
data/tinkerpop-sink.json | 2 --
data/tinkerpop-sink.kryo | Bin 291 -> 76 bytes
5 files changed, 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b0b124b8/data/tinkerpop-sink-typed.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink-typed.json b/data/tinkerpop-sink-typed.json
index 1bbdcff..f62a717 100644
--- a/data/tinkerpop-sink-typed.json
+++ b/data/tinkerpop-sink-typed.json
@@ -1,3 +1 @@
{"@class":"java.util.HashMap","id":["java.lang.Long",0],"label":"loops","inE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"outV":["java.lang.Long",0]}]]},"outE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"inV":["java.lang.Long",0]}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",1],"value":"loop"}]]}}
-{"@class":"java.util.HashMap","id":["java.lang.Long",1],"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",6],"outV":["java.lang.Long",1]}]]},"outE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",5],"inV":["java.lang.Long",2]},{"@class":"java.util.HashMap","id":["java.lang.Long",6],"inV":["java.lang.Long",1]}]]},"properties":{"@class":"java.util.HashMap","propertyin":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",3],"value":"a"}]]}}
-{"@class":"java.util.HashMap","id":["java.lang.Long",2],"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",5],"outV":["java.lang.Long",1]}]]},"properties":{"@class":"java.util.HashMap","propertyin":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",4],"value":"b"}]]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b0b124b8/data/tinkerpop-sink-v2d0-typed.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink-v2d0-typed.json b/data/tinkerpop-sink-v2d0-typed.json
index ecb5c52..df22167 100644
--- a/data/tinkerpop-sink-v2d0-typed.json
+++ b/data/tinkerpop-sink-v2d0-typed.json
@@ -1,3 +1 @@
{"id":{"@type":"g:Int64","@value":0},"label":"loops","inE":{"self":[{"id":{"@type":"g:Int64","@value":2},"outV":{"@type":"g:Int64","@value":0}}]},"outE":{"self":[{"id":{"@type":"g:Int64","@value":2},"inV":{"@type":"g:Int64","@value":0}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":1},"value":"loop"}]}}
-{"id":{"@type":"g:Int64","@value":1},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int64","@value":6},"outV":{"@type":"g:Int64","@value":1}}]},"outE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int64","@value":5},"inV":{"@type":"g:Int64","@value":2}},{"id":{"@type":"g:Int64","@value":6},"inV":{"@type":"g:Int64","@value":1}}]},"properties":{"propertyin":[{"id":{"@type":"g:Int64","@value":3},"value":"a"}]}}
-{"id":{"@type":"g:Int64","@value":2},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int64","@value":5},"outV":{"@type":"g:Int64","@value":1}}]},"properties":{"propertyin":[{"id":{"@type":"g:Int64","@value":4},"value":"b"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b0b124b8/data/tinkerpop-sink-v2d0.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink-v2d0.json b/data/tinkerpop-sink-v2d0.json
index 1eade99..39496ba 100644
--- a/data/tinkerpop-sink-v2d0.json
+++ b/data/tinkerpop-sink-v2d0.json
@@ -1,3 +1 @@
{"id":0,"label":"loops","inE":{"self":[{"id":2,"outV":0}]},"outE":{"self":[{"id":2,"inV":0}]},"properties":{"name":[{"id":1,"value":"loop"}]}}
-{"id":1,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":1}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2},{"id":5,"inV":1}]},"properties":{"propertyin":[{"id":0,"value":"a"}]}}
-{"id":2,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":1}]},"properties":{"propertyin":[{"id":3,"value":"b"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b0b124b8/data/tinkerpop-sink.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink.json b/data/tinkerpop-sink.json
index 1eade99..39496ba 100644
--- a/data/tinkerpop-sink.json
+++ b/data/tinkerpop-sink.json
@@ -1,3 +1 @@
{"id":0,"label":"loops","inE":{"self":[{"id":2,"outV":0}]},"outE":{"self":[{"id":2,"inV":0}]},"properties":{"name":[{"id":1,"value":"loop"}]}}
-{"id":1,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":1}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2},{"id":5,"inV":1}]},"properties":{"propertyin":[{"id":0,"value":"a"}]}}
-{"id":2,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":1}]},"properties":{"propertyin":[{"id":3,"value":"b"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b0b124b8/data/tinkerpop-sink.kryo
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink.kryo b/data/tinkerpop-sink.kryo
index 5f5da45..9a26e15 100644
Binary files a/data/tinkerpop-sink.kryo and b/data/tinkerpop-sink.kryo differ
[07/12] tinkerpop git commit: Updating message passing tests to use
kitchen sink
Posted by sp...@apache.org.
Updating message passing tests to use kitchen sink
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f03c4df4
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f03c4df4
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f03c4df4
Branch: refs/heads/TINKERPOP-1862
Commit: f03c4df45473bafcf95d47f34467479f89af73a1
Parents: febe0ac
Author: Graff, Philip B <Ph...@jhuapl.edu>
Authored: Sun Feb 25 12:35:43 2018 -0500
Committer: Graff, Philip B <Ph...@jhuapl.edu>
Committed: Sun Feb 25 12:35:43 2018 -0500
----------------------------------------------------------------------
.../process/computer/GraphComputerTest.java | 21 ++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f03c4df4/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
index da0e53f..4cbe584 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
@@ -69,6 +69,7 @@ import java.util.concurrent.Future;
import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.GRATEFUL;
import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
+import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.SINK;
import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.outE;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -2688,8 +2689,9 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
///////////////////////////////////
@Test
+ @LoadGraphWith(SINK)
public void testMessagePassingIn() throws Exception {
- runTest(Direction.IN).forEachRemaining(v -> {
+ runMPTest(Direction.IN).forEachRemaining(v -> {
vertexPropertyChecks(v);
final String in = v.value(VertexProgramR.PROPERTY_IN);
if (in.equals("a"))
@@ -2703,8 +2705,9 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
}
@Test
+ @LoadGraphWith(SINK)
public void testMessagePassingOut() throws Exception {
- runTest(Direction.OUT).forEachRemaining(v -> {
+ runMPTest(Direction.OUT).forEachRemaining(v -> {
vertexPropertyChecks(v);
final String in = v.value(VertexProgramR.PROPERTY_IN);
if (in.equals("a"))
@@ -2718,8 +2721,9 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
}
@Test
+ @LoadGraphWith(SINK)
public void testMessagePassingBoth() throws Exception {
- runTest(Direction.BOTH).forEachRemaining(v -> {
+ runMPTest(Direction.BOTH).forEachRemaining(v -> {
vertexPropertyChecks(v);
final String in = v.value(VertexProgramR.PROPERTY_IN);
if (in.equals("a"))
@@ -2732,14 +2736,10 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
});
}
- private GraphTraversal<Vertex, Vertex> runTest(Direction direction) throws Exception {
- final Vertex a = graph.addVertex(VertexProgramR.PROPERTY_IN, "a");
- final Vertex b = graph.addVertex(VertexProgramR.PROPERTY_IN, "b");
- a.addEdge("edge", b);
- a.addEdge("edge", a);
+ private GraphTraversal<Vertex, Vertex> runMPTest(Direction direction) throws Exception {
final VertexProgramR svp = VertexProgramR.build().direction(direction).create();
- final ComputerResult result = graphProvider.getGraphComputer(graph).program(svp).submit().get();
- return result.graph().traversal().V();
+ final ComputerResult result = graphProvider.getGraphComputer(graph).program(svp).vertices(__.hasLabel(VertexProgramR.VERTEX_LABEL)).submit().get();
+ return result.graph().traversal().V().hasLabel(VertexProgramR.VERTEX_LABEL);
}
private static void vertexPropertyChecks(Vertex v) {
@@ -2754,6 +2754,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
private static final String SIMPLE_VERTEX_PROGRAM_CFG_PREFIX = "gremlin.simpleVertexProgram";
private static final String PROPERTY_OUT = "propertyout";
private static final String PROPERTY_IN = "propertyin";
+ private static final String VERTEX_LABEL = "message_passing_test";
private static final String DIRECTION_CFG_KEY = SIMPLE_VERTEX_PROGRAM_CFG_PREFIX + ".direction";
private final MessageScope.Local<String> inMessageScope = MessageScope.Local.of(__::inE);
[02/12] tinkerpop git commit: Adding simple graph computer test of
proper message passing in all 3 directions
Posted by sp...@apache.org.
Adding simple graph computer test of proper message passing in all 3 directions
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/80c0b846
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/80c0b846
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/80c0b846
Branch: refs/heads/TINKERPOP-1862
Commit: 80c0b8465fe9bb6ddbe4522a36304c7ba054e909
Parents: f02ea33
Author: Graff, Philip B <Ph...@jhuapl.edu>
Authored: Sat Jan 13 21:32:29 2018 -0500
Committer: Graff, Philip B <Ph...@jhuapl.edu>
Committed: Sun Feb 25 10:44:15 2018 -0500
----------------------------------------------------------------------
.../process/computer/GraphComputerTest.java | 175 +++++++++++++++++++
1 file changed, 175 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/80c0b846/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
index 8c846d5..c34c2dc 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
@@ -34,6 +34,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Operator;
import org.apache.tinkerpop.gremlin.process.traversal.P;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyPath;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.VerificationException;
@@ -2683,4 +2684,178 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
};
}
}
+
+ ///////////////////////////////////
+
+ @Test
+ public void testMessagePassingIn() throws Exception {
+ runTest(Direction.IN).forEachRemaining(v -> {
+ String in = v.value("propin").toString();
+ if (in.equals("a")) {
+ assertEquals("ab", v.value("propout").toString());
+ } else {
+ assertEquals("", v.value("propout").toString());
+ }
+ });
+ }
+
+ @Test
+ public void testMessagePassingOut() throws Exception {
+ runTest(Direction.OUT).forEachRemaining(v -> {
+ String in = v.value("propin").toString();
+ if (in.equals("a")) {
+ assertEquals("a", v.value("propout").toString());
+ } else {
+ assertEquals("a", v.value("propout").toString());
+ }
+ });
+ }
+
+ @Test
+ public void testMessagePassingBoth() throws Exception {
+ runTest(Direction.BOTH).forEachRemaining(v -> {
+ String in = v.value("propin").toString();
+ if (in.equals("a")) {
+ assertEquals("aab", v.value("propout").toString());
+ } else {
+ assertEquals("a", v.value("propout").toString());
+ }
+ });
+ }
+
+ private GraphTraversal<Vertex, Vertex> runTest(Direction direction) throws Exception {
+ g.addV().property("propin", "a").as("a")
+ .addV().property("propin", "b").as("b")
+ .addE("edge").from("a").to("b").addE("edge").from("a").to("a").iterate();
+ final VertexProgramR svp = VertexProgramR.build().propertyIn("propin")
+ .propertyOut("propout").direction(direction).create();
+ final ComputerResult result = graphProvider.getGraphComputer(graph).program(svp).submit().get();
+ return result.graph().traversal().V();
+ }
+
+ private static class VertexProgramR implements VertexProgram<String> {
+ private static final String SIMPLE_VERTEX_PROGRAM_CFG_PREFIX = "gremlin.simpleVertexProgram";
+ private static final String PROPERTY_OUT_CFG_KEY = SIMPLE_VERTEX_PROGRAM_CFG_PREFIX + ".propertyout";
+ private static final String PROPERTY_IN_CFG_KEY = SIMPLE_VERTEX_PROGRAM_CFG_PREFIX + ".propertyin";
+ private static final String DIRECTION_CFG_KEY = SIMPLE_VERTEX_PROGRAM_CFG_PREFIX + ".direction";
+
+ private final MessageScope.Local<String> inMessageScope = MessageScope.Local.of(__::inE);
+ private final MessageScope.Local<String> outMessageScope = MessageScope.Local.of(__::outE);
+ private final MessageScope.Local<String> bothMessageScope = MessageScope.Local.of(__::bothE);
+ private MessageScope.Local<String> messageScope;
+ private Set<VertexComputeKey> vertexComputeKeys;
+
+ private String propertyout, propertyin;
+
+ /**
+ * Clones this vertex program.
+ *
+ * @return a clone of this vertex program
+ */
+ public VertexProgramR clone() { return this; }
+
+ @Override
+ public void loadState(final Graph graph, final Configuration configuration) {
+ this.propertyout = configuration.getString(PROPERTY_OUT_CFG_KEY);
+ this.propertyin = configuration.getString(PROPERTY_IN_CFG_KEY);
+ Direction direction = Direction.valueOf(configuration.getString(DIRECTION_CFG_KEY));
+ switch (direction) {
+ case IN:
+ this.messageScope = this.inMessageScope;
+ break;
+ case OUT:
+ this.messageScope = this.outMessageScope;
+ break;
+ default:
+ this.messageScope = this.bothMessageScope;
+ break;
+ }
+ this.vertexComputeKeys = new HashSet<>(Arrays.asList(VertexComputeKey.of(this.propertyout, false),
+ VertexComputeKey.of(this.propertyin, false)));
+ }
+
+ @Override
+ public void setup(Memory memory) {
+ }
+
+ @Override
+ public void execute(Vertex vertex, Messenger<String> messenger, Memory memory) {
+ if (memory.isInitialIteration()) {
+ messenger.sendMessage(this.messageScope, vertex.value(this.propertyin).toString());
+ } else {
+ char[] composite = IteratorUtils.reduce(messenger.receiveMessages(), "", (a, b) -> a + b).toCharArray();
+ Arrays.sort(composite);
+ vertex.property(this.propertyout, new String(composite));
+ }
+ }
+
+ @Override
+ public boolean terminate(Memory memory) {
+ return !memory.isInitialIteration();
+ }
+
+ @Override
+ public Set<MessageScope> getMessageScopes(Memory memory) {
+ return Collections.singleton(this.messageScope);
+ }
+
+ @Override
+ public GraphComputer.ResultGraph getPreferredResultGraph() {
+ return GraphComputer.ResultGraph.NEW;
+ }
+
+ @Override
+ public GraphComputer.Persist getPreferredPersist() {
+ return GraphComputer.Persist.VERTEX_PROPERTIES;
+ }
+
+ @Override
+ public Set<VertexComputeKey> getVertexComputeKeys() {
+ return this.vertexComputeKeys;
+ }
+
+ @Override
+ public Set<MemoryComputeKey> getMemoryComputeKeys() {
+ return Collections.emptySet();
+ }
+
+ public static Builder build() {
+ return new Builder();
+ }
+
+ static class Builder extends AbstractVertexProgramBuilder<Builder> {
+
+ private Builder() {
+ super(VertexProgramR.class);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public VertexProgramR create(final Graph graph) {
+ if (graph != null) {
+ ConfigurationUtils.append(graph.configuration().subset(SIMPLE_VERTEX_PROGRAM_CFG_PREFIX), configuration);
+ }
+ return (VertexProgramR) VertexProgram.createVertexProgram(graph, configuration);
+ }
+
+ public VertexProgramR create() {
+ return create(null);
+ }
+
+ public Builder propertyOut(final String name) {
+ configuration.setProperty(PROPERTY_OUT_CFG_KEY, name);
+ return this;
+ }
+
+ public Builder propertyIn(final String name) {
+ configuration.setProperty(PROPERTY_IN_CFG_KEY, name);
+ return this;
+ }
+
+ public Builder direction(final Direction direction) {
+ configuration.setProperty(DIRECTION_CFG_KEY, direction.toString());
+ return this;
+ }
+ }
+ }
}
[04/12] tinkerpop git commit: Additional check. Tests still fail -
but I think this is a problem with the implementations, not the test.
Posted by sp...@apache.org.
Additional check. Tests still fail - but I think this is a problem with the implementations, not the test.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/153238b2
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/153238b2
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/153238b2
Branch: refs/heads/TINKERPOP-1862
Commit: 153238b2a8a3fc5e051251662ef6ab80f72c659f
Parents: 750677c
Author: Graff, Philip B <Ph...@jhuapl.edu>
Authored: Sun Jan 14 01:01:17 2018 -0500
Committer: Graff, Philip B <Ph...@jhuapl.edu>
Committed: Sun Feb 25 10:44:40 2018 -0500
----------------------------------------------------------------------
.../tinkerpop/gremlin/process/computer/GraphComputerTest.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/153238b2/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
index 0e8d06a..785f03d 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
@@ -2785,9 +2785,11 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
case OUT:
this.messageScope = this.outMessageScope;
break;
- default:
+ case BOTH:
this.messageScope = this.bothMessageScope;
break;
+ default:
+ throw new IllegalStateException("Should not reach this point!");
}
}
[12/12] tinkerpop git commit: TINKERPOP-1862 Updated changelog
Posted by sp...@apache.org.
TINKERPOP-1862 Updated changelog
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/7956b481
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7956b481
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7956b481
Branch: refs/heads/TINKERPOP-1862
Commit: 7956b481b459a9998401abc8b02322f256a73ae7
Parents: 26a5770
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Mar 2 11:33:21 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Mar 2 11:33:21 2018 -0500
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7956b481/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 60e0ef4..ca1053e 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -29,6 +29,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
* Fixed a bug in `NumberHelper` that led to wrong min/max results if numbers exceeded the Integer limits.
* Delayed setting of the request identifier until `RequestMessage` construction by the builder.
* Improved error messaging for failed serialization and deserialization of request/response messages.
+* Fixed handling of `Direction.BOTH` in `Messenger` implementations to pass the message to the opposite side of the `StarGraph`.
* Removed hardcoded expectation in metrics serialization test suite as different providers may have different outputs.
* Added `IndexedTraverserSet` which indexes on the value of a `Traverser` thus improving performance when used.
* Utilized `IndexedTraverserSet` in `TraversalVertexProgram` to avoid extra iteration when doing `Vertex` lookups.
[03/12] tinkerpop git commit: Test cleanup - hopefully can run now
Posted by sp...@apache.org.
Test cleanup - hopefully can run now
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/750677cf
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/750677cf
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/750677cf
Branch: refs/heads/TINKERPOP-1862
Commit: 750677cf55d7445c3746870d86c6592f6cd3664d
Parents: 80c0b84
Author: Graff, Philip B <Ph...@jhuapl.edu>
Authored: Sat Jan 13 23:49:27 2018 -0500
Committer: Graff, Philip B <Ph...@jhuapl.edu>
Committed: Sun Feb 25 10:44:27 2018 -0500
----------------------------------------------------------------------
.../process/computer/GraphComputerTest.java | 97 +++++++++++---------
1 file changed, 52 insertions(+), 45 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/750677cf/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
index c34c2dc..0e8d06a 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
@@ -2689,63 +2689,84 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
@Test
public void testMessagePassingIn() throws Exception {
- runTest(Direction.IN).forEachRemaining(v -> {
- String in = v.value("propin").toString();
- if (in.equals("a")) {
- assertEquals("ab", v.value("propout").toString());
- } else {
- assertEquals("", v.value("propout").toString());
- }
+ runTest(Direction.BOTH).forEachRemaining(v -> {
+ assertEquals(2, v.keys().size());
+ assertTrue(v.keys().contains(VertexProgramR.PROPERTY_IN));
+ assertTrue(v.keys().contains(VertexProgramR.PROPERTY_OUT));
+ assertEquals(1, IteratorUtils.count(v.values(VertexProgramR.PROPERTY_IN)));
+ assertEquals(1, IteratorUtils.count(v.values(VertexProgramR.PROPERTY_OUT)));
+ final String in = v.value(VertexProgramR.PROPERTY_IN);
+ if (in.equals("a"))
+ assertEquals("ab", v.value(VertexProgramR.PROPERTY_OUT).toString());
+ else if (in.equals("b"))
+ assertEquals("", v.value(VertexProgramR.PROPERTY_OUT).toString());
+ else
+ throw new IllegalStateException("This vertex should not exist: " + VertexProgramR.PROPERTY_IN
+ + "=" + String.valueOf(in));
});
}
@Test
public void testMessagePassingOut() throws Exception {
runTest(Direction.OUT).forEachRemaining(v -> {
- String in = v.value("propin").toString();
- if (in.equals("a")) {
- assertEquals("a", v.value("propout").toString());
- } else {
- assertEquals("a", v.value("propout").toString());
- }
+ assertEquals(2, v.keys().size());
+ assertTrue(v.keys().contains(VertexProgramR.PROPERTY_IN));
+ assertTrue(v.keys().contains(VertexProgramR.PROPERTY_OUT));
+ assertEquals(1, IteratorUtils.count(v.values(VertexProgramR.PROPERTY_IN)));
+ assertEquals(1, IteratorUtils.count(v.values(VertexProgramR.PROPERTY_OUT)));
+ final String in = v.value(VertexProgramR.PROPERTY_IN);
+ if (in.equals("a"))
+ assertEquals("a", v.value(VertexProgramR.PROPERTY_OUT).toString());
+ else if (in.equals("b"))
+ assertEquals("a", v.value(VertexProgramR.PROPERTY_OUT).toString());
+ else
+ throw new IllegalStateException("This vertex should not exist: " + VertexProgramR.PROPERTY_IN
+ + "=" + String.valueOf(in));
});
}
@Test
public void testMessagePassingBoth() throws Exception {
runTest(Direction.BOTH).forEachRemaining(v -> {
- String in = v.value("propin").toString();
- if (in.equals("a")) {
- assertEquals("aab", v.value("propout").toString());
- } else {
- assertEquals("a", v.value("propout").toString());
- }
+ assertEquals(2, v.keys().size());
+ assertTrue(v.keys().contains(VertexProgramR.PROPERTY_IN));
+ assertTrue(v.keys().contains(VertexProgramR.PROPERTY_OUT));
+ assertEquals(1, IteratorUtils.count(v.values(VertexProgramR.PROPERTY_IN)));
+ assertEquals(1, IteratorUtils.count(v.values(VertexProgramR.PROPERTY_OUT)));
+ final String in = v.value(VertexProgramR.PROPERTY_IN);
+ if (in.equals("a"))
+ assertEquals("aab", v.value(VertexProgramR.PROPERTY_OUT).toString());
+ else if (in.equals("b"))
+ assertEquals("a", v.value(VertexProgramR.PROPERTY_OUT).toString());
+ else
+ throw new IllegalStateException("This vertex should not exist: " + VertexProgramR.PROPERTY_IN
+ + "=" + String.valueOf(in));
});
}
private GraphTraversal<Vertex, Vertex> runTest(Direction direction) throws Exception {
- g.addV().property("propin", "a").as("a")
- .addV().property("propin", "b").as("b")
- .addE("edge").from("a").to("b").addE("edge").from("a").to("a").iterate();
- final VertexProgramR svp = VertexProgramR.build().propertyIn("propin")
- .propertyOut("propout").direction(direction).create();
+ final Vertex a = graph.addVertex(VertexProgramR.PROPERTY_IN, "a");
+ final Vertex b = graph.addVertex(VertexProgramR.PROPERTY_IN, "b");
+ a.addEdge("edge", b);
+ a.addEdge("edge", a);
+ final VertexProgramR svp = VertexProgramR.build().direction(direction).create();
final ComputerResult result = graphProvider.getGraphComputer(graph).program(svp).submit().get();
return result.graph().traversal().V();
}
private static class VertexProgramR implements VertexProgram<String> {
private static final String SIMPLE_VERTEX_PROGRAM_CFG_PREFIX = "gremlin.simpleVertexProgram";
- private static final String PROPERTY_OUT_CFG_KEY = SIMPLE_VERTEX_PROGRAM_CFG_PREFIX + ".propertyout";
- private static final String PROPERTY_IN_CFG_KEY = SIMPLE_VERTEX_PROGRAM_CFG_PREFIX + ".propertyin";
+ private static final String PROPERTY_OUT = "propertyout";
+ private static final String PROPERTY_IN = "propertyin";
private static final String DIRECTION_CFG_KEY = SIMPLE_VERTEX_PROGRAM_CFG_PREFIX + ".direction";
private final MessageScope.Local<String> inMessageScope = MessageScope.Local.of(__::inE);
private final MessageScope.Local<String> outMessageScope = MessageScope.Local.of(__::outE);
private final MessageScope.Local<String> bothMessageScope = MessageScope.Local.of(__::bothE);
private MessageScope.Local<String> messageScope;
- private Set<VertexComputeKey> vertexComputeKeys;
-
- private String propertyout, propertyin;
+ private final Set<VertexComputeKey> vertexComputeKeys = new HashSet<>(Arrays.asList(
+ VertexComputeKey.of(VertexProgramR.PROPERTY_OUT, false),
+ VertexComputeKey.of(VertexProgramR.PROPERTY_IN, false)));
/**
* Clones this vertex program.
@@ -2756,8 +2777,6 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
@Override
public void loadState(final Graph graph, final Configuration configuration) {
- this.propertyout = configuration.getString(PROPERTY_OUT_CFG_KEY);
- this.propertyin = configuration.getString(PROPERTY_IN_CFG_KEY);
Direction direction = Direction.valueOf(configuration.getString(DIRECTION_CFG_KEY));
switch (direction) {
case IN:
@@ -2770,8 +2789,6 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
this.messageScope = this.bothMessageScope;
break;
}
- this.vertexComputeKeys = new HashSet<>(Arrays.asList(VertexComputeKey.of(this.propertyout, false),
- VertexComputeKey.of(this.propertyin, false)));
}
@Override
@@ -2781,11 +2798,11 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
@Override
public void execute(Vertex vertex, Messenger<String> messenger, Memory memory) {
if (memory.isInitialIteration()) {
- messenger.sendMessage(this.messageScope, vertex.value(this.propertyin).toString());
+ messenger.sendMessage(this.messageScope, vertex.value(PROPERTY_IN).toString());
} else {
char[] composite = IteratorUtils.reduce(messenger.receiveMessages(), "", (a, b) -> a + b).toCharArray();
Arrays.sort(composite);
- vertex.property(this.propertyout, new String(composite));
+ vertex.property(PROPERTY_OUT, new String(composite));
}
}
@@ -2842,16 +2859,6 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
return create(null);
}
- public Builder propertyOut(final String name) {
- configuration.setProperty(PROPERTY_OUT_CFG_KEY, name);
- return this;
- }
-
- public Builder propertyIn(final String name) {
- configuration.setProperty(PROPERTY_IN_CFG_KEY, name);
- return this;
- }
-
public Builder direction(final Direction direction) {
configuration.setProperty(DIRECTION_CFG_KEY, direction.toString());
return this;
[10/12] tinkerpop git commit: Using "name" instead of "propertyin"
Posted by sp...@apache.org.
Using "name" instead of "propertyin"
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/027ae277
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/027ae277
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/027ae277
Branch: refs/heads/TINKERPOP-1862
Commit: 027ae2771d3c67bb613c525a689fe10123686b45
Parents: 0490a08
Author: Graff, Philip B <Ph...@jhuapl.edu>
Authored: Wed Feb 28 11:38:33 2018 -0500
Committer: Graff, Philip B <Ph...@jhuapl.edu>
Committed: Wed Feb 28 11:38:33 2018 -0500
----------------------------------------------------------------------
data/tinkerpop-sink-typed.json | 4 ++--
data/tinkerpop-sink-v2d0-typed.json | 4 ++--
data/tinkerpop-sink-v2d0.json | 4 ++--
data/tinkerpop-sink.json | 4 ++--
data/tinkerpop-sink.kryo | Bin 300 -> 288 bytes
.../process/computer/GraphComputerTest.java | 2 +-
.../io/graphson/tinkerpop-sink-typed.json | 4 ++--
.../io/graphson/tinkerpop-sink-v2d0-typed.json | 4 ++--
.../structure/io/graphson/tinkerpop-sink-v2d0.json | 4 ++--
.../structure/io/graphson/tinkerpop-sink.json | 4 ++--
.../gremlin/structure/io/gryo/tinkerpop-sink.kryo | Bin 300 -> 288 bytes
.../tinkergraph/structure/TinkerFactory.java | 6 +++---
12 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/027ae277/data/tinkerpop-sink-typed.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink-typed.json b/data/tinkerpop-sink-typed.json
index aae410e..bc56489 100644
--- a/data/tinkerpop-sink-typed.json
+++ b/data/tinkerpop-sink-typed.json
@@ -1,3 +1,3 @@
-{"@class":"java.util.HashMap","id":2000,"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":5,"outV":2000}]]},"outE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":4,"inV":2001},{"@class":"java.util.HashMap","id":5,"inV":2000}]]},"properties":{"@class":"java.util.HashMap","propertyin":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"value":"a"}]]}}
-{"@class":"java.util.HashMap","id":2001,"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":4,"outV":2000}]]},"properties":{"@class":"java.util.HashMap","propertyin":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",3],"value":"b"}]]}}
+{"@class":"java.util.HashMap","id":2000,"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":5,"outV":2000}]]},"outE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":4,"inV":2001},{"@class":"java.util.HashMap","id":5,"inV":2000}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"value":"a"}]]}}
+{"@class":"java.util.HashMap","id":2001,"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":4,"outV":2000}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",3],"value":"b"}]]}}
{"@class":"java.util.HashMap","id":1000,"label":"loops","inE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":1,"outV":1000}]]},"outE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":1,"inV":1000}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",0],"value":"loop"}]]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/027ae277/data/tinkerpop-sink-v2d0-typed.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink-v2d0-typed.json b/data/tinkerpop-sink-v2d0-typed.json
index e90b677..c0844a3 100644
--- a/data/tinkerpop-sink-v2d0-typed.json
+++ b/data/tinkerpop-sink-v2d0-typed.json
@@ -1,3 +1,3 @@
-{"id":{"@type":"g:Int32","@value":2000},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":5},"outV":{"@type":"g:Int32","@value":2000}}]},"outE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":4},"inV":{"@type":"g:Int32","@value":2001}},{"id":{"@type":"g:Int32","@value":5},"inV":{"@type":"g:Int32","@value":2000}}]},"properties":{"propertyin":[{"id":{"@type":"g:Int64","@value":2},"value":"a"}]}}
-{"id":{"@type":"g:Int32","@value":2001},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":4},"outV":{"@type":"g:Int32","@value":2000}}]},"properties":{"propertyin":[{"id":{"@type":"g:Int64","@value":3},"value":"b"}]}}
+{"id":{"@type":"g:Int32","@value":2000},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":5},"outV":{"@type":"g:Int32","@value":2000}}]},"outE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":4},"inV":{"@type":"g:Int32","@value":2001}},{"id":{"@type":"g:Int32","@value":5},"inV":{"@type":"g:Int32","@value":2000}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":2},"value":"a"}]}}
+{"id":{"@type":"g:Int32","@value":2001},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":4},"outV":{"@type":"g:Int32","@value":2000}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":3},"value":"b"}]}}
{"id":{"@type":"g:Int32","@value":1000},"label":"loops","inE":{"self":[{"id":{"@type":"g:Int32","@value":1},"outV":{"@type":"g:Int32","@value":1000}}]},"outE":{"self":[{"id":{"@type":"g:Int32","@value":1},"inV":{"@type":"g:Int32","@value":1000}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"loop"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/027ae277/data/tinkerpop-sink-v2d0.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink-v2d0.json b/data/tinkerpop-sink-v2d0.json
index e6c284e..44fbda9 100644
--- a/data/tinkerpop-sink-v2d0.json
+++ b/data/tinkerpop-sink-v2d0.json
@@ -1,3 +1,3 @@
-{"id":2000,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":2000}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2001},{"id":5,"inV":2000}]},"properties":{"propertyin":[{"id":2,"value":"a"}]}}
-{"id":2001,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":2000}]},"properties":{"propertyin":[{"id":3,"value":"b"}]}}
+{"id":2000,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":2000}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2001},{"id":5,"inV":2000}]},"properties":{"name":[{"id":2,"value":"a"}]}}
+{"id":2001,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":2000}]},"properties":{"name":[{"id":3,"value":"b"}]}}
{"id":1000,"label":"loops","inE":{"self":[{"id":1,"outV":1000}]},"outE":{"self":[{"id":1,"inV":1000}]},"properties":{"name":[{"id":0,"value":"loop"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/027ae277/data/tinkerpop-sink.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink.json b/data/tinkerpop-sink.json
index e6c284e..44fbda9 100644
--- a/data/tinkerpop-sink.json
+++ b/data/tinkerpop-sink.json
@@ -1,3 +1,3 @@
-{"id":2000,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":2000}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2001},{"id":5,"inV":2000}]},"properties":{"propertyin":[{"id":2,"value":"a"}]}}
-{"id":2001,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":2000}]},"properties":{"propertyin":[{"id":3,"value":"b"}]}}
+{"id":2000,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":2000}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2001},{"id":5,"inV":2000}]},"properties":{"name":[{"id":2,"value":"a"}]}}
+{"id":2001,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":2000}]},"properties":{"name":[{"id":3,"value":"b"}]}}
{"id":1000,"label":"loops","inE":{"self":[{"id":1,"outV":1000}]},"outE":{"self":[{"id":1,"inV":1000}]},"properties":{"name":[{"id":0,"value":"loop"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/027ae277/data/tinkerpop-sink.kryo
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink.kryo b/data/tinkerpop-sink.kryo
index 25419fa..24a3468 100644
Binary files a/data/tinkerpop-sink.kryo and b/data/tinkerpop-sink.kryo differ
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/027ae277/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
index 4cbe584..9157571 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
@@ -2753,7 +2753,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
private static class VertexProgramR implements VertexProgram<String> {
private static final String SIMPLE_VERTEX_PROGRAM_CFG_PREFIX = "gremlin.simpleVertexProgram";
private static final String PROPERTY_OUT = "propertyout";
- private static final String PROPERTY_IN = "propertyin";
+ private static final String PROPERTY_IN = "name";
private static final String VERTEX_LABEL = "message_passing_test";
private static final String DIRECTION_CFG_KEY = SIMPLE_VERTEX_PROGRAM_CFG_PREFIX + ".direction";
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/027ae277/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-typed.json
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-typed.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-typed.json
index aae410e..bc56489 100644
--- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-typed.json
+++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-typed.json
@@ -1,3 +1,3 @@
-{"@class":"java.util.HashMap","id":2000,"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":5,"outV":2000}]]},"outE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":4,"inV":2001},{"@class":"java.util.HashMap","id":5,"inV":2000}]]},"properties":{"@class":"java.util.HashMap","propertyin":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"value":"a"}]]}}
-{"@class":"java.util.HashMap","id":2001,"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":4,"outV":2000}]]},"properties":{"@class":"java.util.HashMap","propertyin":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",3],"value":"b"}]]}}
+{"@class":"java.util.HashMap","id":2000,"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":5,"outV":2000}]]},"outE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":4,"inV":2001},{"@class":"java.util.HashMap","id":5,"inV":2000}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"value":"a"}]]}}
+{"@class":"java.util.HashMap","id":2001,"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":4,"outV":2000}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",3],"value":"b"}]]}}
{"@class":"java.util.HashMap","id":1000,"label":"loops","inE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":1,"outV":1000}]]},"outE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":1,"inV":1000}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",0],"value":"loop"}]]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/027ae277/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0-typed.json
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0-typed.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0-typed.json
index e90b677..c0844a3 100644
--- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0-typed.json
+++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0-typed.json
@@ -1,3 +1,3 @@
-{"id":{"@type":"g:Int32","@value":2000},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":5},"outV":{"@type":"g:Int32","@value":2000}}]},"outE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":4},"inV":{"@type":"g:Int32","@value":2001}},{"id":{"@type":"g:Int32","@value":5},"inV":{"@type":"g:Int32","@value":2000}}]},"properties":{"propertyin":[{"id":{"@type":"g:Int64","@value":2},"value":"a"}]}}
-{"id":{"@type":"g:Int32","@value":2001},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":4},"outV":{"@type":"g:Int32","@value":2000}}]},"properties":{"propertyin":[{"id":{"@type":"g:Int64","@value":3},"value":"b"}]}}
+{"id":{"@type":"g:Int32","@value":2000},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":5},"outV":{"@type":"g:Int32","@value":2000}}]},"outE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":4},"inV":{"@type":"g:Int32","@value":2001}},{"id":{"@type":"g:Int32","@value":5},"inV":{"@type":"g:Int32","@value":2000}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":2},"value":"a"}]}}
+{"id":{"@type":"g:Int32","@value":2001},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":4},"outV":{"@type":"g:Int32","@value":2000}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":3},"value":"b"}]}}
{"id":{"@type":"g:Int32","@value":1000},"label":"loops","inE":{"self":[{"id":{"@type":"g:Int32","@value":1},"outV":{"@type":"g:Int32","@value":1000}}]},"outE":{"self":[{"id":{"@type":"g:Int32","@value":1},"inV":{"@type":"g:Int32","@value":1000}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"loop"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/027ae277/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0.json
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0.json
index e6c284e..44fbda9 100644
--- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0.json
+++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0.json
@@ -1,3 +1,3 @@
-{"id":2000,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":2000}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2001},{"id":5,"inV":2000}]},"properties":{"propertyin":[{"id":2,"value":"a"}]}}
-{"id":2001,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":2000}]},"properties":{"propertyin":[{"id":3,"value":"b"}]}}
+{"id":2000,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":2000}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2001},{"id":5,"inV":2000}]},"properties":{"name":[{"id":2,"value":"a"}]}}
+{"id":2001,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":2000}]},"properties":{"name":[{"id":3,"value":"b"}]}}
{"id":1000,"label":"loops","inE":{"self":[{"id":1,"outV":1000}]},"outE":{"self":[{"id":1,"inV":1000}]},"properties":{"name":[{"id":0,"value":"loop"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/027ae277/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink.json
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink.json
index e6c284e..44fbda9 100644
--- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink.json
+++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink.json
@@ -1,3 +1,3 @@
-{"id":2000,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":2000}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2001},{"id":5,"inV":2000}]},"properties":{"propertyin":[{"id":2,"value":"a"}]}}
-{"id":2001,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":2000}]},"properties":{"propertyin":[{"id":3,"value":"b"}]}}
+{"id":2000,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":2000}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2001},{"id":5,"inV":2000}]},"properties":{"name":[{"id":2,"value":"a"}]}}
+{"id":2001,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":2000}]},"properties":{"name":[{"id":3,"value":"b"}]}}
{"id":1000,"label":"loops","inE":{"self":[{"id":1,"outV":1000}]},"outE":{"self":[{"id":1,"inV":1000}]},"properties":{"name":[{"id":0,"value":"loop"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/027ae277/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-sink.kryo
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-sink.kryo b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-sink.kryo
index 25419fa..24a3468 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-sink.kryo and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-sink.kryo differ
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/027ae277/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java
index 4e2989d..1b908ab 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java
@@ -151,9 +151,9 @@ public final class TinkerFactory {
iterate();
final String LABEL = "message_passing_test";
final String EDGE_LABEL = "msg_pass_test_edge";
- final String PROPERTY_IN = "propertyin";
- Vertex a = graph.addVertex(T.id, 2000, T.label, LABEL, PROPERTY_IN, "a");
- Vertex b = graph.addVertex(T.id, 2001, T.label, LABEL, PROPERTY_IN, "b");
+ final String PROPERTY_IN = "name";
+ final Vertex a = graph.addVertex(T.id, 2000, T.label, LABEL, PROPERTY_IN, "a");
+ final Vertex b = graph.addVertex(T.id, 2001, T.label, LABEL, PROPERTY_IN, "b");
a.addEdge(EDGE_LABEL, b);
a.addEdge(EDGE_LABEL, a);
}
[09/12] tinkerpop git commit: Proper update of kitchen sink through
TinkerFactory
Posted by sp...@apache.org.
Proper update of kitchen sink through TinkerFactory
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/0490a082
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/0490a082
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/0490a082
Branch: refs/heads/TINKERPOP-1862
Commit: 0490a082d9b533cb7ef4a1a25bd25500844821a6
Parents: b0b124b
Author: Graff, Philip B <Ph...@jhuapl.edu>
Authored: Sun Feb 25 16:27:28 2018 -0500
Committer: Graff, Philip B <Ph...@jhuapl.edu>
Committed: Sun Feb 25 16:27:28 2018 -0500
----------------------------------------------------------------------
data/tinkerpop-sink-typed.json | 4 +++-
data/tinkerpop-sink-v2d0-typed.json | 4 +++-
data/tinkerpop-sink-v2d0.json | 4 +++-
data/tinkerpop-sink.json | 4 +++-
data/tinkerpop-sink.kryo | Bin 76 -> 300 bytes
.../structure/io/graphson/tinkerpop-sink-typed.json | 4 +++-
.../io/graphson/tinkerpop-sink-v2d0-typed.json | 4 +++-
.../structure/io/graphson/tinkerpop-sink-v2d0.json | 4 +++-
.../structure/io/graphson/tinkerpop-sink.json | 4 +++-
.../gremlin/structure/io/gryo/tinkerpop-sink.kryo | Bin 76 -> 300 bytes
.../tinkergraph/structure/TinkerFactory.java | 7 +++++++
11 files changed, 31 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0490a082/data/tinkerpop-sink-typed.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink-typed.json b/data/tinkerpop-sink-typed.json
index f62a717..aae410e 100644
--- a/data/tinkerpop-sink-typed.json
+++ b/data/tinkerpop-sink-typed.json
@@ -1 +1,3 @@
-{"@class":"java.util.HashMap","id":["java.lang.Long",0],"label":"loops","inE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"outV":["java.lang.Long",0]}]]},"outE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"inV":["java.lang.Long",0]}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",1],"value":"loop"}]]}}
+{"@class":"java.util.HashMap","id":2000,"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":5,"outV":2000}]]},"outE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":4,"inV":2001},{"@class":"java.util.HashMap","id":5,"inV":2000}]]},"properties":{"@class":"java.util.HashMap","propertyin":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"value":"a"}]]}}
+{"@class":"java.util.HashMap","id":2001,"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":4,"outV":2000}]]},"properties":{"@class":"java.util.HashMap","propertyin":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",3],"value":"b"}]]}}
+{"@class":"java.util.HashMap","id":1000,"label":"loops","inE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":1,"outV":1000}]]},"outE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":1,"inV":1000}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",0],"value":"loop"}]]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0490a082/data/tinkerpop-sink-v2d0-typed.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink-v2d0-typed.json b/data/tinkerpop-sink-v2d0-typed.json
index df22167..e90b677 100644
--- a/data/tinkerpop-sink-v2d0-typed.json
+++ b/data/tinkerpop-sink-v2d0-typed.json
@@ -1 +1,3 @@
-{"id":{"@type":"g:Int64","@value":0},"label":"loops","inE":{"self":[{"id":{"@type":"g:Int64","@value":2},"outV":{"@type":"g:Int64","@value":0}}]},"outE":{"self":[{"id":{"@type":"g:Int64","@value":2},"inV":{"@type":"g:Int64","@value":0}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":1},"value":"loop"}]}}
+{"id":{"@type":"g:Int32","@value":2000},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":5},"outV":{"@type":"g:Int32","@value":2000}}]},"outE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":4},"inV":{"@type":"g:Int32","@value":2001}},{"id":{"@type":"g:Int32","@value":5},"inV":{"@type":"g:Int32","@value":2000}}]},"properties":{"propertyin":[{"id":{"@type":"g:Int64","@value":2},"value":"a"}]}}
+{"id":{"@type":"g:Int32","@value":2001},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":4},"outV":{"@type":"g:Int32","@value":2000}}]},"properties":{"propertyin":[{"id":{"@type":"g:Int64","@value":3},"value":"b"}]}}
+{"id":{"@type":"g:Int32","@value":1000},"label":"loops","inE":{"self":[{"id":{"@type":"g:Int32","@value":1},"outV":{"@type":"g:Int32","@value":1000}}]},"outE":{"self":[{"id":{"@type":"g:Int32","@value":1},"inV":{"@type":"g:Int32","@value":1000}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"loop"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0490a082/data/tinkerpop-sink-v2d0.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink-v2d0.json b/data/tinkerpop-sink-v2d0.json
index 39496ba..e6c284e 100644
--- a/data/tinkerpop-sink-v2d0.json
+++ b/data/tinkerpop-sink-v2d0.json
@@ -1 +1,3 @@
-{"id":0,"label":"loops","inE":{"self":[{"id":2,"outV":0}]},"outE":{"self":[{"id":2,"inV":0}]},"properties":{"name":[{"id":1,"value":"loop"}]}}
+{"id":2000,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":2000}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2001},{"id":5,"inV":2000}]},"properties":{"propertyin":[{"id":2,"value":"a"}]}}
+{"id":2001,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":2000}]},"properties":{"propertyin":[{"id":3,"value":"b"}]}}
+{"id":1000,"label":"loops","inE":{"self":[{"id":1,"outV":1000}]},"outE":{"self":[{"id":1,"inV":1000}]},"properties":{"name":[{"id":0,"value":"loop"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0490a082/data/tinkerpop-sink.json
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink.json b/data/tinkerpop-sink.json
index 39496ba..e6c284e 100644
--- a/data/tinkerpop-sink.json
+++ b/data/tinkerpop-sink.json
@@ -1 +1,3 @@
-{"id":0,"label":"loops","inE":{"self":[{"id":2,"outV":0}]},"outE":{"self":[{"id":2,"inV":0}]},"properties":{"name":[{"id":1,"value":"loop"}]}}
+{"id":2000,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":2000}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2001},{"id":5,"inV":2000}]},"properties":{"propertyin":[{"id":2,"value":"a"}]}}
+{"id":2001,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":2000}]},"properties":{"propertyin":[{"id":3,"value":"b"}]}}
+{"id":1000,"label":"loops","inE":{"self":[{"id":1,"outV":1000}]},"outE":{"self":[{"id":1,"inV":1000}]},"properties":{"name":[{"id":0,"value":"loop"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0490a082/data/tinkerpop-sink.kryo
----------------------------------------------------------------------
diff --git a/data/tinkerpop-sink.kryo b/data/tinkerpop-sink.kryo
index 9a26e15..25419fa 100644
Binary files a/data/tinkerpop-sink.kryo and b/data/tinkerpop-sink.kryo differ
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0490a082/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-typed.json
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-typed.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-typed.json
index f62a717..aae410e 100644
--- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-typed.json
+++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-typed.json
@@ -1 +1,3 @@
-{"@class":"java.util.HashMap","id":["java.lang.Long",0],"label":"loops","inE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"outV":["java.lang.Long",0]}]]},"outE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"inV":["java.lang.Long",0]}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",1],"value":"loop"}]]}}
+{"@class":"java.util.HashMap","id":2000,"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":5,"outV":2000}]]},"outE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":4,"inV":2001},{"@class":"java.util.HashMap","id":5,"inV":2000}]]},"properties":{"@class":"java.util.HashMap","propertyin":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"value":"a"}]]}}
+{"@class":"java.util.HashMap","id":2001,"label":"message_passing_test","inE":{"@class":"java.util.HashMap","msg_pass_test_edge":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":4,"outV":2000}]]},"properties":{"@class":"java.util.HashMap","propertyin":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",3],"value":"b"}]]}}
+{"@class":"java.util.HashMap","id":1000,"label":"loops","inE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":1,"outV":1000}]]},"outE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":1,"inV":1000}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",0],"value":"loop"}]]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0490a082/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0-typed.json
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0-typed.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0-typed.json
index df22167..e90b677 100644
--- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0-typed.json
+++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0-typed.json
@@ -1 +1,3 @@
-{"id":{"@type":"g:Int64","@value":0},"label":"loops","inE":{"self":[{"id":{"@type":"g:Int64","@value":2},"outV":{"@type":"g:Int64","@value":0}}]},"outE":{"self":[{"id":{"@type":"g:Int64","@value":2},"inV":{"@type":"g:Int64","@value":0}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":1},"value":"loop"}]}}
+{"id":{"@type":"g:Int32","@value":2000},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":5},"outV":{"@type":"g:Int32","@value":2000}}]},"outE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":4},"inV":{"@type":"g:Int32","@value":2001}},{"id":{"@type":"g:Int32","@value":5},"inV":{"@type":"g:Int32","@value":2000}}]},"properties":{"propertyin":[{"id":{"@type":"g:Int64","@value":2},"value":"a"}]}}
+{"id":{"@type":"g:Int32","@value":2001},"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":{"@type":"g:Int32","@value":4},"outV":{"@type":"g:Int32","@value":2000}}]},"properties":{"propertyin":[{"id":{"@type":"g:Int64","@value":3},"value":"b"}]}}
+{"id":{"@type":"g:Int32","@value":1000},"label":"loops","inE":{"self":[{"id":{"@type":"g:Int32","@value":1},"outV":{"@type":"g:Int32","@value":1000}}]},"outE":{"self":[{"id":{"@type":"g:Int32","@value":1},"inV":{"@type":"g:Int32","@value":1000}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"loop"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0490a082/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0.json
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0.json
index 39496ba..e6c284e 100644
--- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0.json
+++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-v2d0.json
@@ -1 +1,3 @@
-{"id":0,"label":"loops","inE":{"self":[{"id":2,"outV":0}]},"outE":{"self":[{"id":2,"inV":0}]},"properties":{"name":[{"id":1,"value":"loop"}]}}
+{"id":2000,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":2000}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2001},{"id":5,"inV":2000}]},"properties":{"propertyin":[{"id":2,"value":"a"}]}}
+{"id":2001,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":2000}]},"properties":{"propertyin":[{"id":3,"value":"b"}]}}
+{"id":1000,"label":"loops","inE":{"self":[{"id":1,"outV":1000}]},"outE":{"self":[{"id":1,"inV":1000}]},"properties":{"name":[{"id":0,"value":"loop"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0490a082/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink.json
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink.json
index 39496ba..e6c284e 100644
--- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink.json
+++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink.json
@@ -1 +1,3 @@
-{"id":0,"label":"loops","inE":{"self":[{"id":2,"outV":0}]},"outE":{"self":[{"id":2,"inV":0}]},"properties":{"name":[{"id":1,"value":"loop"}]}}
+{"id":2000,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":5,"outV":2000}]},"outE":{"msg_pass_test_edge":[{"id":4,"inV":2001},{"id":5,"inV":2000}]},"properties":{"propertyin":[{"id":2,"value":"a"}]}}
+{"id":2001,"label":"message_passing_test","inE":{"msg_pass_test_edge":[{"id":4,"outV":2000}]},"properties":{"propertyin":[{"id":3,"value":"b"}]}}
+{"id":1000,"label":"loops","inE":{"self":[{"id":1,"outV":1000}]},"outE":{"self":[{"id":1,"inV":1000}]},"properties":{"name":[{"id":0,"value":"loop"}]}}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0490a082/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-sink.kryo
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-sink.kryo b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-sink.kryo
index 9a26e15..25419fa 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-sink.kryo and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/tinkerpop-sink.kryo differ
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0490a082/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java
index 96d26ca..4e2989d 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java
@@ -149,6 +149,13 @@ public final class TinkerFactory {
g.addV("loops").property(T.id, 1000).property("name", "loop").as("me").
addE("self").to("me").
iterate();
+ final String LABEL = "message_passing_test";
+ final String EDGE_LABEL = "msg_pass_test_edge";
+ final String PROPERTY_IN = "propertyin";
+ Vertex a = graph.addVertex(T.id, 2000, T.label, LABEL, PROPERTY_IN, "a");
+ Vertex b = graph.addVertex(T.id, 2001, T.label, LABEL, PROPERTY_IN, "b");
+ a.addEdge(EDGE_LABEL, b);
+ a.addEdge(EDGE_LABEL, a);
}
private static TinkerGraph getTinkerGraphWithNumberManager() {
[05/12] tinkerpop git commit: Test bug fix and refactoring repeated
code
Posted by sp...@apache.org.
Test bug fix and refactoring repeated code
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5467a33f
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5467a33f
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5467a33f
Branch: refs/heads/TINKERPOP-1862
Commit: 5467a33f2e17ad22b736effebede124556f049ed
Parents: 153238b
Author: Graff, Philip B <Ph...@jhuapl.edu>
Authored: Sun Jan 14 13:44:33 2018 -0500
Committer: Graff, Philip B <Ph...@jhuapl.edu>
Committed: Sun Feb 25 10:44:53 2018 -0500
----------------------------------------------------------------------
.../process/computer/GraphComputerTest.java | 28 +++++++++-----------
1 file changed, 12 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5467a33f/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
index 785f03d..da0e53f 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
@@ -2689,12 +2689,8 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
@Test
public void testMessagePassingIn() throws Exception {
- runTest(Direction.BOTH).forEachRemaining(v -> {
- assertEquals(2, v.keys().size());
- assertTrue(v.keys().contains(VertexProgramR.PROPERTY_IN));
- assertTrue(v.keys().contains(VertexProgramR.PROPERTY_OUT));
- assertEquals(1, IteratorUtils.count(v.values(VertexProgramR.PROPERTY_IN)));
- assertEquals(1, IteratorUtils.count(v.values(VertexProgramR.PROPERTY_OUT)));
+ runTest(Direction.IN).forEachRemaining(v -> {
+ vertexPropertyChecks(v);
final String in = v.value(VertexProgramR.PROPERTY_IN);
if (in.equals("a"))
assertEquals("ab", v.value(VertexProgramR.PROPERTY_OUT).toString());
@@ -2709,11 +2705,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
@Test
public void testMessagePassingOut() throws Exception {
runTest(Direction.OUT).forEachRemaining(v -> {
- assertEquals(2, v.keys().size());
- assertTrue(v.keys().contains(VertexProgramR.PROPERTY_IN));
- assertTrue(v.keys().contains(VertexProgramR.PROPERTY_OUT));
- assertEquals(1, IteratorUtils.count(v.values(VertexProgramR.PROPERTY_IN)));
- assertEquals(1, IteratorUtils.count(v.values(VertexProgramR.PROPERTY_OUT)));
+ vertexPropertyChecks(v);
final String in = v.value(VertexProgramR.PROPERTY_IN);
if (in.equals("a"))
assertEquals("a", v.value(VertexProgramR.PROPERTY_OUT).toString());
@@ -2728,11 +2720,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
@Test
public void testMessagePassingBoth() throws Exception {
runTest(Direction.BOTH).forEachRemaining(v -> {
- assertEquals(2, v.keys().size());
- assertTrue(v.keys().contains(VertexProgramR.PROPERTY_IN));
- assertTrue(v.keys().contains(VertexProgramR.PROPERTY_OUT));
- assertEquals(1, IteratorUtils.count(v.values(VertexProgramR.PROPERTY_IN)));
- assertEquals(1, IteratorUtils.count(v.values(VertexProgramR.PROPERTY_OUT)));
+ vertexPropertyChecks(v);
final String in = v.value(VertexProgramR.PROPERTY_IN);
if (in.equals("a"))
assertEquals("aab", v.value(VertexProgramR.PROPERTY_OUT).toString());
@@ -2754,6 +2742,14 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
return result.graph().traversal().V();
}
+ private static void vertexPropertyChecks(Vertex v) {
+ assertEquals(2, v.keys().size());
+ assertTrue(v.keys().contains(VertexProgramR.PROPERTY_IN));
+ assertTrue(v.keys().contains(VertexProgramR.PROPERTY_OUT));
+ assertEquals(1, IteratorUtils.count(v.values(VertexProgramR.PROPERTY_IN)));
+ assertEquals(1, IteratorUtils.count(v.values(VertexProgramR.PROPERTY_OUT)));
+ }
+
private static class VertexProgramR implements VertexProgram<String> {
private static final String SIMPLE_VERTEX_PROGRAM_CFG_PREFIX = "gremlin.simpleVertexProgram";
private static final String PROPERTY_OUT = "propertyout";