You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2016/01/12 22:10:48 UTC
[01/15] incubator-tinkerpop git commit: Support self-looping edges in
GraphSONReader
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/master 16aa72044 -> 4054e2678
Support self-looping edges in GraphSONReader
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/1892d7c7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/1892d7c7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/1892d7c7
Branch: refs/heads/master
Commit: 1892d7c70f18bd2b3c38eb6ac1e051c89d1aa326
Parents: 5a9ba5f
Author: Benjamin Han <be...@siftsec.com>
Authored: Wed Dec 9 13:24:22 2015 -0800
Committer: Benjamin Han <be...@siftsec.com>
Committed: Wed Dec 9 13:24:22 2015 -0800
----------------------------------------------------------------------
.../tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1892d7c7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java
index 7b5ade7..d95fdff 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java
@@ -100,13 +100,13 @@ public final class GraphSONReader implements GraphReader {
final boolean supportsTx = graphToWriteTo.features().graph().supportsTransactions();
final Graph.Features.EdgeFeatures edgeFeatures = graphToWriteTo.features().edge();
- readVertexStrings(inputStream).<Vertex>map(FunctionUtils.wrapFunction(line -> readVertex(new ByteArrayInputStream(line.getBytes()), null, null, Direction.OUT))).forEach(vertex -> {
+ readVertexStrings(inputStream).<Vertex>map(FunctionUtils.wrapFunction(line -> readVertex(new ByteArrayInputStream(line.getBytes()), null, null, Direction.IN))).forEach(vertex -> {
final Attachable<Vertex> attachable = (Attachable<Vertex>) vertex;
cache.put((StarGraph.StarVertex) attachable.get(), attachable.attach(Attachable.Method.create(graphToWriteTo)));
if (supportsTx && counter.incrementAndGet() % batchSize == 0)
graphToWriteTo.tx().commit();
});
- cache.entrySet().forEach(kv -> kv.getKey().edges(Direction.OUT).forEachRemaining(e -> {
+ cache.entrySet().forEach(kv -> kv.getKey().edges(Direction.IN).forEachRemaining(e -> {
// can't use a standard Attachable attach method here because we have to use the cache for those
// graphs that don't support userSuppliedIds on edges. note that outVertex/inVertex methods return
// StarAdjacentVertex whose equality should match StarVertex.
[14/15] incubator-tinkerpop git commit: Merge
github.com:laxatives/incubator-tinkerpop
Posted by ok...@apache.org.
Merge github.com:laxatives/incubator-tinkerpop
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/c9e3c9ed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/c9e3c9ed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/c9e3c9ed
Branch: refs/heads/master
Commit: c9e3c9edd11a151ed6c8716578ebc9dd20f435b6
Parents: 16aa720 625bfdd
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Jan 12 13:58:05 2016 -0700
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Jan 12 13:58:05 2016 -0700
----------------------------------------------------------------------
.../structure/io/graphson/GraphSONReader.java | 4 +-
.../gremlin/structure/io/gryo/GryoReader.java | 2 +-
.../tinkerpop/gremlin/structure/io/IoTest.java | 82 ++++++++++++++++++++
3 files changed, 85 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[13/15] incubator-tinkerpop git commit: Cleanup tests
Posted by ok...@apache.org.
Cleanup tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/625bfdd0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/625bfdd0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/625bfdd0
Branch: refs/heads/master
Commit: 625bfdd00fe352d0fd041505dea6b13195dfd6ac
Parents: d302a3b
Author: Benjamin Han <be...@siftsec.com>
Authored: Tue Jan 12 07:12:21 2016 -0800
Committer: Benjamin Han <be...@siftsec.com>
Committed: Tue Jan 12 07:12:21 2016 -0800
----------------------------------------------------------------------
.../org/apache/tinkerpop/gremlin/structure/io/IoTest.java | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/625bfdd0/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
index 1dc3a42..75b6253 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
@@ -256,8 +256,7 @@ public class IoTest {
@FeatureRequirement(featureClass = EdgePropertyFeatures.class, feature = FEATURE_STRING_VALUES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
public void shouldReadWriteSelfLoopingEdges() throws Exception {
- final Configuration sourceConf = graphProvider.newGraphConfiguration("source", this.getClass(), name.getMethodName(), null);
- final Graph source = GraphFactory.open(sourceConf);
+ final Graph source = graph;
final Vertex v1 = source.addVertex();
final Vertex v2 = source.addVertex();
v1.addEdge("CONTROL", v2);
@@ -286,8 +285,7 @@ public class IoTest {
@FeatureRequirement(featureClass = EdgePropertyFeatures.class, feature = FEATURE_STRING_VALUES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
public void shouldReadWriteSelfLoopingEdges() {
- final Configuration sourceConf = graphProvider.newGraphConfiguration("source", this.getClass(), name.getMethodName(), null);
- final Graph source = GraphFactory.open(sourceConf);
+ final Graph source = graph;
final Vertex v1 = source.addVertex();
final Vertex v2 = source.addVertex();
v1.addEdge("CONTROL", v2);
@@ -432,8 +430,7 @@ public class IoTest {
@FeatureRequirement(featureClass = EdgePropertyFeatures.class, feature = FEATURE_STRING_VALUES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
public void shouldReadWriteSelfLoopingEdges() throws Exception {
- final Configuration sourceConf = graphProvider.newGraphConfiguration("source", this.getClass(), name.getMethodName(), null);
- final Graph source = GraphFactory.open(sourceConf);
+ final Graph source = graph;
final Vertex v1 = source.addVertex();
final Vertex v2 = source.addVertex();
v1.addEdge("CONTROL", v2);
[15/15] incubator-tinkerpop git commit: added CAUTION note for
HadoopGraph -- TINKERPOP-1009. So simple its a CTR.
Posted by ok...@apache.org.
added CAUTION note for HadoopGraph -- TINKERPOP-1009. So simple its a CTR.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/4054e267
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/4054e267
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/4054e267
Branch: refs/heads/master
Commit: 4054e2678511387c559647f7871d665f37176bf5
Parents: c9e3c9e
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Jan 12 14:10:36 2016 -0700
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Jan 12 14:10:36 2016 -0700
----------------------------------------------------------------------
docs/src/reference/implementations.asciidoc | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4054e267/docs/src/reference/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/implementations.asciidoc b/docs/src/reference/implementations.asciidoc
index 661c951..3d85a5a 100644
--- a/docs/src/reference/implementations.asciidoc
+++ b/docs/src/reference/implementations.asciidoc
@@ -1135,6 +1135,11 @@ etc.). Unfortunately, typically these dependencies are not to the same versions
it is best to *not* have both Spark and Giraph plugins loaded in the same console session nor in the same Java
project (though intelligent `<exclusion>`-usage can help alleviate conflicts in a Java project).
+CAUTION: It is important to note that when doing an OLAP traversal, any resulting vertices, edges, or properties will be
+attached to the source graph. For Hadoop-based graphs, this may lead to linear search times on massive graphs. Thus,
+if vertex, edge, or property objects are to be returns (as a final result), it is best to `.id()` to get the id
+of the object and not the actual attached object.
+
[[mapreducegraphcomputer]]
MapReduceGraphComputer
^^^^^^^^^^^^^^^^^^^^^^
[03/15] incubator-tinkerpop git commit: Move test to IoTest
Posted by ok...@apache.org.
Move test to IoTest
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/38ad2a01
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/38ad2a01
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/38ad2a01
Branch: refs/heads/master
Commit: 38ad2a015d2bf6c397d65facc87c70c65babac3f
Parents: 19d0a81
Author: Benjamin Han <be...@siftsec.com>
Authored: Wed Dec 9 15:05:42 2015 -0800
Committer: Benjamin Han <be...@siftsec.com>
Committed: Wed Dec 9 15:05:42 2015 -0800
----------------------------------------------------------------------
.../tinkerpop/gremlin/structure/io/IoTest.java | 25 ++++++++
.../io/graphson/GraphSONReaderTest.java | 62 --------------------
2 files changed, 25 insertions(+), 62 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/38ad2a01/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
index 40950f9..192fd26 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
@@ -42,6 +42,7 @@ import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens;
import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter;
import org.apache.tinkerpop.gremlin.structure.io.graphson.LegacyGraphSONReader;
import org.apache.tinkerpop.gremlin.structure.io.util.CustomId;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import org.apache.tinkerpop.shaded.jackson.databind.JsonNode;
import org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper;
@@ -368,6 +369,30 @@ public class IoTest {
// the id is lossy in migration because TP2 treated ID as String
assertClassicGraph(graph, false, true);
}
+
+ @Test
+ public void shouldReadWriteSelfLoopingEdges() {
+ final Configuration sourceConf = graphProvider.newGraphConfiguration("source", this.getClass(), name.getMethodName(), null);
+ final Graph source = GraphFactory.open(sourceConf);
+ final Vertex v1 = source.addVertex();
+ final Vertex v2 = source.addVertex();
+ v1.addEdge("CONTROL", v2);
+ v1.addEdge("SELF-LOOP", v1);
+
+ final Configuration targetConf = graphProvider.newGraphConfiguration("target", this.getClass(), name.getMethodName(), null);
+ final Graph target = GraphFactory.open(targetConf);
+ try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
+ source.io(IoCore.graphson()).writer().create().writeGraph(os, source);
+ try (ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray())) {
+ target.io(IoCore.graphson()).reader().create().readGraph(is, target);
+ }
+ } catch (IOException ioe) {
+ throw new RuntimeException(ioe);
+ }
+
+ assertEquals(source.traversal().V().count(), target.traversal().V().count());
+ assertEquals(source.traversal().E().count(), target.traversal().E().count());
+ }
}
public static void assertCrewGraph(final Graph g1, final boolean lossyForId) {
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/38ad2a01/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReaderTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReaderTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReaderTest.java
deleted file mode 100644
index 1dbfddb..0000000
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReaderTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.structure.io.graphson;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.io.IoCore;
-import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
-import org.junit.Test;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * Created by Benjamin Han
- */
-public class GraphSONReaderTest extends AbstractGremlinTest {
-
- @Test
- public void shouldReadWriteSelfLoopingEdges() {
- final Configuration sourceConf = graphProvider.newGraphConfiguration("source", this.getClass(), name.getMethodName(), null);
- final Graph source = GraphFactory.open(sourceConf);
- Vertex v1 = source.addVertex();
- Vertex v2 = source.addVertex();
- v1.addEdge("CONTROL", v2);
- v1.addEdge("SELF-LOOP", v1);
-
- final Configuration targetConf = graphProvider.newGraphConfiguration("target", this.getClass(), name.getMethodName(), null);
- final Graph target = GraphFactory.open(targetConf);
- try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
- source.io(IoCore.graphson()).writer().create().writeGraph(os, source);
- ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
- target.io(IoCore.graphson()).reader().create().readGraph(is, target);
- } catch (IOException ioe) {
- throw new RuntimeException(ioe);
- }
-
- assertEquals(source.traversal().V().count(), target.traversal().V().count());
- assertEquals(source.traversal().E().count(), target.traversal().E().count());
- }
-}
[11/15] incubator-tinkerpop git commit: Merge
https://github.com/apache/incubator-tinkerpop
Posted by ok...@apache.org.
Merge https://github.com/apache/incubator-tinkerpop
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/8ac487fd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/8ac487fd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/8ac487fd
Branch: refs/heads/master
Commit: 8ac487fd1769b7cc58a68e60126e442bb97e71e5
Parents: 6399d19 1e989b7
Author: Benjamin Han <be...@siftsec.com>
Authored: Mon Jan 11 12:17:22 2016 -0800
Committer: Benjamin Han <be...@siftsec.com>
Committed: Mon Jan 11 12:17:22 2016 -0800
----------------------------------------------------------------------
CHANGELOG.asciidoc | 243 +++++-----
README.asciidoc | 12 +-
bin/validate-distribution.sh | 4 +-
docs/src/dev/developer/contributing.asciidoc | 35 +-
docs/src/dev/developer/meetings.asciidoc | 194 ++++----
docs/src/dev/developer/release.asciidoc | 4 +-
.../src/reference/gremlin-applications.asciidoc | 107 +++-
docs/src/reference/implementations.asciidoc | 109 +++--
docs/src/reference/intro.asciidoc | 23 +-
docs/src/reference/the-graph.asciidoc | 40 +-
docs/src/reference/the-graphcomputer.asciidoc | 11 +-
docs/src/reference/the-traversal.asciidoc | 2 +-
.../tutorials/getting-started/index.asciidoc | 52 +-
.../upgrade/release-3.0.x-incubating.asciidoc | 28 +-
.../upgrade/release-3.1.x-incubating.asciidoc | 126 +++--
docs/static/images/business-gremlin.png | Bin 0 -> 412520 bytes
.../images/modern-edge-1-to-3-1-gremlin.png | Bin 11607 -> 12720 bytes
docs/static/images/modern-edge-1-to-3-1.png | Bin 3210 -> 3887 bytes
.../images/modern-edge-1-to-3-2-gremlin.png | Bin 17029 -> 18052 bytes
docs/static/images/modern-edge-1-to-3-2.png | Bin 4420 -> 3784 bytes
.../images/modern-edge-1-to-3-3-gremlin.png | Bin 20948 -> 22258 bytes
docs/static/images/modern-edge-1-to-3-3.png | Bin 7372 -> 5800 bytes
docs/static/images/quantum-gremlin-full.png | Bin 0 -> 1877990 bytes
.../process/computer/GiraphGraphComputer.java | 43 +-
.../GiraphHadoopGremlinIntegrateTest.java | 33 ++
.../computer/GiraphHadoopGraphProvider.java | 6 +-
.../GiraphHadoopGremlinPluginIntegrateTest.java | 33 --
.../tinkerpop/gremlin/console/Console.groovy | 20 +-
.../computer/bulkloading/BulkLoader.java | 8 +-
.../bulkloading/BulkLoaderVertexProgram.java | 11 +-
.../bulkloading/IncrementalBulkLoader.java | 8 +-
.../computer/bulkloading/OneTimeBulkLoader.java | 109 +++++
.../peerpressure/ClusterCountMapReduce.java | 7 +-
.../traversal/util/DependantMutableMetrics.java | 34 +-
.../process/traversal/util/MutableMetrics.java | 3 +-
.../tinkerpop/gremlin/structure/Element.java | 2 +-
.../tinkerpop/gremlin/structure/io/Storage.java | 139 ++++++
.../structure/io/gryo/GryoClassResolver.java | 2 +-
.../gremlin/structure/io/gryo/GryoMapper.java | 25 +-
.../gremlin/structure/util/StringFactory.java | 18 +-
.../apache/tinkerpop/gremlin/TestHelper.java | 76 ++-
.../sideEffect/LambdaSideEffectStepTest.java | 7 +-
.../tinkerpop/gremlin/structure/io/IoX.java | 5 +
.../gremlin/structure/io/IoXIoRegistry.java | 57 +++
.../tinkerpop/gremlin/structure/io/IoY.java | 5 +
.../gremlin/structure/io/IoYIoRegistry.java | 39 ++
.../structure/io/gryo/GryoMapperTest.java | 113 +++++
.../tinkerpop/gremlin/driver/Cluster.java | 3 +
.../tinkerpop/gremlin/driver/Settings.java | 2 +
.../AbstractGraphSONMessageSerializerV1d0.java | 5 +-
.../driver/ser/AbstractMessageSerializer.java | 82 ++++
.../driver/ser/GryoMessageSerializerV1d0.java | 49 +-
...raphSONMessageSerializerGremlinV1d0Test.java | 5 +-
.../ser/GraphSONMessageSerializerV1d0Test.java | 60 +++
.../ser/GryoMessageSerializerV1d0Test.java | 115 ++++-
.../traversal/step/map/GroovySelectTest.groovy | 2 +-
.../gremlin/groovy/GroovyEnvironmentSuite.java | 2 +
...remlinGroovyScriptEngineFileSandboxTest.java | 117 +++++
.../GremlinGroovyScriptEngineIntegrateTest.java | 11 +-
.../process/GroovyProcessComputerSuite.java | 1 -
.../gremlin/groovy/jsr223/sandbox.yaml | 58 +++
.../customizer/AbstractSandboxExtension.groovy | 90 ++++
.../customizer/FileSandboxExtension.groovy | 107 ++++
.../PropertyExpressionEvaluator.groovy | 66 +++
.../jsr223/customizer/SandboxExtension.groovy | 3 +
.../jsr223/customizer/SandboxHelper.groovy | 57 +++
.../customizer/SimpleSandboxExtension.groovy | 31 +-
.../customizer/TinkerPopSandboxExtension.groovy | 44 +-
.../gremlin/groovy/engine/GremlinExecutor.java | 3 +-
.../jsr223/GremlinGroovyScriptEngineTest.java | 9 +-
.../groovy/util/DependencyGrabberTest.java | 3 +-
gremlin-server/conf/gremlin-server-classic.yaml | 1 +
gremlin-server/conf/gremlin-server-min.yaml | 1 +
.../conf/gremlin-server-modern-readonly.yaml | 1 +
gremlin-server/conf/gremlin-server-modern.yaml | 1 +
gremlin-server/conf/gremlin-server-neo4j.yaml | 1 +
.../conf/gremlin-server-rest-modern.yaml | 1 +
.../conf/gremlin-server-rest-secure.yaml | 1 +
gremlin-server/conf/gremlin-server-secure.yaml | 1 +
gremlin-server/conf/gremlin-server-spark.yaml | 1 +
gremlin-server/conf/gremlin-server.yaml | 1 +
.../scripts/empty-sample-secure.groovy | 4 +-
.../tinkerpop/gremlin/server/GraphManager.java | 46 ++
.../tinkerpop/gremlin/server/GremlinServer.java | 2 +-
.../tinkerpop/gremlin/server/Settings.java | 9 +
.../server/auth/AllowAllAuthenticator.java | 2 +-
.../gremlin/server/auth/Authenticator.java | 2 +-
.../server/auth/SimpleAuthenticator.java | 4 +-
.../gremlin/server/channel/HttpChannelizer.java | 2 +-
.../handler/HttpGremlinEndpointHandler.java | 37 +-
.../server/handler/OpSelectorHandler.java | 2 +-
.../server/op/AbstractEvalOpProcessor.java | 52 +-
.../server/op/control/ControlOpProcessor.java | 18 +-
.../server/op/session/SessionOpProcessor.java | 7 +-
.../server/op/standard/StandardOpProcessor.java | 31 +-
.../AbstractGremlinServerIntegrationTest.java | 7 +-
.../server/GremlinAdditionPerformanceTest.java | 5 +-
.../server/GremlinDriverIntegrateTest.java | 113 ++++-
.../GremlinServerAuthOldIntegrateTest.java | 2 +-
.../server/GremlinServerHttpIntegrateTest.java | 36 ++
.../server/GremlinServerIntegrateTest.java | 120 +++--
.../server/gremlin-server-integration.yaml | 1 +
.../server/gremlin-server-performance.yaml | 1 +
.../gremlin/AbstractGraphProvider.java | 14 +-
.../tinkerpop/gremlin/AbstractGremlinSuite.java | 32 +-
.../tinkerpop/gremlin/AbstractGremlinTest.java | 20 +-
.../apache/tinkerpop/gremlin/GraphManager.java | 115 ++++-
.../apache/tinkerpop/gremlin/GraphProvider.java | 10 +
.../apache/tinkerpop/gremlin/TestHelper.java | 51 +-
.../generator/CommunityGeneratorTest.java | 5 +-
.../process/AbstractGremlinProcessTest.java | 7 +-
.../gremlin/process/GremlinProcessRunner.java | 6 +-
.../process/computer/GraphComputerTest.java | 54 +--
.../BulkLoaderVertexProgramTest.java | 39 +-
.../process/traversal/step/filter/TailTest.java | 2 +-
.../process/traversal/step/map/FlatMapTest.java | 2 +-
.../process/traversal/step/map/MapTest.java | 2 +-
.../process/traversal/step/map/SelectTest.java | 6 +-
.../ElementIdStrategyProcessTest.java | 7 +-
.../gremlin/structure/FeatureSupportTest.java | 7 +-
.../tinkerpop/gremlin/structure/GraphTest.java | 16 +-
.../gremlin/structure/PropertyTest.java | 4 +-
.../tinkerpop/gremlin/structure/VertexTest.java | 18 +-
.../gremlin/structure/io/IoIntegrateTest.java | 10 +-
.../structure/ExceptionCoverageTest.java | 5 +-
.../conf/hadoop-grateful-gryo.properties | 6 +-
.../hadoop/groovy/plugin/HadoopLoader.groovy | 138 ------
.../tinkerpop/gremlin/hadoop/Constants.java | 20 +
.../groovy/plugin/HadoopGremlinPlugin.java | 11 +-
.../process/computer/util/MapReduceHelper.java | 8 +-
.../hadoop/structure/HadoopConfiguration.java | 5 +
.../gremlin/hadoop/structure/HadoopGraph.java | 4 +-
.../hadoop/structure/hdfs/HDFSTools.java | 113 -----
.../structure/hdfs/HadoopEdgeIterator.java | 83 ----
.../structure/hdfs/HadoopElementIterator.java | 74 ---
.../structure/hdfs/HadoopVertexIterator.java | 82 ----
.../hadoop/structure/hdfs/HiddenFileFilter.java | 44 --
.../hadoop/structure/hdfs/TextIterator.java | 91 ----
.../hadoop/structure/io/FileSystemStorage.java | 246 ++++++++++
.../hadoop/structure/io/HadoopEdgeIterator.java | 79 +++
.../structure/io/HadoopElementIterator.java | 75 +++
.../structure/io/HadoopVertexIterator.java | 78 +++
.../hadoop/structure/io/HiddenFileFilter.java | 44 ++
.../hadoop/structure/io/InputOutputHelper.java | 2 +-
.../hadoop/structure/io/ObjectWritable.java | 7 +-
.../structure/io/ObjectWritableIterator.java | 12 +-
.../hadoop/structure/io/TextIterator.java | 91 ++++
.../structure/io/VertexWritableIterator.java | 10 +-
.../gremlin/hadoop/HadoopGraphProvider.java | 2 +-
.../gremlin/hadoop/HadoopGremlinSuite.java | 36 ++
.../groovy/plugin/HadoopGremlinPluginCheck.java | 70 +--
.../hadoop/groovy/plugin/HadoopPluginSuite.java | 34 --
.../structure/io/AbstractStorageCheck.java | 145 ++++++
.../structure/io/FileSystemStorageCheck.java | 88 ++++
.../structure/io/RecordReaderWriterTest.java | 7 +-
.../gremlin/neo4j/NativeNeo4jSuite.java | 18 +-
.../neo4j/process/NativeNeo4jCypherCheck.java | 214 ++++++++
.../neo4j/process/NativeNeo4jCypherTest.java | 211 --------
.../neo4j/structure/NativeNeo4jIndexCheck.java | 371 ++++++++++++++
.../neo4j/structure/NativeNeo4jIndexTest.java | 368 --------------
.../structure/NativeNeo4jStructureCheck.java | 483 +++++++++++++++++++
.../structure/NativeNeo4jStructureTest.java | 483 -------------------
pom.xml | 5 +-
spark-gremlin/pom.xml | 2 +-
.../spark/groovy/plugin/SparkLoader.groovy | 68 ---
.../spark/groovy/plugin/SparkGremlinPlugin.java | 5 +-
.../spark/process/computer/SparkExecutor.java | 28 --
.../process/computer/SparkGraphComputer.java | 18 +-
.../gremlin/spark/structure/Spark.java | 2 +
.../spark/structure/io/InputFormatRDD.java | 15 +
.../spark/structure/io/InputOutputHelper.java | 3 -
.../gremlin/spark/structure/io/InputRDD.java | 17 +-
.../spark/structure/io/OutputFormatRDD.java | 30 +-
.../gremlin/spark/structure/io/OutputRDD.java | 21 +
.../spark/structure/io/PersistedInputRDD.java | 14 +-
.../spark/structure/io/PersistedOutputRDD.java | 25 +-
.../spark/structure/io/SparkContextStorage.java | 164 +++++++
.../gremlin/spark/AbstractSparkTest.java | 35 +-
.../gremlin/spark/SparkGremlinSuite.java | 35 ++
.../gremlin/spark/SparkGremlinTest.java | 33 ++
.../gremlin/spark/SparkHadoopGremlinTest.java | 33 ++
.../process/computer/LocalPropertyTest.java | 5 +-
.../computer/SparkHadoopGraphProvider.java | 12 +-
.../groovy/plugin/SparkGremlinPluginTest.java | 126 -----
.../plugin/SparkHadoopGremlinPluginTest.java | 33 --
.../gremlin/spark/structure/SparkTest.java | 16 +-
.../spark/structure/io/ExampleInputRDD.java | 5 +
.../spark/structure/io/ExampleOutputRDD.java | 6 +
.../spark/structure/io/InputOutputRDDTest.java | 4 +-
.../spark/structure/io/InputRDDTest.java | 5 +-
.../spark/structure/io/OutputRDDTest.java | 3 +-
.../io/PersistedInputOutputRDDTest.java | 48 +-
.../structure/io/SparkContextStorageCheck.java | 74 +++
.../spark/structure/io/ToyGraphInputRDD.java | 7 +
.../tinkergraph/structure/TinkerIoRegistry.java | 1 +
.../structure/TinkerGraphPlayTest.java | 55 ++-
.../tinkergraph/structure/TinkerGraphTest.java | 147 +++++-
197 files changed, 5632 insertions(+), 2984 deletions(-)
----------------------------------------------------------------------
[06/15] incubator-tinkerpop git commit: Fix bad test comparison
Posted by ok...@apache.org.
Fix bad test comparison
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/413caf54
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/413caf54
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/413caf54
Branch: refs/heads/master
Commit: 413caf5434dbceb5842c8e92d78f8012ab8f83c5
Parents: 4f7ed10
Author: Benjamin Han <be...@siftsec.com>
Authored: Thu Dec 10 09:02:30 2015 -0800
Committer: Benjamin Han <be...@siftsec.com>
Committed: Thu Dec 10 09:02:30 2015 -0800
----------------------------------------------------------------------
.../org/apache/tinkerpop/gremlin/structure/io/IoTest.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/413caf54/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
index bae5df3..2635b85 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
@@ -276,8 +276,8 @@ public class IoTest {
r.readGraph(in, target);
}
- assertEquals(source.traversal().V().count(), target.traversal().V().count());
- assertEquals(source.traversal().E().count(), target.traversal().E().count());
+ assertEquals(IteratorUtils.count(source.vertices()), IteratorUtils.count(target.vertices()));
+ assertEquals(IteratorUtils.count(source.edges()), IteratorUtils.count(target.vertices()));
}
}
@@ -452,8 +452,8 @@ public class IoTest {
throw new RuntimeException(ioe);
}
- assertEquals(source.traversal().V().count(), target.traversal().V().count());
- assertEquals(source.traversal().E().count(), target.traversal().E().count());
+ assertEquals(IteratorUtils.count(source.vertices()), IteratorUtils.count(target.vertices()));
+ assertEquals(IteratorUtils.count(source.edges()), IteratorUtils.count(target.vertices()));
}
}
[12/15] incubator-tinkerpop git commit: Merge
https://github.com/apache/incubator-tinkerpop
Posted by ok...@apache.org.
Merge https://github.com/apache/incubator-tinkerpop
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/d302a3bb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/d302a3bb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/d302a3bb
Branch: refs/heads/master
Commit: d302a3bbf0e943a54ad07b0ddb24007255b23634
Parents: 8ac487f 039828b
Author: Benjamin Han <be...@siftsec.com>
Authored: Tue Jan 12 07:03:13 2016 -0800
Committer: Benjamin Han <be...@siftsec.com>
Committed: Tue Jan 12 07:03:13 2016 -0800
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
docs/src/dev/developer/contributing.asciidoc | 5 +--
docs/src/reference/implementations.asciidoc | 2 +
.../lambda/AbstractLambdaTraversal.java | 2 +-
.../gremlin/process/GremlinProcessRunner.java | 2 +-
hadoop-gremlin/conf/hadoop-gryo.properties | 2 +
.../tinkerpop/gremlin/hadoop/Constants.java | 2 +
.../hadoop/structure/HadoopConfiguration.java | 10 ++---
.../neo4j/AbstractNeo4jGraphProvider.java | 4 +-
.../neo4j/MultiMetaNeo4jGraphProvider.java | 1 +
.../neo4j/NoMultiNoMetaNeo4jGraphProvider.java | 1 +
.../process/computer/SparkGraphComputer.java | 4 +-
.../gremlin/spark/structure/Spark.java | 3 +-
.../spark/structure/io/PersistedOutputRDD.java | 10 +++--
.../io/PersistedInputOutputRDDTest.java | 40 ++++++++++++++++++++
15 files changed, 72 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
[07/15] incubator-tinkerpop git commit: Fix graphMl reader test
Posted by ok...@apache.org.
Fix graphMl reader test
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/7b700c13
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/7b700c13
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/7b700c13
Branch: refs/heads/master
Commit: 7b700c130a5af9bf598c1a7d2ebec918daf9630c
Parents: 413caf5
Author: Benjamin Han <be...@siftsec.com>
Authored: Thu Dec 10 09:15:07 2015 -0800
Committer: Benjamin Han <be...@siftsec.com>
Committed: Thu Dec 10 09:15:07 2015 -0800
----------------------------------------------------------------------
.../tinkerpop/gremlin/structure/io/IoTest.java | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7b700c13/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
index 2635b85..1c1e567 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
@@ -263,17 +263,15 @@ public class IoTest {
v1.addEdge("CONTROL", v2);
v1.addEdge("SELF-LOOP", v1);
- final GraphMLWriter w = GraphMLWriter.build().create();
- final File f = TestHelper.generateTempFile(this.getClass(), "test", ".txt");
- try (final OutputStream out = new FileOutputStream(f)) {
- w.writeGraph(out, graph);
- }
-
final Configuration targetConf = graphProvider.newGraphConfiguration("target", this.getClass(), name.getMethodName(), null);
final Graph target = GraphFactory.open(targetConf);
- final GraphMLReader r = GraphMLReader.build().create();
- try (final InputStream in = new FileInputStream(f)) {
- r.readGraph(in, target);
+ try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
+ source.io(IoCore.graphml()).writer().create().writeGraph(os, source);
+ try (ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray())) {
+ target.io(IoCore.graphml()).reader().create().readGraph(is, target);
+ }
+ } catch (IOException ioe) {
+ throw new RuntimeException(ioe);
}
assertEquals(IteratorUtils.count(source.vertices()), IteratorUtils.count(target.vertices()));
[08/15] incubator-tinkerpop git commit: Fix typo in test
Posted by ok...@apache.org.
Fix typo in test
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/1cd464b8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/1cd464b8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/1cd464b8
Branch: refs/heads/master
Commit: 1cd464b8d5e34b7352514cabd772241bca596e6c
Parents: 7b700c1
Author: Benjamin Han <be...@siftsec.com>
Authored: Fri Dec 11 16:31:24 2015 -0800
Committer: Benjamin Han <be...@siftsec.com>
Committed: Fri Dec 11 16:31:24 2015 -0800
----------------------------------------------------------------------
.../org/apache/tinkerpop/gremlin/structure/io/IoTest.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1cd464b8/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
index 1c1e567..d2202f3 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
@@ -275,7 +275,7 @@ public class IoTest {
}
assertEquals(IteratorUtils.count(source.vertices()), IteratorUtils.count(target.vertices()));
- assertEquals(IteratorUtils.count(source.edges()), IteratorUtils.count(target.vertices()));
+ assertEquals(IteratorUtils.count(source.edges()), IteratorUtils.count(target.edges()));
}
}
@@ -305,7 +305,7 @@ public class IoTest {
}
assertEquals(IteratorUtils.count(source.vertices()), IteratorUtils.count(target.vertices()));
- assertEquals(IteratorUtils.count(source.edges()), IteratorUtils.count(target.vertices()));
+ assertEquals(IteratorUtils.count(source.edges()), IteratorUtils.count(target.edges()));
}
}
@@ -450,8 +450,11 @@ public class IoTest {
throw new RuntimeException(ioe);
}
+ System.out.println("\n\n\n\nSource: \n" + source.vertices() + "\n" + source.edges());
+ System.out.println("\n\n\n\nTarget: \n" + target.vertices() + "\n" + target.edges());
+
assertEquals(IteratorUtils.count(source.vertices()), IteratorUtils.count(target.vertices()));
- assertEquals(IteratorUtils.count(source.edges()), IteratorUtils.count(target.vertices()));
+ assertEquals(IteratorUtils.count(source.edges()), IteratorUtils.count(target.edges()));
}
}
[02/15] incubator-tinkerpop git commit: Add test case
Posted by ok...@apache.org.
Add test case
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/19d0a81f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/19d0a81f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/19d0a81f
Branch: refs/heads/master
Commit: 19d0a81f5d78b4f3d00d8f07da15600d80c848f4
Parents: 1892d7c
Author: Benjamin Han <be...@siftsec.com>
Authored: Wed Dec 9 14:22:15 2015 -0800
Committer: Benjamin Han <be...@siftsec.com>
Committed: Wed Dec 9 14:22:15 2015 -0800
----------------------------------------------------------------------
.../io/graphson/GraphSONReaderTest.java | 62 ++++++++++++++++++++
1 file changed, 62 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/19d0a81f/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReaderTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReaderTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReaderTest.java
new file mode 100644
index 0000000..1dbfddb
--- /dev/null
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReaderTest.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.structure.io.graphson;
+
+import org.apache.commons.configuration.Configuration;
+import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.io.IoCore;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.junit.Test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Created by Benjamin Han
+ */
+public class GraphSONReaderTest extends AbstractGremlinTest {
+
+ @Test
+ public void shouldReadWriteSelfLoopingEdges() {
+ final Configuration sourceConf = graphProvider.newGraphConfiguration("source", this.getClass(), name.getMethodName(), null);
+ final Graph source = GraphFactory.open(sourceConf);
+ Vertex v1 = source.addVertex();
+ Vertex v2 = source.addVertex();
+ v1.addEdge("CONTROL", v2);
+ v1.addEdge("SELF-LOOP", v1);
+
+ final Configuration targetConf = graphProvider.newGraphConfiguration("target", this.getClass(), name.getMethodName(), null);
+ final Graph target = GraphFactory.open(targetConf);
+ try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
+ source.io(IoCore.graphson()).writer().create().writeGraph(os, source);
+ ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
+ target.io(IoCore.graphson()).reader().create().readGraph(is, target);
+ } catch (IOException ioe) {
+ throw new RuntimeException(ioe);
+ }
+
+ assertEquals(source.traversal().V().count(), target.traversal().V().count());
+ assertEquals(source.traversal().E().count(), target.traversal().E().count());
+ }
+}
[04/15] incubator-tinkerpop git commit: Add gryo,
graphML tests to IoTest
Posted by ok...@apache.org.
Add gryo, graphML tests to IoTest
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/11b90090
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/11b90090
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/11b90090
Branch: refs/heads/master
Commit: 11b9009043c2be8171754dac98fd00e41678aa20
Parents: 38ad2a0
Author: Benjamin Han <be...@siftsec.com>
Authored: Wed Dec 9 17:01:31 2015 -0800
Committer: Benjamin Han <be...@siftsec.com>
Committed: Wed Dec 9 17:01:31 2015 -0800
----------------------------------------------------------------------
.../tinkerpop/gremlin/structure/io/IoTest.java | 64 +++++++++++++++++++-
1 file changed, 63 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/11b90090/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
index 192fd26..6848f6c 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
@@ -250,6 +250,65 @@ public class IoTest {
// need to manually close the "g2" instance
graphProvider.clear(g2, configuration);
}
+
+ @Test
+ @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
+ @FeatureRequirement(featureClass = EdgePropertyFeatures.class, feature = FEATURE_STRING_VALUES)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+ public void shouldReadWriteSelfLoopingEdges() throws Exception {
+ final Configuration sourceConf = graphProvider.newGraphConfiguration("source", this.getClass(), name.getMethodName(), null);
+ final Graph source = GraphFactory.open(sourceConf);
+ final Vertex v1 = source.addVertex();
+ final Vertex v2 = source.addVertex();
+ v1.addEdge("CONTROL", v2);
+ v1.addEdge("SELF-LOOP", v1);
+
+ final GraphMLWriter w = GraphMLWriter.build().create();
+ final File f = TestHelper.generateTempFile(this.getClass(), "test", ".txt");
+ try (final OutputStream out = new FileOutputStream(f)) {
+ w.writeGraph(out, graph);
+ }
+
+ final Configuration targetConf = graphProvider.newGraphConfiguration("target", this.getClass(), name.getMethodName(), null);
+ final Graph target = GraphFactory.open(targetConf);
+ final GraphMLReader r = GraphMLReader.build().create();
+ try (final InputStream in = new FileInputStream(f)) {
+ r.readGraph(in, target);
+ }
+
+ assertEquals(source.traversal().V().count(), target.traversal().V().count());
+ assertEquals(source.traversal().E().count(), target.traversal().E().count());
+ }
+ }
+
+ public static final class GryoTest extends AbstractGremlinTest {
+
+ @Test
+ @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
+ @FeatureRequirement(featureClass = EdgePropertyFeatures.class, feature = FEATURE_STRING_VALUES)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+ public void shouldReadWriteSelfLoopingEdges() {
+ final Configuration sourceConf = graphProvider.newGraphConfiguration("source", this.getClass(), name.getMethodName(), null);
+ final Graph source = GraphFactory.open(sourceConf);
+ final Vertex v1 = source.addVertex();
+ final Vertex v2 = source.addVertex();
+ v1.addEdge("CONTROL", v2);
+ v1.addEdge("SELF-LOOP", v1);
+
+ final Configuration targetConf = graphProvider.newGraphConfiguration("target", this.getClass(), name.getMethodName(), null);
+ final Graph target = GraphFactory.open(targetConf);
+ try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
+ source.io(IoCore.gryo()).writer().create().writeGraph(os, source);
+ try (ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray())) {
+ target.io(IoCore.gryo()).reader().create().readGraph(is, target);
+ }
+ } catch (IOException ioe) {
+ throw new RuntimeException(ioe);
+ }
+
+ assertEquals(source.traversal().V().count(), target.traversal().V().count());
+ assertEquals(source.traversal().E().count(), target.traversal().E().count());
+ }
}
public static final class GraphSONTest extends AbstractGremlinTest {
@@ -371,7 +430,10 @@ public class IoTest {
}
@Test
- public void shouldReadWriteSelfLoopingEdges() {
+ @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
+ @FeatureRequirement(featureClass = EdgePropertyFeatures.class, feature = FEATURE_STRING_VALUES)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+ public void shouldReadWriteSelfLoopingEdges() throws Exception {
final Configuration sourceConf = graphProvider.newGraphConfiguration("source", this.getClass(), name.getMethodName(), null);
final Graph source = GraphFactory.open(sourceConf);
final Vertex v1 = source.addVertex();
[05/15] incubator-tinkerpop git commit: Fix bad test comparison
Posted by ok...@apache.org.
Fix bad test comparison
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/4f7ed10a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/4f7ed10a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/4f7ed10a
Branch: refs/heads/master
Commit: 4f7ed10a146bcb0a66cb9217304bd3d0a5c7a22b
Parents: 11b9009
Author: Benjamin Han <be...@siftsec.com>
Authored: Thu Dec 10 09:01:40 2015 -0800
Committer: Benjamin Han <be...@siftsec.com>
Committed: Thu Dec 10 09:01:40 2015 -0800
----------------------------------------------------------------------
.../java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4f7ed10a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
index 6848f6c..bae5df3 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
@@ -306,8 +306,8 @@ public class IoTest {
throw new RuntimeException(ioe);
}
- assertEquals(source.traversal().V().count(), target.traversal().V().count());
- assertEquals(source.traversal().E().count(), target.traversal().E().count());
+ assertEquals(IteratorUtils.count(source.vertices()), IteratorUtils.count(target.vertices()));
+ assertEquals(IteratorUtils.count(source.edges()), IteratorUtils.count(target.vertices()));
}
}
[09/15] incubator-tinkerpop git commit: Remove debug lines
Posted by ok...@apache.org.
Remove debug lines
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/7578c603
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/7578c603
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/7578c603
Branch: refs/heads/master
Commit: 7578c6039823d0784b2e44e8fd5babf80cdbe8ee
Parents: 1cd464b
Author: Benjamin Han <be...@siftsec.com>
Authored: Fri Dec 11 16:38:45 2015 -0800
Committer: Benjamin Han <be...@siftsec.com>
Committed: Fri Dec 11 16:38:45 2015 -0800
----------------------------------------------------------------------
.../java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java | 3 ---
1 file changed, 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7578c603/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
index d2202f3..1dc3a42 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
@@ -450,9 +450,6 @@ public class IoTest {
throw new RuntimeException(ioe);
}
- System.out.println("\n\n\n\nSource: \n" + source.vertices() + "\n" + source.edges());
- System.out.println("\n\n\n\nTarget: \n" + target.vertices() + "\n" + target.edges());
-
assertEquals(IteratorUtils.count(source.vertices()), IteratorUtils.count(target.vertices()));
assertEquals(IteratorUtils.count(source.edges()), IteratorUtils.count(target.edges()));
}
[10/15] incubator-tinkerpop git commit: Match Gryo Reader edge
traversal direction to that of StarGraph
Posted by ok...@apache.org.
Match Gryo Reader edge traversal direction to that of StarGraph
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/6399d19b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/6399d19b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/6399d19b
Branch: refs/heads/master
Commit: 6399d19b293f9658a607e9e0d18a31a4256f3b20
Parents: 7578c60
Author: Benjamin Han <be...@siftsec.com>
Authored: Fri Dec 11 16:47:35 2015 -0800
Committer: Benjamin Han <be...@siftsec.com>
Committed: Fri Dec 11 16:47:35 2015 -0800
----------------------------------------------------------------------
.../org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/6399d19b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
index 084b4df..d457ffb 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
@@ -93,7 +93,7 @@ public final class GryoReader implements GraphReader {
graphToWriteTo.tx().commit();
return v;
}, null, null));
- cache.entrySet().forEach(kv -> kv.getKey().edges(Direction.OUT).forEachRemaining(e -> {
+ cache.entrySet().forEach(kv -> kv.getKey().edges(Direction.IN).forEachRemaining(e -> {
// can't use a standard Attachable attach method here because we have to use the cache for those
// graphs that don't support userSuppliedIds on edges. note that outVertex/inVertex methods return
// StarAdjacentVertex whose equality should match StarVertex.