You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2015/06/15 17:49:41 UTC

[1/4] incubator-tinkerpop git commit: Initialize the config for gremlin-groovy in Settings.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/xmatch 3103f4731 -> 40e922131


Initialize the config for gremlin-groovy in Settings.

Using an empty Map for the default.


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

Branch: refs/heads/xmatch
Commit: 6eeef7207abc65cdac1678de61d6809ef3a85739
Parents: be988ce
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 15 10:32:50 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jun 15 10:32:50 2015 -0400

----------------------------------------------------------------------
 .../org/apache/tinkerpop/gremlin/server/Settings.java     | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/6eeef720/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
index 1dcaccb..1393897 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
@@ -19,7 +19,6 @@
 package org.apache.tinkerpop.gremlin.server;
 
 import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
-import org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0;
 import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
@@ -27,7 +26,6 @@ import org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer;
 import info.ganglia.gmetric4j.gmetric.GMetric;
 import org.apache.tinkerpop.gremlin.server.util.LifeCycleHook;
 import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper;
 import org.yaml.snakeyaml.TypeDescription;
 import org.yaml.snakeyaml.Yaml;
 import org.yaml.snakeyaml.constructor.Constructor;
@@ -36,6 +34,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -57,9 +56,10 @@ public class Settings {
         scriptEngines.put("gremlin-groovy", new ScriptEngineSettings());
 
         serializers = new ArrayList<>();
-        final SerializerSettings graphson = new SerializerSettings();
-        graphson.className = GryoMessageSerializerV1d0.class.getName();
-        serializers.add(graphson);
+        final SerializerSettings gryoSerializerSettings = new SerializerSettings();
+        gryoSerializerSettings.className = GryoMessageSerializerV1d0.class.getName();
+        gryoSerializerSettings.config = Collections.emptyMap();
+        serializers.add(gryoSerializerSettings);
     }
 
     /**


[3/4] incubator-tinkerpop git commit: Fixed a bug in Attachable.getOrCreate(). Optional.orElse() should be Optional.orElseGet().

Posted by ok...@apache.org.
Fixed a bug in Attachable.getOrCreate(). Optional.orElse() should be Optional.orElseGet().


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

Branch: refs/heads/xmatch
Commit: 40684774bb42dc544819c483ad9d930a7218bb6e
Parents: 3a5cdf8
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Jun 15 09:48:52 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Jun 15 09:49:03 2015 -0600

----------------------------------------------------------------------
 .../gremlin/structure/util/Attachable.java         | 10 +++++-----
 .../gremlin/structure/util/star/StarGraphTest.java | 17 +++++++++++++++++
 2 files changed, 22 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/40684774/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Attachable.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Attachable.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Attachable.java
index 4489191..fa999aa 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Attachable.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Attachable.java
@@ -57,7 +57,7 @@ public interface Attachable<V> {
      * @param method a {@link Function} that takes an {@link Attachable} and returns the "re-attached" object
      * @return the return value of the {@code method}
      * @throws IllegalStateException if the {@link Attachable} is not a "graph" object (i.e. host or
-     * attachable don't work together)
+     *                               attachable don't work together)
      */
     public default V attach(final Function<Attachable<V>, V> method) throws IllegalStateException {
         return method.apply(this);
@@ -112,28 +112,28 @@ public interface Attachable<V> {
                     return (V) (hostVertexOrGraph instanceof Graph ?
                             Method.getVertex((Attachable<Vertex>) attachable, (Graph) hostVertexOrGraph) :
                             Method.getVertex((Attachable<Vertex>) attachable, (Vertex) hostVertexOrGraph))
-                            .orElse(hostVertexOrGraph instanceof Graph ?
+                            .orElseGet(() -> hostVertexOrGraph instanceof Graph ?
                                     Method.createVertex((Attachable<Vertex>) attachable, (Graph) hostVertexOrGraph) :
                                     Method.createVertex((Attachable<Vertex>) attachable, (Vertex) hostVertexOrGraph));
                 } else if (base instanceof Edge) {
                     return (V) (hostVertexOrGraph instanceof Graph ?
                             Method.getEdge((Attachable<Edge>) attachable, (Graph) hostVertexOrGraph) :
                             Method.getEdge((Attachable<Edge>) attachable, (Vertex) hostVertexOrGraph))
-                            .orElse(hostVertexOrGraph instanceof Graph ?
+                            .orElseGet(() -> hostVertexOrGraph instanceof Graph ?
                                     Method.createEdge((Attachable<Edge>) attachable, (Graph) hostVertexOrGraph) :
                                     Method.createEdge((Attachable<Edge>) attachable, (Vertex) hostVertexOrGraph));
                 } else if (base instanceof VertexProperty) {
                     return (V) (hostVertexOrGraph instanceof Graph ?
                             Method.getVertexProperty((Attachable<VertexProperty>) attachable, (Graph) hostVertexOrGraph) :
                             Method.getVertexProperty((Attachable<VertexProperty>) attachable, (Vertex) hostVertexOrGraph))
-                            .orElse(hostVertexOrGraph instanceof Graph ?
+                            .orElseGet(() -> hostVertexOrGraph instanceof Graph ?
                                     Method.createVertexProperty((Attachable<VertexProperty>) attachable, (Graph) hostVertexOrGraph) :
                                     Method.createVertexProperty((Attachable<VertexProperty>) attachable, (Vertex) hostVertexOrGraph));
                 } else if (base instanceof Property) {
                     return (V) (hostVertexOrGraph instanceof Graph ?
                             Method.getProperty((Attachable<Property>) attachable, (Graph) hostVertexOrGraph) :
                             Method.getProperty((Attachable<Property>) attachable, (Vertex) hostVertexOrGraph))
-                            .orElse(hostVertexOrGraph instanceof Graph ?
+                            .orElseGet(() -> hostVertexOrGraph instanceof Graph ?
                                     Method.createProperty((Attachable<Property>) attachable, (Graph) hostVertexOrGraph) :
                                     Method.createProperty((Attachable<Property>) attachable, (Vertex) hostVertexOrGraph));
                 } else

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/40684774/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphTest.java
index bf154f4..e61313a 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.structure.util.star;
 
+import org.apache.commons.configuration.Configuration;
 import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
 import org.apache.tinkerpop.gremlin.FeatureRequirement;
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
@@ -39,9 +40,11 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Random;
 import java.util.Set;
 import java.util.UUID;
+import java.util.stream.Collectors;
 
 import static org.junit.Assert.assertEquals;
 
@@ -101,6 +104,20 @@ public class StarGraphTest extends AbstractGremlinTest {
     }
 
     @Test
+    @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
+    public void shouldCopyFromGraphAToGraphB() throws Exception {
+        final Configuration configuration = graphProvider.newGraphConfiguration("readGraph", this.getClass(), name.getMethodName(), null);
+        final Graph g1 = graphProvider.openTestGraph(configuration);
+
+        List<StarGraph> starVertices = IteratorUtils.stream(graph.vertices()).map(StarGraph::of).collect(Collectors.toList());
+        starVertices.forEach(starVertex -> starVertex.edges().forEachRemaining(edge -> ((Attachable<Edge>) edge).attach(Attachable.Method.getOrCreate(g1))));
+        assertEquals(IteratorUtils.count(graph.vertices()), IteratorUtils.count(g1.vertices()));
+        assertEquals(IteratorUtils.count(graph.edges()), IteratorUtils.count(g1.edges()));
+        // TODO: you can't get adjacent labels -- graph.vertices().forEachRemaining(vertex -> TestHelper.validateVertexEquality(vertex, g1.vertices(vertex.id()).next(), true));
+        graphProvider.clear(g1, configuration);
+    }
+
+    @Test
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_USER_SUPPLIED_IDS)
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexPropertyFeatures.FEATURE_USER_SUPPLIED_IDS)
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_USER_SUPPLIED_IDS)


[4/4] incubator-tinkerpop git commit: Merge branch 'master' into xmatch

Posted by ok...@apache.org.
Merge branch 'master' into xmatch


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

Branch: refs/heads/xmatch
Commit: 40e9221318582f100a1f727c4ca71cfeefcf2c27
Parents: 3103f47 4068477
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Jun 15 09:49:33 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Jun 15 09:49:33 2015 -0600

----------------------------------------------------------------------
 .../gremlin/structure/util/Attachable.java         | 10 +++++-----
 .../apache/tinkerpop/gremlin/server/Settings.java  | 10 +++++-----
 .../gremlin/structure/util/star/StarGraphTest.java | 17 +++++++++++++++++
 3 files changed, 27 insertions(+), 10 deletions(-)
----------------------------------------------------------------------



[2/4] incubator-tinkerpop git commit: Merge remote-tracking branch 'origin/master'

Posted by ok...@apache.org.
Merge remote-tracking branch 'origin/master'


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

Branch: refs/heads/xmatch
Commit: 3a5cdf812140b760e12fcdc5090cfbc59a83ec04
Parents: 6eeef72 d49f409
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 15 10:33:44 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jun 15 10:33:44 2015 -0400

----------------------------------------------------------------------
 docs/src/the-traversal.asciidoc                 |  9 ++++++
 .../gremlin/process/traversal/Path.java         |  2 +-
 .../gremlin/process/traversal/Pop.java          |  6 ++++
 .../traversal/step/util/ImmutablePath.java      | 30 +++++++++-----------
 .../traversal/step/util/MutablePath.java        |  2 +-
 .../gremlin/process/traversal/PathTest.java     | 14 ++++-----
 pom.xml                                         |  5 ++++
 7 files changed, 43 insertions(+), 25 deletions(-)
----------------------------------------------------------------------