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/04/27 14:34:35 UTC

[01/27] tinkerpop git commit: TINKERPOP-1947 Fixed path history problem with mutations [Forced Update!]

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1595 7869eb6f2 -> 074ab1e5d (forced update)


TINKERPOP-1947 Fixed path history problem with mutations

When a key of a mutation was a traversal it was not being integrated to the parent traversal and tracked in the Parameters.


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

Branch: refs/heads/TINKERPOP-1595
Commit: 8fbfab7947d3cf547f7c27025be6876c5d86a1a4
Parents: b99c56a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Apr 19 14:25:33 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Apr 19 14:25:33 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../process/traversal/step/util/Parameters.java | 30 +++++++++++---------
 .../step/map/GroovyAddVertexTest.groovy         |  5 ++++
 gremlin-test/features/map/AddVertex.feature     | 27 ++++++++++++++++++
 .../traversal/step/map/AddVertexTest.java       | 20 +++++++++++--
 5 files changed, 68 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8fbfab79/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 0f3a71a..6f7baa5 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -23,6 +23,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 [[release-3-2-9]]
 === TinkerPop 3.2.9 (Release Date: NOT OFFICIALLY RELEASED YET)
 
+* Fixed bug where path history was not being preserved for keys in mutations.
 * Bumped to httpclient 4.5.5.
 
 [[release-3-2-8]]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8fbfab79/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
index 7fae30a..d368322 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
@@ -174,26 +174,30 @@ public final class Parameters implements Cloneable, Serializable {
         if (keyValues.length % 2 != 0)
             throw Element.Exceptions.providedKeyValuesMustBeAMultipleOfTwo();
 
-        for (int i = 0; i < keyValues.length; i = i + 2) {
-            if (!(keyValues[i] instanceof String) && !(keyValues[i] instanceof T) && !(keyValues[i] instanceof Traversal))
+        for (int ix = 0; ix < keyValues.length; ix = ix + 2) {
+            if (!(keyValues[ix] instanceof String) && !(keyValues[ix] instanceof T) && !(keyValues[ix] instanceof Traversal))
                 throw new IllegalArgumentException("The provided key/value array must have a String, T, or Traversal on even array indices");
 
-            if (keyValues[i + 1] != null) {
-                // track the list of traversals that are present so that elsewhere in Parameters there is no need
-                // to iterate all values to not find any. also grab available labels in traversal values
-                if (keyValues[i + 1] instanceof Traversal.Admin) {
-                    final Traversal.Admin t = (Traversal.Admin) keyValues[i + 1];
-                    addTraversal(t);
-                    if (parent != null) parent.integrateChild(t);
+            if (keyValues[ix + 1] != null) {
+
+                // check both key and value for traversal instances. track the list of traversals that are present so
+                // that elsewhere in Parameters there is no need to iterate all values to not find any. also grab
+                // available labels in traversal values
+                for (int iy = 0; iy < 2; iy++) {
+                    if (keyValues[ix + iy] instanceof Traversal.Admin) {
+                        final Traversal.Admin t = (Traversal.Admin) keyValues[ix + iy];
+                        addTraversal(t);
+                        if (parent != null) parent.integrateChild(t);
+                    }
                 }
 
-                List<Object> values = this.parameters.get(keyValues[i]);
+                List<Object> values = this.parameters.get(keyValues[ix]);
                 if (null == values) {
                     values = new ArrayList<>();
-                    values.add(keyValues[i + 1]);
-                    this.parameters.put(keyValues[i], values);
+                    values.add(keyValues[ix + 1]);
+                    this.parameters.put(keyValues[ix], values);
                 } else {
-                    values.add(keyValues[i + 1]);
+                    values.add(keyValues[ix + 1]);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8fbfab79/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddVertexTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddVertexTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddVertexTest.groovy
index 1956a7e..b9d753b 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddVertexTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddVertexTest.groovy
@@ -81,6 +81,11 @@ public abstract class GroovyAddVertexTest {
             new ScriptTraversal<>(g, "gremlin-groovy", "g.withSideEffect('a', 'marko').addV().property('name', select('a')).name")
         }
 
+        @Override
+        public Traversal<Vertex, String> get_g_withSideEffectXa_nameX_addV_propertyXselectXaX_markoX_name() {
+            new ScriptTraversal<>(g, "gremlin-groovy", "g.withSideEffect('a', 'name').addV().property(select('a'), 'marko').name")
+        }
+
         ///////// DEPRECATED BELOW
 
         @Override

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8fbfab79/gremlin-test/features/map/AddVertex.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/AddVertex.feature b/gremlin-test/features/map/AddVertex.feature
index 2813733..996521b 100644
--- a/gremlin-test/features/map/AddVertex.feature
+++ b/gremlin-test/features/map/AddVertex.feature
@@ -308,3 +308,30 @@ Feature: Step - addV()
       | result |
       | m[{"temp": ["test"], "name": ["lop"]}] |
       | m[{"temp": ["test"], "name": ["ripple"]}] |
+
+  Scenario: g_withSideEffectXa_nameX_addV_propertyXselectXaX_markoX_name
+    Given the empty graph
+    And the graph initializer of
+      """
+      g.addV("person").property(T.id, 1).property("name", "marko").property("age", 29).as("marko").
+        addV("person").property(T.id, 2).property("name", "vadas").property("age", 27).as("vadas").
+        addV("software").property(T.id, 3).property("name", "lop").property("lang", "java").as("lop").
+        addV("person").property(T.id, 4).property("name","josh").property("age", 32).as("josh").
+        addV("software").property(T.id, 5).property("name", "ripple").property("lang", "java").as("ripple").
+        addV("person").property(T.id, 6).property("name", "peter").property("age", 35).as('peter').
+        addE("knows").from("marko").to("vadas").property(T.id, 7).property("weight", 0.5).
+        addE("knows").from("marko").to("josh").property(T.id, 8).property("weight", 1.0).
+        addE("created").from("marko").to("lop").property(T.id, 9).property("weight", 0.4).
+        addE("created").from("josh").to("ripple").property(T.id, 10).property("weight", 1.0).
+        addE("created").from("josh").to("lop").property(T.id, 11).property("weight", 0.4).
+        addE("created").from("peter").to("lop").property(T.id, 12).property("weight", 0.2)
+      """
+    And the traversal of
+      """
+      g.withSideEffect("a", "name").addV().property(__.select("a"), "marko").values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | marko |
+    And the graph should return 2 for count of "g.V().has(\"name\",\"marko\")"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8fbfab79/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java
index d44b439..7cf5e6a 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java
@@ -38,10 +38,8 @@ import java.util.Map;
 
 import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
 import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.select;
-import static org.hamcrest.Matchers.containsInAnyOrder;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 
 /**
@@ -70,6 +68,8 @@ public abstract class AddVertexTest extends AbstractGremlinTest {
 
     public abstract Traversal<Vertex, String> get_g_withSideEffectXa_markoX_addV_propertyXname_selectXaXX_name();
 
+    public abstract Traversal<Vertex, String> get_g_withSideEffectXa_nameX_addV_propertyXselectXaX_markoX_name();
+
     // 3.0.0 DEPRECATIONS
     @Deprecated
     public abstract Traversal<Vertex, Vertex> get_g_V_addVXlabel_animal_age_0X();
@@ -296,6 +296,17 @@ public abstract class AddVertexTest extends AbstractGremlinTest {
         assertFalse(traversal.hasNext());
     }
 
+    @Test
+    @LoadGraphWith(MODERN)
+    @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+    @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
+    public void g_withSideEffectXa_nameX_addV_propertyXselectXaX_markoX_name() {
+        final Traversal<Vertex, String> traversal = get_g_withSideEffectXa_nameX_addV_propertyXselectXaX_markoX_name();
+        printTraversalForm(traversal);
+        assertEquals("marko", traversal.next());
+        assertFalse(traversal.hasNext());
+    }
+
 
     public static class Traversals extends AddVertexTest {
 
@@ -358,5 +369,10 @@ public abstract class AddVertexTest extends AbstractGremlinTest {
         public Traversal<Vertex, String> get_g_withSideEffectXa_markoX_addV_propertyXname_selectXaXX_name() {
             return g.withSideEffect("a", "marko").addV().property("name", select("a")).values("name");
         }
+
+        @Override
+        public Traversal<Vertex, String> get_g_withSideEffectXa_nameX_addV_propertyXselectXaX_markoX_name() {
+            return g.withSideEffect("a", "name").addV().property(select("a"),"marko").values("name");
+        }
     }
 }
\ No newline at end of file


[15/27] tinkerpop git commit: Added unit tests for Order and improved javadoc CTR

Posted by sp...@apache.org.
Added unit tests for Order and improved javadoc CTR


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

Branch: refs/heads/TINKERPOP-1595
Commit: 59545254930c502c8acfe470dd919f36c87cf78c
Parents: 789e575
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Apr 26 08:42:13 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Apr 26 08:42:13 2018 -0400

----------------------------------------------------------------------
 .../gremlin/process/traversal/Order.java        | 29 ++++++--
 .../gremlin/process/traversal/OrderTest.java    | 76 ++++++++++++++++++++
 2 files changed, 100 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/59545254/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
index 7c3475a..3710396 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
@@ -23,10 +23,18 @@ import java.util.Map;
 import java.util.Random;
 
 /**
+ * Provides {@code Comparator} instances for ordering traversers.
+ *
  * @author Marko A. Rodriguez (http://markorodriguez.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public enum Order implements Comparator<Object> {
 
+    /**
+     * Order in ascending fashion
+     *
+     * @since 3.0.0-incubating
+     */
     incr {
         @Override
         public int compare(final Object first, final Object second) {
@@ -39,7 +47,14 @@ public enum Order implements Comparator<Object> {
         public Order reversed() {
             return decr;
         }
-    }, decr {
+    },
+
+    /**
+     * Order in descending fashion.
+     *
+     * @since 3.0.0-incubating
+     */
+    decr {
         @Override
         public int compare(final Object first, final Object second) {
             return first instanceof Number && second instanceof Number
@@ -53,7 +68,8 @@ public enum Order implements Comparator<Object> {
         }
     },
     /**
-     * @deprecated Use {@link org.apache.tinkerpop.gremlin.structure.Column#keys};
+     * @since 3.0.0-incubating
+     * @deprecated As of release 3.1.1-incubating, replaced by {@link org.apache.tinkerpop.gremlin.structure.Column#keys}.
      */
     @Deprecated
     keyIncr {
@@ -68,7 +84,8 @@ public enum Order implements Comparator<Object> {
         }
     },
     /**
-     * @deprecated Use {@link org.apache.tinkerpop.gremlin.structure.Column#values};
+     * @since 3.0.0-incubating
+     * @deprecated As of release 3.1.1-incubating, replaced by {@link org.apache.tinkerpop.gremlin.structure.Column#values}.
      */
     @Deprecated
     valueIncr {
@@ -83,7 +100,8 @@ public enum Order implements Comparator<Object> {
         }
     },
     /**
-     * @deprecated Use {@link org.apache.tinkerpop.gremlin.structure.Column#keys};
+     * @since 3.0.0-incubating
+     * @deprecated As of release 3.1.1-incubating, replaced by {@link org.apache.tinkerpop.gremlin.structure.Column#keys}.
      */
     @Deprecated
     keyDecr {
@@ -98,7 +116,8 @@ public enum Order implements Comparator<Object> {
         }
     },
     /**
-     * @deprecated Use {@link org.apache.tinkerpop.gremlin.structure.Column#values};
+     * @since 3.0.0-incubating
+     * @deprecated As of release 3.1.1-incubating, replaced by {@link org.apache.tinkerpop.gremlin.structure.Column#values}.
      */
     @Deprecated
     valueDecr {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/59545254/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/OrderTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/OrderTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/OrderTest.java
new file mode 100644
index 0000000..01d93ea
--- /dev/null
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/OrderTest.java
@@ -0,0 +1,76 @@
+/*
+ * 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.process.traversal;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+@RunWith(Parameterized.class)
+public class OrderTest {
+
+    private static final SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yyyy");
+
+    @Parameterized.Parameters(name = "{0}.test({1},{2})")
+    public static Iterable<Object[]> data() throws ParseException {
+        return new ArrayList<>(Arrays.asList(new Object[][]{
+                {Order.incr, Arrays.asList("b", "a", "c", "d"), Arrays.asList("a", "b", "c", "d")},
+                {Order.decr, Arrays.asList("b", "a", "c", "d"), Arrays.asList("d", "c", "b", "a")},
+                {Order.incr, Arrays.asList(formatter.parse("1-Jan-2018"), formatter.parse("1-Jan-2020"), formatter.parse("1-Jan-2008")),
+                             Arrays.asList(formatter.parse("1-Jan-2008"), formatter.parse("1-Jan-2018"), formatter.parse("1-Jan-2020"))},
+                {Order.decr, Arrays.asList(formatter.parse("1-Jan-2018"), formatter.parse("1-Jan-2020"), formatter.parse("1-Jan-2008")),
+                             Arrays.asList(formatter.parse("1-Jan-2020"), formatter.parse("1-Jan-2018"), formatter.parse("1-Jan-2008"))},
+                {Order.decr, Arrays.asList(100L, 1L, -1L, 0L), Arrays.asList(100L, 1L, 0L, -1L)},
+                {Order.incr, Arrays.asList(100.1f, 1.1f, -1.1f, 0.1f), Arrays.asList(-1.1f, 0.1f, 1.1f, 100.1f)},
+                {Order.decr, Arrays.asList(100.1f, 1.1f, -1.1f, 0.1f), Arrays.asList(100.1f, 1.1f, 0.1f, -1.1f)},
+                {Order.incr, Arrays.asList(100.1d, 1.1d, -1.1d, 0.1d), Arrays.asList(-1.1d, 0.1d, 1.1d, 100.1d)},
+                {Order.decr, Arrays.asList(100.1d, 1.1d, -1.1d, 0.1d), Arrays.asList(100.1d, 1.1d, 0.1d, -1.1d)},
+                {Order.incr, Arrays.asList(100L, 1L, -1L, 0L), Arrays.asList(-1L, 0L, 1L, 100L)},
+                {Order.decr, Arrays.asList(100L, 1L, -1L, 0L), Arrays.asList(100L, 1L, 0L, -1L)},
+                {Order.incr, Arrays.asList(100, 1, -1, 0), Arrays.asList(-1, 0, 1, 100)},
+                {Order.decr, Arrays.asList(100, 1, -1, 0), Arrays.asList(100, 1, 0, -1)}}));
+    }
+
+    @Parameterized.Parameter(value = 0)
+    public Order order;
+
+    @Parameterized.Parameter(value = 1)
+    public Object toBeOrdered;
+
+    @Parameterized.Parameter(value = 2)
+    public Object expectedOrder;
+
+    @Test
+    public void shouldOrder() {
+        Collections.sort((List) toBeOrdered, order);
+        assertEquals(expectedOrder, toBeOrdered);
+    }
+}


[25/27] tinkerpop git commit: TINKERPOP-1595 Updated changelog

Posted by sp...@apache.org.
TINKERPOP-1595 Updated changelog


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

Branch: refs/heads/TINKERPOP-1595
Commit: f2119bce29615792a235e139047089bbc8c39df2
Parents: e2eebf4
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 24 08:10:12 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 27 10:33:17 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f2119bce/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index f6ca111..b7eabbe 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 * Fixed bug where path history was not being preserved for keys in mutations.
 * Bumped to httpclient 4.5.5.
 * Bumped to Groovy 2.4.15 - fixes bug with `Lambda` construction.
+* Improved performance of `TraversalVertexProgram` and related infrastructure.
 * Improved performance of GraphSON deserialization of `Bytecode`.
 * Improved performance of traversal construction.
 


[12/27] tinkerpop git commit: Minor refacoring of cache access in TraversalStrategies CTR

Posted by sp...@apache.org.
Minor refacoring of cache access in TraversalStrategies CTR


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

Branch: refs/heads/TINKERPOP-1595
Commit: 1d9e6dc6d30c5c7d56e4007527365793eb1f223e
Parents: 0d6f8fc
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 25 09:18:08 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 25 09:18:08 2018 -0400

----------------------------------------------------------------------
 .../process/traversal/TraversalStrategies.java  | 39 ++++++++++----------
 1 file changed, 20 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1d9e6dc6/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
index e84737c..37cd1a6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
@@ -203,7 +203,7 @@ public interface TraversalStrategies extends Serializable, Cloneable {
          * Keeps track of {@link GraphComputer} and/or {@link Graph} classes that have been initialized to the
          * classloader so that they do not have to be reflected again.
          */
-        private static Set<Class> LOADED = ConcurrentHashMap.newKeySet();
+        private static Map<Class, Boolean> LOADED = new ConcurrentHashMap<>();
 
         private static final Map<Class<? extends Graph>, TraversalStrategies> GRAPH_CACHE = new HashMap<>();
         private static final Map<Class<? extends GraphComputer>, TraversalStrategies> GRAPH_COMPUTER_CACHE = new HashMap<>();
@@ -249,26 +249,27 @@ public interface TraversalStrategies extends Serializable, Cloneable {
         }
 
         public static TraversalStrategies getStrategies(final Class graphOrGraphComputerClass) {
-            try {
-                // be sure to load the class so that its static{} traversal strategy registration component is loaded.
-                // this is more important for GraphComputer classes as they are typically not instantiated prior to
-                // strategy usage like Graph classes.
-                if (!LOADED.contains(graphOrGraphComputerClass)) {
-                    final String graphComputerClassName = null != graphOrGraphComputerClass.getDeclaringClass() ?
-                        graphOrGraphComputerClass.getCanonicalName().replace("." + graphOrGraphComputerClass.getSimpleName(), "$" + graphOrGraphComputerClass.getSimpleName()) :
-                        graphOrGraphComputerClass.getCanonicalName();
+            // be sure to load the class so that its static{} traversal strategy registration component is loaded.
+            // this is more important for GraphComputer classes as they are typically not instantiated prior to
+            // strategy usage like Graph classes.
+            LOADED.computeIfAbsent(graphOrGraphComputerClass, unused ->  {
+                final String graphComputerClassName = null != graphOrGraphComputerClass.getDeclaringClass() ?
+                    graphOrGraphComputerClass.getCanonicalName().replace("." + graphOrGraphComputerClass.getSimpleName(), "$" + graphOrGraphComputerClass.getSimpleName()) :
+                    graphOrGraphComputerClass.getCanonicalName();
+
+                try {
                     Class.forName(graphComputerClassName);
-
-                    // keep track of stuff we already loaded once - stuff in this if/statement isn't cheap and this
-                    // method gets called a lot, basically every time a new traversal gets spun up (that includes
-                    // child traversals. perhaps it is possible to just check the cache keys for this information, but
-                    // it's not clear if this method will be called with something not in the cache and if it is and
-                    // it results in error, then we'd probably not want to deal with this block again anyway
-                    LOADED.add(graphOrGraphComputerClass);
+                } catch (ClassNotFoundException e) {
+                    throw new IllegalStateException(e.getMessage(), e);
                 }
-            } catch (final ClassNotFoundException e) {
-                throw new IllegalStateException(e.getMessage(), e);
-            }
+
+                // keep track of stuff we already loaded once - stuff in this if/statement isn't cheap and this
+                // method gets called a lot, basically every time a new traversal gets spun up (that includes
+                // child traversals. perhaps it is possible to just check the cache keys for this information, but
+                // it's not clear if this method will be called with something not in the cache and if it is and
+                // it results in error, then we'd probably not want to deal with this block again anyway
+                return true;
+            });
             
             if (GRAPH_CACHE.containsKey(graphOrGraphComputerClass)) {
                 return GRAPH_CACHE.get(graphOrGraphComputerClass);


[19/27] tinkerpop git commit: Added javadoc in Order CTR

Posted by sp...@apache.org.
Added javadoc in Order CTR


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

Branch: refs/heads/TINKERPOP-1595
Commit: 5fea198c836c9886e7a8cc8abc9ead44956ad2b6
Parents: 0694cd7
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 27 08:34:34 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 27 08:34:34 2018 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/process/traversal/Order.java     | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5fea198c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
index 3710396..c9111f0 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
@@ -67,6 +67,7 @@ public enum Order implements Comparator<Object> {
             return incr;
         }
     },
+
     /**
      * @since 3.0.0-incubating
      * @deprecated As of release 3.1.1-incubating, replaced by {@link org.apache.tinkerpop.gremlin.structure.Column#keys}.
@@ -83,6 +84,7 @@ public enum Order implements Comparator<Object> {
             return keyDecr;
         }
     },
+
     /**
      * @since 3.0.0-incubating
      * @deprecated As of release 3.1.1-incubating, replaced by {@link org.apache.tinkerpop.gremlin.structure.Column#values}.
@@ -99,6 +101,7 @@ public enum Order implements Comparator<Object> {
             return valueDecr;
         }
     },
+
     /**
      * @since 3.0.0-incubating
      * @deprecated As of release 3.1.1-incubating, replaced by {@link org.apache.tinkerpop.gremlin.structure.Column#keys}.
@@ -115,6 +118,7 @@ public enum Order implements Comparator<Object> {
             return keyIncr;
         }
     },
+
     /**
      * @since 3.0.0-incubating
      * @deprecated As of release 3.1.1-incubating, replaced by {@link org.apache.tinkerpop.gremlin.structure.Column#values}.
@@ -130,7 +134,14 @@ public enum Order implements Comparator<Object> {
         public Order reversed() {
             return valueIncr;
         }
-    }, shuffle {
+    },
+
+    /**
+     * Order in a random fashion.
+     *
+     * @since 3.0.0-incubating
+     */
+    shuffle {
         @Override
         public int compare(final Object first, final Object second) {
             return RANDOM.nextBoolean() ? -1 : 1;


[05/27] tinkerpop git commit: Added Pop.all to python gherkin test support

Posted by sp...@apache.org.
Added Pop.all to python gherkin test support

Pop.all in python is Pop.all_ in python - needed that translation for tests that use that expression CTR


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

Branch: refs/heads/TINKERPOP-1595
Commit: 8462f857d78a11e4d383fdc077fe8bb8688cbe67
Parents: c155818
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 24 09:17:18 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Apr 24 09:17:18 2018 -0400

----------------------------------------------------------------------
 gremlin-python/src/main/jython/radish/feature_steps.py | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8462f857/gremlin-python/src/main/jython/radish/feature_steps.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/radish/feature_steps.py b/gremlin-python/src/main/jython/radish/feature_steps.py
index 5cf9059..80137b0 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -25,6 +25,7 @@ from gremlin_python.process.traversal import Barrier, Cardinality, P, Pop, Scope
 from radish import given, when, then
 from hamcrest import *
 
+regex_all = re.compile(r"Pop\.all")
 regex_and = re.compile(r"([(.,\s])and\(")
 regex_as = re.compile(r"([(.,\s])as\(")
 regex_from = re.compile(r"([(.,\s])from\(")
@@ -233,6 +234,7 @@ def _table_assertion(data, result, ctx, ordered):
 
 def _translate(traversal):
     replaced = traversal.replace("\n", "")
+    replaced = regex_all.sub(r"Pop.all_", replaced)
     replaced = regex_and.sub(r"\1and_(", replaced)
     replaced = regex_from.sub(r"\1from_(", replaced)
     replaced = regex_global.sub(r"\1global_", replaced)


[22/27] tinkerpop git commit: TINKERPOP-1595 Refactored reflective lookups for clone()

Posted by sp...@apache.org.
TINKERPOP-1595 Refactored reflective lookups for clone()

Rather than iterate all methods to find clone() just call getMethod() and call that if found. Nothing seems to be exercising this bit of code in our test suite. I forced it by adding clone() temporarily to RangeBiOperator and it worked without issue. Not sure how else to test this.


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

Branch: refs/heads/TINKERPOP-1595
Commit: 1d149c6d56421bacecdd53ab0c223f386bc999db
Parents: 91f078a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 24 08:03:28 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 27 10:32:44 2018 -0400

----------------------------------------------------------------------
 .../gremlin/process/computer/MemoryComputeKey.java   | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1d149c6d/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MemoryComputeKey.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MemoryComputeKey.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MemoryComputeKey.java
index 70adf3d..a9b1532 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MemoryComputeKey.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MemoryComputeKey.java
@@ -79,14 +79,17 @@ public final class MemoryComputeKey<A> implements Serializable, Cloneable {
     public MemoryComputeKey<A> clone() {
         try {
             final MemoryComputeKey<A> clone = (MemoryComputeKey<A>) super.clone();
-            for (final Method method : this.reducer.getClass().getMethods()) {
-                if (method.getName().equals("clone") && 0 == method.getParameterCount()) {
-                    clone.reducer = (BinaryOperator<A>) method.invoke(this.reducer);
-                    break;
-                }
+
+            try {
+                final Method cloneMethod = this.reducer.getClass().getMethod("clone");
+                if (cloneMethod != null)
+                    clone.reducer = (BinaryOperator<A>) cloneMethod.invoke(this.reducer);
+            } catch(Exception ignored) {
+
             }
+
             return clone;
-        } catch (final IllegalAccessException | InvocationTargetException | CloneNotSupportedException e) {
+        } catch (final CloneNotSupportedException e) {
             throw new IllegalStateException(e.getMessage(), e);
         }
     }


[18/27] tinkerpop git commit: Fix title formatting in olap/spark/yarn recipe CTR

Posted by sp...@apache.org.
Fix title formatting in olap/spark/yarn recipe CTR


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

Branch: refs/heads/TINKERPOP-1595
Commit: 0694cd7cf7368752ddac041218a76c2db921983b
Parents: 09fd327
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 27 08:33:03 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 27 08:33:03 2018 -0400

----------------------------------------------------------------------
 docs/src/recipes/olap-spark-yarn.asciidoc | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0694cd7c/docs/src/recipes/olap-spark-yarn.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/recipes/olap-spark-yarn.asciidoc b/docs/src/recipes/olap-spark-yarn.asciidoc
index 1543829..54ecf77 100644
--- a/docs/src/recipes/olap-spark-yarn.asciidoc
+++ b/docs/src/recipes/olap-spark-yarn.asciidoc
@@ -15,8 +15,7 @@ See the License for the specific language governing permissions and
 limitations under the License.
 ////
 [[olap-spark-yarn]]
-OLAP traversals with Spark on YARN
-----------------------------------
+== OLAP traversals with Spark on YARN
 
 TinkerPop's combination of link:http://tinkerpop.apache.org/docs/x.y.z/reference/#sparkgraphcomputer[SparkGraphComputer]
 and link:http://tinkerpop.apache.org/docs/x.y.z/reference/#_properties_files[HadoopGraph] allows for running
@@ -26,8 +25,7 @@ where Spark runs locally or where the cluster is managed by a Spark server. Howe
 via the http://hadoop.apache.org/[Hadoop 2.x] Resource Manager (YARN), which requires `SparkGraphComputer` to be
 configured differently. This recipe describes this configuration.
 
-Approach
-~~~~~~~~
+=== Approach
 
 Most configuration problems of TinkerPop with Spark on YARN stem from three reasons:
 
@@ -40,8 +38,8 @@ The current recipe follows a minimalist approach in which no dependencies are ad
 included in the TinkerPop binary distribution. The Hadoop cluster's Spark installation is completely ignored. This
 approach minimizes the chance of dependency version conflicts.
 
-Prerequisites
-~~~~~~~~~~~~~
+=== Prerequisites
+
 This recipe is suitable for both a real external and a local pseudo Hadoop cluster. While the recipe is maintained
 for the vanilla Hadoop pseudo-cluster, it has been reported to work on real clusters with Hadoop distributions
 from various vendors.
@@ -79,8 +77,7 @@ export HADOOP_GREMLIN_LIBS=$GREMLIN_HOME/empty
 bin/gremlin.sh
 ----
 
-Running the job
-~~~~~~~~~~~~~~~
+=== Running the job
 
 You can now run a gremlin OLAP query with Spark on YARN:
 
@@ -118,8 +115,7 @@ the YARN Resource Manager UI (e.g. \http://rm.your.domain:8088/cluster), provide
 `yarn.log-aggregation-enable` property set to `true`. See the Spark documentation for
 https://spark.apache.org/docs/latest/running-on-yarn.html#debugging-your-application[additional hints].
 
-Explanation
-~~~~~~~~~~~
+=== Explanation
 
 This recipe does not require running the `bin/hadoop/init-tp-spark.sh` script described in the
 link:http://tinkerpop.apache.org/docs/x.y.z/reference/#sparkgraphcomputer[reference documentation] and thus is also
@@ -138,8 +134,8 @@ The `gremlin.spark.persistContext` property is explained in the reference docume
 link:http://tinkerpop.apache.org/docs/x.y.z/reference/#sparkgraphcomputer[SparkGraphComputer]: it helps in getting
 follow-up OLAP queries answered faster, because you skip the overhead for getting resources from YARN.
 
-Additional configuration options
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+=== Additional configuration options
+
 This recipe does most of the graph configuration in the Gremlin Console so that environment variables can be used and
 the chance of configuration mistakes is minimal. Once you have your setup working, it is probably easier to make a copy
 of the `conf/hadoop/hadoop-gryo.properties` file and put the property values specific to your environment there. This is


[21/27] tinkerpop git commit: TINKERPOP-1595 Removed stream() usage

Posted by sp...@apache.org.
TINKERPOP-1595 Removed stream() usage


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

Branch: refs/heads/TINKERPOP-1595
Commit: 91f078a79de8ef4445a00e568cce1bff09a7095d
Parents: 344d1b2
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 24 08:02:31 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 27 10:32:44 2018 -0400

----------------------------------------------------------------------
 .../traversal/step/map/TraversalVertexProgramStep.java    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/91f078a7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java
index e866ce2..a49cc27 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java
@@ -32,6 +32,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequire
 import org.apache.tinkerpop.gremlin.process.traversal.util.PureTraversal;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 
 import java.util.Collections;
 import java.util.List;
@@ -73,11 +74,10 @@ public final class TraversalVertexProgramStep extends VertexProgramStep implemen
     public TraversalVertexProgram generateProgram(final Graph graph, final Memory memory) {
         final Traversal.Admin<?, ?> computerSpecificTraversal = this.computerTraversal.getPure();
         final TraversalStrategies computerSpecificStrategies = this.getTraversal().getStrategies().clone();
-        TraversalStrategies.GlobalCache.getStrategies(graph.getClass())
-                .toList()
-                .stream()
-                .filter(s -> s instanceof TraversalStrategy.ProviderOptimizationStrategy)
-                .forEach(computerSpecificStrategies::addStrategies);
+
+        IteratorUtils.filter(TraversalStrategies.GlobalCache.getStrategies(graph.getClass()).toList(),
+                s -> s instanceof TraversalStrategy.ProviderOptimizationStrategy).forEach(computerSpecificStrategies::addStrategies);
+
         computerSpecificTraversal.setStrategies(computerSpecificStrategies);
         computerSpecificTraversal.setSideEffects(new MemoryTraversalSideEffects(this.getTraversal().getSideEffects()));
         computerSpecificTraversal.setParent(this);


[06/27] tinkerpop git commit: Fixed typo in JavaDoc: TraversalEngine

Posted by sp...@apache.org.
Fixed typo in JavaDoc: TraversalEngine


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

Branch: refs/heads/TINKERPOP-1595
Commit: 379242222a9381359986031285cc19250816effd
Parents: 682f298
Author: Justin Chu <15...@users.noreply.github.com>
Authored: Tue Apr 24 22:46:33 2018 -0400
Committer: Justin Chu <15...@users.noreply.github.com>
Committed: Tue Apr 24 22:46:33 2018 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/process/traversal/TraversalEngine.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/37924222/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalEngine.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalEngine.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalEngine.java
index 052b99b..d58c988 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalEngine.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalEngine.java
@@ -33,7 +33,7 @@ import java.util.Optional;
  * Every {@link TraversalSource} should be provided a {@link TraversalEngine.Builder} so it can construct an engine for each spawned {@link Traversal}.
  *
  * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @deprecated As of release 3.2.0, replaced by {@code Computer}.
+ * @deprecated As of release 3.2.0, replaced by {@link org.apache.tinkerpop.gremlin.process.computer.Computer}.
  */
 @Deprecated
 public interface TraversalEngine extends Serializable {


[02/27] tinkerpop git commit: Improve JavaScript Gremlin documentation

Posted by sp...@apache.org.
Improve JavaScript Gremlin documentation

Several fixes to the JavaScript GLV documentation:
- Use 'gremlin' package name
- Include information regarding Promises
- Fix method names


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

Branch: refs/heads/TINKERPOP-1595
Commit: e08651b946e936579db538f9114dd1c5c9079bcb
Parents: 2591302
Author: Jorge Bay Gondra <jo...@gmail.com>
Authored: Mon Apr 23 10:26:36 2018 +0200
Committer: Jorge Bay Gondra <jo...@gmail.com>
Committed: Mon Apr 23 10:26:36 2018 +0200

----------------------------------------------------------------------
 docs/src/reference/gremlin-variants.asciidoc | 47 +++++++++++++++++------
 1 file changed, 36 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e08651b9/docs/src/reference/gremlin-variants.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc
index d929b3c..7a85ab1 100644
--- a/docs/src/reference/gremlin-variants.asciidoc
+++ b/docs/src/reference/gremlin-variants.asciidoc
@@ -458,17 +458,24 @@ their Java counterparts which makes it possible to use lambdas with Gremlin.Net
 == Gremlin-JavaScript
 
 image:gremlin-js.png[width=130,float=right] Apache TinkerPop's Gremlin-JavaScript implements Gremlin within the
-JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 4 or
+JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 6 or
 above. Since the JavaScript naming conventions are very similar to that of Java, it should be very easy to switch
 between Gremlin-Java and Gremlin-JavaScript.
 
 [source,bash]
-npm install gremlin-javascript
+npm install gremlin
 
 The Gremlin-JavaScript provides `GraphTraversalSource`, `GraphTraversal`, and `__` which mirror the respective classes
 in Gremlin-Java. The `GraphTraversalSource` requires a RemoteConnection implementation in order to communicate with
 <<gremlin-server,GremlinServer>>.
 
+[source,javascript]
+----
+const gremlin = require('gremlin');
+const Graph = gremlin.structure.Graph;
+const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection;
+----
+
 A traversal source can be spawned with `RemoteStrategy` from an empty `Graph`.
 
 [source,javascript]
@@ -489,27 +496,45 @@ IMPORTANT: Gremlin-JavaScript’s `Traversal` base class supports the standard G
 
 === RemoteConnection Submission
 
-Very similar to Gremlin-Python and Gremlin-Java, there are various ways to submit a traversal to a
-`RemoteConnection` using terminal/action methods off of `Traversal`.
+In a similar way as in other GLVs, there are various ways to submit a traversal to a
+`RemoteConnection` using terminal/action methods off of `Traversal`. Given that I/O operations in Node.js are
+asynchronous by default, this terminal methods return a `Promise`.
 
-* `Traversal.next()`
-* `Traversal.toList()`
+* `Traversal.toList()`: Returns a `Promise` with an `Array` as result value.
+* `Traversal.next()`: Returns a `Promise` with a `{ value, done }` tuple as result value, according to the
+link:https://github.com/tc39/proposal-async-iteration[async iterator proposal].
+* `Traversal.iterate()`: Returns a `Promise` without a value.
+
+
+For example:
+
+[source,javascript]
+----
+g.V().hasLabel('person').values('name').toList()
+  .then(names => console.log(names));
+----
+
+You can `await` the promises if you are using `async` functions.
+
+[source,javascript]
+----
+const names = await g.V().hasLabel('person').values('name').toList();
+console.log(names);
+----
 
 === Static Enums and Methods
 
 Gremlin has various tokens (e.g. `t`, `P`, `order`, `direction`, etc.) that are represented in Gremlin-JavaScript as
 objects.
 
-These can be used analogously to how they are used in Gremlin-Java.
-
 [source,javascript]
-g.V().hasLabel("person").has("age",P.gt(30)).Order().By("age", order.decr).toList()
+g.V().hasLabel('person').has('age', P.gt(30)).order().by('age', order.decr).toList()
 
 These objects must be required manually from the `process` namespace:
 
 [source,javascript]
 ----
-const gremlin = require('gremlin-javascript');
+const gremlin = require('gremlin');
 const P = gremlin.process.P;
 ----
 
@@ -517,7 +542,7 @@ Finally, using static `__` anonymous traversals like `__.out()` can be expressed
 
 [source,javascript]
 ----
-const gremlin = require('gremlin-javascript');
+const gremlin = require('gremlin');
 const __ = gremlin.process.statics;
 
 g.V().repeat(__.out()).times(2).values("name").fold().toList();


[03/27] tinkerpop git commit: TINKERPOP-1953 Bump to Groovy 2.4.15

Posted by sp...@apache.org.
TINKERPOP-1953 Bump to Groovy 2.4.15

Fixes a bug in Lambda construction for remote traversals


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

Branch: refs/heads/TINKERPOP-1595
Commit: 40dad27880189ffb8c901a8d7bdcf3d505325693
Parents: 682f298
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 23 09:33:25 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 23 09:33:25 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../upgrade/release-3.2.x-incubating.asciidoc   | 24 ++++++++++++++++++++
 .../jsr223/GremlinGroovyScriptEngineTest.java   |  9 ++++++++
 pom.xml                                         |  2 +-
 4 files changed, 35 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/40dad278/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 51c9f68..797072d 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -24,6 +24,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 === TinkerPop 3.2.9 (Release Date: NOT OFFICIALLY RELEASED YET)
 
 * Bumped to httpclient 4.5.5.
+* Bumped to Groovy 2.4.15 - fixes bug with `Lambda` construction.
 * Improved performance of GraphSON deserialization of `Bytecode`.
 
 [[release-3-2-8]]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/40dad278/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index b57a657..51b85d3 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -21,6 +21,30 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 
 *Nine Inch Gremlins*
 
+== TinkerPop 3.2.9
+
+*Release Date: NOT OFFICIALLY RELEASED YET*
+
+Please see the link:https://github.com/apache/tinkerpop/blob/3.2.8/CHANGELOG.asciidoc#release-3-2-9[changelog] for a complete list of all the modifications that are part of this release.
+
+=== Upgrading for Users
+
+==== Lambda Construction
+
+It was realized quite shortly after release of 3.2.8 that there was a bug in construction of `Lambda` instances:
+
+[source,text]
+----
+gremlin> org.apache.tinkerpop.gremlin.util.function.Lambda.function("{ it.get() }")
+(class: org/apache/tinkerpop/gremlin/util/function/Lambda$function, method: callStatic signature: (Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object;) Illegal type in constant pool
+Type ':help' or ':h' for help.
+Display stack trace? [yN]n
+----
+
+The problem was related to a bug in Groovy 2.4.14 and was fixed in 2.4.15.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1953[TINKERPOP-1953]
+
 == TinkerPop 3.2.8
 
 *Release Date: April 2, 2018*

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/40dad278/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java
index 0606721..54e997f 100644
--- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java
+++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java
@@ -26,6 +26,7 @@ import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider;
 import org.apache.tinkerpop.gremlin.groovy.NoImportCustomizerProvider;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.InterpreterModeCustomizerProvider;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.util.function.Lambda;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.javatuples.Pair;
 import org.junit.Test;
@@ -603,4 +604,12 @@ public class GremlinGroovyScriptEngineTest {
         assertEquals(1, engine.getClassCacheLoadFailureCount());
         assertEquals(100, engine.getClassCacheLoadSuccessCount());
     }
+
+    @Test
+    public void shouldEvalForLambda() throws Exception {
+        // https://issues.apache.org/jira/browse/TINKERPOP-1953
+        final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine();
+        final Lambda l = (Lambda) engine.eval(" org.apache.tinkerpop.gremlin.util.function.Lambda.function(\"{ it.get() }\")");
+        assertEquals("{ it.get() }", l.getLambdaScript());
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/40dad278/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5ac2d88..4ec1ab4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -141,7 +141,7 @@ limitations under the License.
         <commons.configuration.version>1.10</commons.configuration.version>
         <commons.lang.version>2.6</commons.lang.version>
         <commons.lang3.version>3.3.1</commons.lang3.version>
-        <groovy.version>2.4.14</groovy.version>
+        <groovy.version>2.4.15</groovy.version>
         <hadoop.version>2.7.2</hadoop.version>
         <java.tuples.version>1.2</java.tuples.version>
         <javadoc-plugin.version>2.10.4</javadoc-plugin.version>


[11/27] tinkerpop git commit: Merge branch 'TINKERPOP-1950' into tp32

Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1950' into tp32


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

Branch: refs/heads/TINKERPOP-1595
Commit: 0d6f8fcb208f850155fddbc1f140c1890a6757d7
Parents: f4dbaff cd20298
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 25 08:21:46 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 25 08:21:46 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../process/traversal/TraversalStrategies.java  | 36 +++++++++++++++-----
 2 files changed, 29 insertions(+), 8 deletions(-)
----------------------------------------------------------------------



[24/27] tinkerpop git commit: TINKERPOP-1595 Removed usage of deprecated graph computer method

Posted by sp...@apache.org.
TINKERPOP-1595 Removed usage of deprecated graph computer method


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

Branch: refs/heads/TINKERPOP-1595
Commit: 172dfa5ea6e5dca52ee9e593da5eb054940c7fe7
Parents: 5fea198
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 24 07:59:58 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 27 10:32:44 2018 -0400

----------------------------------------------------------------------
 .../process/computer/traversal/step/map/VertexProgramStep.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/172dfa5e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/VertexProgramStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/VertexProgramStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/VertexProgramStep.java
index d005940..b32ef82 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/VertexProgramStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/VertexProgramStep.java
@@ -72,7 +72,7 @@ public abstract class VertexProgramStep extends AbstractStep<ComputerResult, Com
                 final Traverser.Admin<ComputerResult> traverser = this.starts.next();
                 final Graph graph = traverser.get().graph();
                 final Memory memory = traverser.get().memory();
-                future = this.generateComputer(graph).program(this.generateProgram(graph, memory)).submit();
+                future = this.getComputer().apply(graph).program(this.generateProgram(graph, memory)).submit();
                 final ComputerResult result = future.get();
                 this.processMemorySideEffects(result.memory());
                 return traverser.split(result, this);


[07/27] tinkerpop git commit: Merge branch 'TINKERPOP-1953' into tp32

Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1953' into tp32


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

Branch: refs/heads/TINKERPOP-1595
Commit: 42ce7a5e8491e247c617e3872963882357765a33
Parents: 8462f85 40dad27
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 25 06:52:52 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 25 06:52:52 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../upgrade/release-3.2.x-incubating.asciidoc   | 24 ++++++++++++++++++++
 .../jsr223/GremlinGroovyScriptEngineTest.java   |  9 ++++++++
 pom.xml                                         |  2 +-
 4 files changed, 35 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[08/27] tinkerpop git commit: Merge branch 'TINKERPOP-1947' into tp32

Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1947' into tp32


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

Branch: refs/heads/TINKERPOP-1595
Commit: 44c4073f2711cd56948ea9753f94e51897262031
Parents: 42ce7a5 8fbfab7
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 25 06:56:17 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 25 06:56:17 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../process/traversal/step/util/Parameters.java | 30 +++++++++++---------
 .../step/map/GroovyAddVertexTest.groovy         |  5 ++++
 gremlin-test/features/map/AddVertex.feature     | 27 ++++++++++++++++++
 .../traversal/step/map/AddVertexTest.java       | 20 +++++++++++--
 5 files changed, 68 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/44c4073f/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --cc CHANGELOG.asciidoc
index 797072d,6f7baa5..f71602a
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@@ -23,9 -23,8 +23,10 @@@ image::https://raw.githubusercontent.co
  [[release-3-2-9]]
  === TinkerPop 3.2.9 (Release Date: NOT OFFICIALLY RELEASED YET)
  
+ * Fixed bug where path history was not being preserved for keys in mutations.
  * Bumped to httpclient 4.5.5.
 +* Bumped to Groovy 2.4.15 - fixes bug with `Lambda` construction.
 +* Improved performance of GraphSON deserialization of `Bytecode`.
  
  [[release-3-2-8]]
  === TinkerPop 3.2.8 (Release Date: April 2, 2018)


[16/27] tinkerpop git commit: Improved javadoc on Gremlin enums CTR

Posted by sp...@apache.org.
Improved javadoc on Gremlin enums CTR


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

Branch: refs/heads/TINKERPOP-1595
Commit: a4c5a2132f8f0c7824ceddc8adefe06274767071
Parents: 5954525
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Apr 26 09:39:52 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Apr 26 09:39:52 2018 -0400

----------------------------------------------------------------------
 .../gremlin/process/traversal/Compare.java      | 12 ++++
 .../gremlin/process/traversal/Contains.java     |  4 ++
 .../gremlin/process/traversal/Operator.java     | 73 ++++++++++++++++++-
 .../tinkerpop/gremlin/process/traversal/P.java  | 76 ++++++++++++++++++++
 .../gremlin/process/traversal/Pop.java          | 14 +++-
 .../gremlin/process/traversal/Scope.java        | 19 +++--
 6 files changed, 188 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a4c5a213/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java
index 97b52b8..7d0d071 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java
@@ -36,6 +36,8 @@ public enum Compare implements BiPredicate<Object, Object> {
      * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}.  Otherwise they are evaluated
      * via {@link Object#equals(Object)}.  Testing against {@link Number#doubleValue()} enables the compare
      * operations to be a bit more forgiving with respect to comparing different number types.
+     *
+     * @since 3.0.0-incubating
      */
     eq {
         @Override
@@ -61,6 +63,8 @@ public enum Compare implements BiPredicate<Object, Object> {
      * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#equals}.  Otherwise they are evaluated
      * via {@link Object#equals(Object)}.  Testing against {@link Number#doubleValue()} enables the compare
      * operations to be a bit more forgiving with respect to comparing different number types.
+     *
+     * @since 3.0.0-incubating
      */
     neq {
         @Override
@@ -83,6 +87,8 @@ public enum Compare implements BiPredicate<Object, Object> {
      * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}.  Otherwise they are evaluated
      * via {@link Comparable#compareTo(Object)}.  Testing against {@link BigDecimal#compareTo} enables the compare
      * operations to be a bit more forgiving with respect to comparing different number types.
+     *
+     * @since 3.0.0-incubating
      */
     gt {
         @Override
@@ -108,6 +114,8 @@ public enum Compare implements BiPredicate<Object, Object> {
      * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}.  Otherwise they are evaluated
      * via {@link Comparable#compareTo(Object)}.  Testing against {@link BigDecimal#compareTo} enables the compare
      * operations to be a bit more forgiving with respect to comparing different number types.
+     *
+     * @since 3.0.0-incubating
      */
     gte {
         @Override
@@ -130,6 +138,8 @@ public enum Compare implements BiPredicate<Object, Object> {
      * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}.  Otherwise they are evaluated
      * via {@link Comparable#compareTo(Object)}.  Testing against {@link BigDecimal#compareTo} enables the compare
      * operations to be a bit more forgiving with respect to comparing different number types.
+     *
+     * @since 3.0.0-incubating
      */
     lt {
         @Override
@@ -155,6 +165,8 @@ public enum Compare implements BiPredicate<Object, Object> {
      * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}.  Otherwise they are evaluated
      * via {@link Comparable#compareTo(Object)}.  Testing against {@link BigDecimal#compareTo} enables the compare
      * operations to be a bit more forgiving with respect to comparing different number types.
+     *
+     * @since 3.0.0-incubating
      */
     lte {
         @Override

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a4c5a213/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java
index 2da0436..da46d0b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java
@@ -38,6 +38,8 @@ public enum Contains implements BiPredicate<Object, Collection> {
 
     /**
      * The first object is within the {@link Collection} provided in the second object.
+     *
+     * @since 3.0.0-incubating
      */
     within {
         @Override
@@ -48,6 +50,8 @@ public enum Contains implements BiPredicate<Object, Collection> {
 
     /**
      * The first object is not within the {@link Collection} provided in the second object.
+     *
+     * @since 3.0.0-incubating
      */
     without {
         @Override

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a4c5a213/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Operator.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Operator.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Operator.java
index a52f34b..f9e0b5c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Operator.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Operator.java
@@ -23,65 +23,132 @@ import java.util.Map;
 import java.util.function.BinaryOperator;
 
 /**
+ * A set of {@link BinaryOperator} instances that handle common operations for traversal steps.
+ *
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
 public enum Operator implements BinaryOperator<Object> {
 
+    /**
+     * An addition function.
+     *
+     * @since 3.0.0-incubating
+     */
     sum {
         public Object apply(final Object a, Object b) {
             return NumberHelper.add((Number) a, (Number) b);
         }
     },
+
+    /**
+     * A subtraction function.
+     *
+     * @since 3.0.0-incubating
+     */
     minus {
         public Object apply(final Object a, final Object b) {
             return NumberHelper.sub((Number) a, (Number) b);
         }
     },
+
+    /**
+     * A multiplication function.
+     *
+     * @since 3.0.0-incubating
+     */
     mult {
         public Object apply(final Object a, final Object b) {
             return NumberHelper.mul((Number) a, (Number) b);
         }
     },
+
+    /**
+     * A division function.
+     *
+     * @since 3.0.0-incubating
+     */
     div {
         public Object apply(final Object a, final Object b) {
             return NumberHelper.div((Number) a, (Number) b);
         }
     },
+
+    /**
+     * Selects the smaller of the values.
+     *
+     * @since 3.0.0-incubating
+     */
     min {
         public Object apply(final Object a, final Object b) {
             return NumberHelper.min((Number) a, (Number) b);
         }
     },
+
+    /**
+     * Selects the larger of the values.
+     *
+     * @since 3.0.0-incubating
+     */
     max {
         public Object apply(final Object a, final Object b) {
             return NumberHelper.max((Number) a, (Number) b);
         }
     },
+
+    /**
+     * The new incoming value (i.e. the second value to the function) is returned unchanged result in the assignment
+     * of that value to the object of the {@code Operator}.
+     *
+     * @since 3.1.0-incubating
+     */
     assign {
         public Object apply(final Object a, final Object b) {
             return b;
         }
     },
+
+    /**
+     * Applies "and" to boolean values.
+     *
+     * @since 3.2.0-incubating
+     */
     and {
         public Object apply(final Object a, final Object b) {
             return ((boolean) a) && ((boolean) b);
         }
     },
+
+    /**
+     * Applies "or" to boolean values.
+     *
+     * @since 3.2.0-incubating
+     */
     or {
         public Object apply(final Object a, final Object b) {
             return ((boolean) a) || ((boolean) b);
         }
     },
+
+    /**
+     * Takes all objects in the second {@code Collection} and adds them to the first.
+     *
+     * @since 3.2.0-incubating
+     */
     addAll {
         public Object apply(final Object a, final Object b) {
             if (a instanceof Map)
-                ((Map) a).putAll((Map) b);
+                ((Map<?,?>) a).putAll((Map) b);
             else
-                ((Collection) a).addAll((Collection) b);
+                ((Collection<?>) a).addAll((Collection) b);
             return a;
         }
     },
-    //////
+
+    /**
+     * Sums and adds long values.
+     *
+     * @since 3.2.0-incubating
+     */
     sumLong {
         public Object apply(final Object a, final Object b) {
             return (long) a + (long) b;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a4c5a213/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/P.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/P.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/P.java
index 3b2d0c2..8454f33 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/P.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/P.java
@@ -28,6 +28,7 @@ import java.util.function.BiPredicate;
 import java.util.function.Predicate;
 
 /**
+ * Predefined {@code Predicate} values that can be used with
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
@@ -121,62 +122,137 @@ public class P<V> implements Predicate<V>, Serializable, Cloneable {
 
     //////////////// statics
 
+    /**
+     * Determines if values are equal.
+     *
+     * @since 3.0.0-incubating
+     */
     public static <V> P<V> eq(final V value) {
         return new P(Compare.eq, value);
     }
 
+    /**
+     * Determines if values are not equal.
+     *
+     * @since 3.0.0-incubating
+     */
     public static <V> P<V> neq(final V value) {
         return new P(Compare.neq, value);
     }
 
+    /**
+     * Determines if a value is less than another.
+     *
+     * @since 3.0.0-incubating
+     */
     public static <V> P<V> lt(final V value) {
         return new P(Compare.lt, value);
     }
 
+    /**
+     * Determines if a value is less than or equal to another.
+     *
+     * @since 3.0.0-incubating
+     */
     public static <V> P<V> lte(final V value) {
         return new P(Compare.lte, value);
     }
 
+    /**
+     * Determines if a value is greater than another.
+     *
+     * @since 3.0.0-incubating
+     */
     public static <V> P<V> gt(final V value) {
         return new P(Compare.gt, value);
     }
 
+    /**
+     * Determines if a value is greater than or equal to another.
+     *
+     * @since 3.0.0-incubating
+     */
     public static <V> P<V> gte(final V value) {
         return new P(Compare.gte, value);
     }
 
+    /**
+     * Determines if a value is within (exclusive) the range of the two specified values.
+     *
+     * @since 3.0.0-incubating
+     */
     public static <V> P<V> inside(final V first, final V second) {
         return new AndP<V>(Arrays.asList(new P(Compare.gt, first), new P(Compare.lt, second)));
     }
 
+    /**
+     * Determines if a value is not within (exclusive) of the range of the two specified values.
+     *
+     * @since 3.0.0-incubating
+     */
     public static <V> P<V> outside(final V first, final V second) {
         return new OrP<V>(Arrays.asList(new P(Compare.lt, first), new P(Compare.gt, second)));
     }
 
+    /**
+     * Determines if a value is within (inclusive) of the range of the two specified values.
+     *
+     * @since 3.0.0-incubating
+     */
     public static <V> P<V> between(final V first, final V second) {
         return new AndP<V>(Arrays.asList(new P(Compare.gte, first), new P(Compare.lt, second)));
     }
 
+    /**
+     * Determines if a value is within the specified list of values.
+     *
+     * @since 3.0.0-incubating
+     */
     public static <V> P<V> within(final V... values) {
         return P.within(Arrays.asList(values));
     }
 
+    /**
+     * Determines if a value is within the specified list of values.
+     *
+     * @since 3.0.0-incubating
+     */
     public static <V> P<V> within(final Collection<V> value) {
         return new P(Contains.within, value);
     }
 
+    /**
+     * Determines if a value is not within the specified list of values.
+     *
+     * @since 3.0.0-incubating
+     */
     public static <V> P<V> without(final V... values) {
         return P.without(Arrays.asList(values));
     }
 
+    /**
+     * Deermines if a value is not within the specified list of values.
+     *
+     * @since 3.0.0-incubating
+     */
     public static <V> P<V> without(final Collection<V> value) {
         return new P(Contains.without, value);
     }
 
+    /**
+     * Construct an instance of {@code P} from a {@code BiPredicate}.
+     *
+     * @since 3.0.0-incubating
+     */
     public static P test(final BiPredicate biPredicate, final Object value) {
         return new P(biPredicate, value);
     }
 
+    /**
+     * The opposite of the specified {@code P}.
+     *
+     * @since 3.0.0-incubating
+     */
     public static <V> P<V> not(final P<V> predicate) {
         return predicate.negate();
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a4c5a213/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Pop.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Pop.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Pop.java
index c9eab94..b2fe2b9 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Pop.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Pop.java
@@ -19,20 +19,28 @@
 package org.apache.tinkerpop.gremlin.process.traversal;
 
 /**
+ * Methods for extracting an item from a collection.
+ *
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
 public enum Pop {
 
     /**
-     * The first item in an ordered collection (i.e. <code>collection[0]</code>)
+     * The first item in an ordered collection (i.e. {@code collection[0]}).
+     *
+     * @since 3.0.0-incubating
      */
     first,
     /**
-     * The last item in an ordered collection (i.e. <code>collection[collection.size()-1]</code>)
+     * The last item in an ordered collection (i.e. {@code collection[collection.size()-1]}).
+     *
+     * @since 3.0.0-incubating
      */
     last,
     /**
-     * Get all the items and return them as a list
+     * Get all the items and return them as a list.
+     *
+     * @since 3.0.0-incubating
      */
     all
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a4c5a213/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Scope.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Scope.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Scope.java
index 11979de..c454922 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Scope.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Scope.java
@@ -19,15 +19,26 @@
 package org.apache.tinkerpop.gremlin.process.traversal;
 
 /**
- * Many {@link Step} instance can have a variable scope.
- * {@link Scope#global}: the step operates on the entire traversal.
- * {@link Scope#local}: the step operates on the current object in the step.
+ * Many {@link Step} instance can have a variable scope which alter the manner in which the step will behave in
+ * relation to how the traversers are processed.
  *
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
 public enum Scope {
 
-    global, local;
+    /**
+     * Informs the step to operate on the entire traversal.
+     *
+     * @since 3.0.0-incubating
+     */
+    global,
+
+    /**
+     * Informs the step to operate on the current object in the step.
+     *
+     * @since 3.0.0-incubating
+     */
+    local;
 
     public Scope opposite() {
         return global.equals(this) ? local : global;


[10/27] tinkerpop git commit: Merge branch 'pr-856' into tp32

Posted by sp...@apache.org.
Merge branch 'pr-856' into tp32


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

Branch: refs/heads/TINKERPOP-1595
Commit: f4dbaff1c69242dfb8c69da17a9f35d52128c38e
Parents: 44c4073 3792422
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 25 07:44:47 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 25 07:44:47 2018 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/process/traversal/TraversalEngine.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[20/27] tinkerpop git commit: TINKERPOP-1595 Removed stream() usage

Posted by sp...@apache.org.
TINKERPOP-1595 Removed stream() usage


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

Branch: refs/heads/TINKERPOP-1595
Commit: 344d1b24445fb332b88ecce9af8020f91046c3e0
Parents: 172dfa5
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 24 08:00:48 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 27 10:32:44 2018 -0400

----------------------------------------------------------------------
 .../process/computer/traversal/TraversalVertexProgram.java  | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/344d1b24/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
index 3cb4d00..40417cc 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
@@ -175,12 +175,11 @@ public final class TraversalVertexProgram implements VertexProgram<TraverserSet<
                         this.traversal.get().getParent().asStep().getNextStep() instanceof EmptyStep ||  // same as above, but if using TraversalVertexProgramStep directly
                         (this.traversal.get().getParent().asStep().getNextStep() instanceof ProfileStep && // same as above, but needed for profiling
                                 this.traversal.get().getParent().asStep().getNextStep().getNextStep() instanceof ComputerResultStep));
+
         // determine how to store halted traversers
-        this.haltedTraverserStrategy = ((HaltedTraverserStrategy) this.traversal.get().getStrategies().toList()
-                .stream()
-                .filter(strategy -> strategy instanceof HaltedTraverserStrategy)
-                .findAny()
-                .orElse(HaltedTraverserStrategy.reference()));
+        final Iterator<?> itty = IteratorUtils.filter(this.traversal.get().getStrategies().toList(), strategy -> strategy instanceof HaltedTraverserStrategy).iterator();
+        this.haltedTraverserStrategy = itty.hasNext() ? (HaltedTraverserStrategy) itty.next() : HaltedTraverserStrategy.reference();
+
         // register traversal side-effects in memory
         this.memoryComputeKeys.addAll(MemoryTraversalSideEffects.getMemoryComputeKeys(this.traversal.get()));
         // register MapReducer memory compute keys


[09/27] tinkerpop git commit: TINKERPOP-1950 Cached global strategy lookups during traversal construction

Posted by sp...@apache.org.
TINKERPOP-1950 Cached global strategy lookups during traversal construction

This change leads to a 1.5x to 2x speed improvement in traversal construction. It is especially effective when processing traversals that have many child traversals within them as this method is called for not only the parent traversal but all the children as well.


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

Branch: refs/heads/TINKERPOP-1595
Commit: cd20298d3f4ee5f66fe4f037e8aa64daf32254b4
Parents: 44c4073
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 20 16:18:13 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 25 07:41:38 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../process/traversal/TraversalStrategies.java  | 36 +++++++++++++++-----
 2 files changed, 29 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cd20298d/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index f71602a..f6ca111 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -27,6 +27,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 * Bumped to httpclient 4.5.5.
 * Bumped to Groovy 2.4.15 - fixes bug with `Lambda` construction.
 * Improved performance of GraphSON deserialization of `Bytecode`.
+* Improved performance of traversal construction.
 
 [[release-3-2-8]]
 === TinkerPop 3.2.8 (Release Date: April 2, 2018)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cd20298d/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
index c7ee5bf..e84737c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
@@ -52,6 +52,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.stream.Collectors;
 
 /**
@@ -198,6 +199,12 @@ public interface TraversalStrategies extends Serializable, Cloneable {
 
     public static final class GlobalCache {
 
+        /**
+         * Keeps track of {@link GraphComputer} and/or {@link Graph} classes that have been initialized to the
+         * classloader so that they do not have to be reflected again.
+         */
+        private static Set<Class> LOADED = ConcurrentHashMap.newKeySet();
+
         private static final Map<Class<? extends Graph>, TraversalStrategies> GRAPH_CACHE = new HashMap<>();
         private static final Map<Class<? extends GraphComputer>, TraversalStrategies> GRAPH_COMPUTER_CACHE = new HashMap<>();
 
@@ -244,20 +251,33 @@ public interface TraversalStrategies extends Serializable, Cloneable {
         public static TraversalStrategies getStrategies(final Class graphOrGraphComputerClass) {
             try {
                 // be sure to load the class so that its static{} traversal strategy registration component is loaded.
-                // this is more important for GraphComputer classes as they are typically not instantiated prior to strategy usage like Graph classes.
-                final String graphComputerClassName = null != graphOrGraphComputerClass.getDeclaringClass() ?
+                // this is more important for GraphComputer classes as they are typically not instantiated prior to
+                // strategy usage like Graph classes.
+                if (!LOADED.contains(graphOrGraphComputerClass)) {
+                    final String graphComputerClassName = null != graphOrGraphComputerClass.getDeclaringClass() ?
                         graphOrGraphComputerClass.getCanonicalName().replace("." + graphOrGraphComputerClass.getSimpleName(), "$" + graphOrGraphComputerClass.getSimpleName()) :
                         graphOrGraphComputerClass.getCanonicalName();
-                Class.forName(graphComputerClassName);
+                    Class.forName(graphComputerClassName);
+
+                    // keep track of stuff we already loaded once - stuff in this if/statement isn't cheap and this
+                    // method gets called a lot, basically every time a new traversal gets spun up (that includes
+                    // child traversals. perhaps it is possible to just check the cache keys for this information, but
+                    // it's not clear if this method will be called with something not in the cache and if it is and
+                    // it results in error, then we'd probably not want to deal with this block again anyway
+                    LOADED.add(graphOrGraphComputerClass);
+                }
             } catch (final ClassNotFoundException e) {
                 throw new IllegalStateException(e.getMessage(), e);
             }
-            if (Graph.class.isAssignableFrom(graphOrGraphComputerClass)) {
-                final TraversalStrategies traversalStrategies = GRAPH_CACHE.get(graphOrGraphComputerClass);
-                return null == traversalStrategies ? GRAPH_CACHE.get(Graph.class) : traversalStrategies;
+            
+            if (GRAPH_CACHE.containsKey(graphOrGraphComputerClass)) {
+                return GRAPH_CACHE.get(graphOrGraphComputerClass);
+            } else if (Graph.class.isAssignableFrom(graphOrGraphComputerClass)) {
+                return GRAPH_CACHE.get(Graph.class);
+            } else if (GRAPH_COMPUTER_CACHE.containsKey(graphOrGraphComputerClass)) {
+                return GRAPH_COMPUTER_CACHE.get(graphOrGraphComputerClass);
             } else if (GraphComputer.class.isAssignableFrom(graphOrGraphComputerClass)) {
-                final TraversalStrategies traversalStrategies = GRAPH_COMPUTER_CACHE.get(graphOrGraphComputerClass);
-                return null == traversalStrategies ? GRAPH_COMPUTER_CACHE.get(GraphComputer.class) : traversalStrategies;
+                return GRAPH_COMPUTER_CACHE.get(GraphComputer.class);
             } else {
                 throw new IllegalArgumentException("The TraversalStrategies.GlobalCache only supports Graph and GraphComputer strategy caching: " + graphOrGraphComputerClass.getCanonicalName());
             }


[27/27] tinkerpop git commit: TINKERPOP-1595 Fixed up changelog as this moved to 3.2.10

Posted by sp...@apache.org.
TINKERPOP-1595 Fixed up changelog as this moved to 3.2.10


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

Branch: refs/heads/TINKERPOP-1595
Commit: 074ab1e5dca147acb6e05c4c1b4fff9f7e69d8b8
Parents: aef6896
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 27 10:33:58 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 27 10:33:58 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/074ab1e5/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index b7eabbe..4675cf2 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -20,13 +20,17 @@ limitations under the License.
 
 image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/images/nine-inch-gremlins.png[width=185]
 
+[[release-3-2-10]]
+=== TinkerPop 3.2.10 (Release Date: NOT OFFICIALLY RELEASED YET)
+
+* Improved performance of `TraversalVertexProgram` and related infrastructure.
+
 [[release-3-2-9]]
 === TinkerPop 3.2.9 (Release Date: NOT OFFICIALLY RELEASED YET)
 
 * Fixed bug where path history was not being preserved for keys in mutations.
 * Bumped to httpclient 4.5.5.
 * Bumped to Groovy 2.4.15 - fixes bug with `Lambda` construction.
-* Improved performance of `TraversalVertexProgram` and related infrastructure.
 * Improved performance of GraphSON deserialization of `Bytecode`.
 * Improved performance of traversal construction.
 


[14/27] tinkerpop git commit: Reverted change from 1d9e6dc6d30c5c7d56e4007527365793eb1f223e

Posted by sp...@apache.org.
Reverted change from 1d9e6dc6d30c5c7d56e4007527365793eb1f223e

Not sure why, but the above referenced change seemed to hang various integration tests. CTR


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

Branch: refs/heads/TINKERPOP-1595
Commit: 789e5752d8f6f781272a7c56f0d2b491849d4ca9
Parents: 6096a4c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 25 18:38:53 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 25 18:38:53 2018 -0400

----------------------------------------------------------------------
 .../process/traversal/TraversalStrategies.java  | 43 +++++++++-----------
 1 file changed, 20 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/789e5752/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
index 37cd1a6..091687a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
@@ -203,7 +203,7 @@ public interface TraversalStrategies extends Serializable, Cloneable {
          * Keeps track of {@link GraphComputer} and/or {@link Graph} classes that have been initialized to the
          * classloader so that they do not have to be reflected again.
          */
-        private static Map<Class, Boolean> LOADED = new ConcurrentHashMap<>();
+        private static Set<Class> LOADED = ConcurrentHashMap.newKeySet();
 
         private static final Map<Class<? extends Graph>, TraversalStrategies> GRAPH_CACHE = new HashMap<>();
         private static final Map<Class<? extends GraphComputer>, TraversalStrategies> GRAPH_COMPUTER_CACHE = new HashMap<>();
@@ -249,28 +249,27 @@ public interface TraversalStrategies extends Serializable, Cloneable {
         }
 
         public static TraversalStrategies getStrategies(final Class graphOrGraphComputerClass) {
-            // be sure to load the class so that its static{} traversal strategy registration component is loaded.
-            // this is more important for GraphComputer classes as they are typically not instantiated prior to
-            // strategy usage like Graph classes.
-            LOADED.computeIfAbsent(graphOrGraphComputerClass, unused ->  {
-                final String graphComputerClassName = null != graphOrGraphComputerClass.getDeclaringClass() ?
-                    graphOrGraphComputerClass.getCanonicalName().replace("." + graphOrGraphComputerClass.getSimpleName(), "$" + graphOrGraphComputerClass.getSimpleName()) :
-                    graphOrGraphComputerClass.getCanonicalName();
-
-                try {
+            try {
+                // be sure to load the class so that its static{} traversal strategy registration component is loaded.
+                // this is more important for GraphComputer classes as they are typically not instantiated prior to
+                // strategy usage like Graph classes.
+                if (!LOADED.contains(graphOrGraphComputerClass)) {
+                    final String graphComputerClassName = null != graphOrGraphComputerClass.getDeclaringClass() ?
+                            graphOrGraphComputerClass.getCanonicalName().replace("." + graphOrGraphComputerClass.getSimpleName(), "$" + graphOrGraphComputerClass.getSimpleName()) :
+                            graphOrGraphComputerClass.getCanonicalName();
                     Class.forName(graphComputerClassName);
-                } catch (ClassNotFoundException e) {
-                    throw new IllegalStateException(e.getMessage(), e);
+
+                    // keep track of stuff we already loaded once - stuff in this if/statement isn't cheap and this
+                    // method gets called a lot, basically every time a new traversal gets spun up (that includes
+                    // child traversals. perhaps it is possible to just check the cache keys for this information, but
+                    // it's not clear if this method will be called with something not in the cache and if it is and
+                    // it results in error, then we'd probably not want to deal with this block again anyway
+                    LOADED.add(graphOrGraphComputerClass);
                 }
+            } catch (final ClassNotFoundException e) {
+                throw new IllegalStateException(e.getMessage(), e);
+            }
 
-                // keep track of stuff we already loaded once - stuff in this if/statement isn't cheap and this
-                // method gets called a lot, basically every time a new traversal gets spun up (that includes
-                // child traversals. perhaps it is possible to just check the cache keys for this information, but
-                // it's not clear if this method will be called with something not in the cache and if it is and
-                // it results in error, then we'd probably not want to deal with this block again anyway
-                return true;
-            });
-            
             if (GRAPH_CACHE.containsKey(graphOrGraphComputerClass)) {
                 return GRAPH_CACHE.get(graphOrGraphComputerClass);
             } else if (Graph.class.isAssignableFrom(graphOrGraphComputerClass)) {
@@ -284,6 +283,4 @@ public interface TraversalStrategies extends Serializable, Cloneable {
             }
         }
     }
-
-
-}
+}
\ No newline at end of file


[13/27] tinkerpop git commit: TINKERPOP-1755 Added some docs about detachment CTR

Posted by sp...@apache.org.
TINKERPOP-1755 Added some docs about detachment CTR


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

Branch: refs/heads/TINKERPOP-1595
Commit: 6096a4c7db50d733254760243a28902db7a81704
Parents: 1d9e6dc
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 25 15:20:00 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 25 15:20:00 2018 -0400

----------------------------------------------------------------------
 .../src/reference/gremlin-applications.asciidoc | 70 ++++++++++++++++++++
 1 file changed, 70 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6096a4c7/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 380ff4e..1a68ad8 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -1646,6 +1646,76 @@ section. It controls the maximum number of parameters that can be passed to the
 Use of this setting can prevent accidental long run compilations, which individually are not terribly oppressive to
 the server, but taken as a group under high concurrency would be considered detrimental.
 
+==== Properties of Elements
+
+It was mentioned above at the start of this "Best Practices" section that serialization of graph elements (i.e.
+`Vertex`, `Edge`, and `VertexProperty`) can be expensive and that it is best to only return the data that is required
+by the requesting system. This point begs for further clarification as there are a number of ways to use and configure
+Gremlin Server which might influence its interpretation.
+
+To begin to discuss these nuances, first consider the method of making requests to Gremlin Server: script or bytecode.
+For scripts, that will mean that users are sending string representation of Gremlin to the server directly through a
+driver over websockets or through the HTTP. For bytecode, users will be utilize a <<gremlin-variants, Gremlin GLV>>
+which will construct bytecode for them and submit the request to the server upon iteration of their traversal.
+
+In either case, it is important to also consider the method of "detachment". Detachment refers to the manner in which
+a graph element is disconnected from the graph for purpose of serialization. Depending on the case and configuration,
+graph elements may be detached with or without properties. Cases where they include properties is generally referred
+to as "detached elements" and cases where properties are not included are "reference elements".
+
+With the type of request and detachment model in mind, it is now possible to discuss how best to consider element
+properties in relation to them all in concert.
+
+For script-based requests, users should take care when returning graph elements. By default, elements will be returned
+as detached elements and will thus serialize with all properties that are bound to them. As such, Gryo and GraphSON
+serializers will write all properties in the return payload. Script-based requests should definitely follow the best
+practice of only returning the data required by the application.
+
+NOTE: Gryo does have the exception for the `GryoMessageSerializerGremlinV1d0` with the `serializeResultToString`
+option enabled, which will simply convert all results using the Java `toString()` method prior to serialization and
+is typically only use by the Gremlin Console for remote sessions where the actual object from the server is not of use.
+
+For bytecode-based requests, graph elements have reference detachment and thus only return the `id` and `label` of
+the elements. While this approach alleviates a potential performance problem that the script approach exposes, it is
+still important to follow the practice of being specific about the data that is required by the requesting application
+as it won't arrive on the client side without that declaration.
+
+Ultimately, the detachment model should have little impact to Gremlin usage if the best practice of specifying only
+the data required by the application is adhered to. In other words, while there may be a difference in the contents
+of return values for these traversals:
+
+[source,java]
+----
+// properties returned from g.V().hasLabel('person') because this is using the
+// Script API with full detachment
+Cluster cluster = Cluster.open();
+Client client = cluster.connect();
+ResultSet results = client.submit("g.V().hasLabel('person')");
+
+// no properties returned from g.V().hasLabel("person") because this is using
+// Bytecode API with reference detachment
+Graph graph = EmptyGraph.instance();
+GraphTraversalSource g = graph.traversal().
+                               withRemote('conf/remote-graph.properties');
+List<Vertex> results = g.V().hasLabel("person").toList();
+----
+
+There is no difference if re-written using the best practice of requesting only the data the application needs:
+
+[source,java]
+----
+Cluster cluster = Cluster.open();
+Client client = cluster.connect();
+ResultSet results = client.submit("g.V().hasLabel('person').valueMap(true,'name')");
+
+Graph graph = EmptyGraph.instance();
+GraphTraversalSource g = graph.traversal().
+                               withRemote('conf/remote-graph.properties');
+List<Vertex> results = g.V().hasLabel("person").valueMap(true,'name').toList();
+----
+
+Both of the above requests return a list of `Map` instances that contain the `id`, `label` and the "name" property.
+
 ==== Cache Management
 
 If Gremlin Server processes a large number of unique scripts, the global function cache will grow beyond the memory


[23/27] tinkerpop git commit: TINKERPOP-1595 Changed vertex program serialization to base64 encoded

Posted by sp...@apache.org.
TINKERPOP-1595 Changed vertex program serialization to base64 encoded

This approach shows to be faster than writing the bytes as an array of string values and deserializing with regex based parsing.


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

Branch: refs/heads/TINKERPOP-1595
Commit: e2eebf4c5590fd20c8184bd0162c717614575034
Parents: 1d149c6
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 24 08:06:56 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 27 10:32:44 2018 -0400

----------------------------------------------------------------------
 .../process/computer/util/VertexProgramHelper.java     | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2eebf4c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java
index bc67866..a1c299d 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java
@@ -28,7 +28,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep;
 import org.apache.tinkerpop.gremlin.util.Serializer;
 
 import java.io.IOException;
-import java.util.Arrays;
+import java.util.Base64;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -64,8 +64,7 @@ public final class VertexProgramHelper {
         if (configuration instanceof AbstractConfiguration)
             ((AbstractConfiguration) configuration).setDelimiterParsingDisabled(true);
         try {
-            final String byteString = Arrays.toString(Serializer.serializeObject(object));
-            configuration.setProperty(key, byteString.substring(1, byteString.length() - 1));
+            configuration.setProperty(key, Base64.getEncoder().encodeToString(Serializer.serializeObject(object)));
         } catch (final IOException e) {
             throw new IllegalArgumentException(e.getMessage(), e);
         }
@@ -73,12 +72,8 @@ public final class VertexProgramHelper {
 
     public static <T> T deserialize(final Configuration configuration, final String key) {
         try {
-            final String[] stringBytes = configuration.getString(key).split(",");
-            byte[] bytes = new byte[stringBytes.length];
-            for (int i = 0; i < stringBytes.length; i++) {
-                bytes[i] = Byte.valueOf(stringBytes[i].trim());
-            }
-            return (T) Serializer.deserializeObject(bytes);
+
+            return (T) Serializer.deserializeObject(Base64.getDecoder().decode(configuration.getString(key).getBytes()));
         } catch (final IOException | ClassNotFoundException e) {
             throw new IllegalArgumentException(e.getMessage(), e);
         }


[04/27] tinkerpop git commit: Merge branch 'js-doc-example' into tp32

Posted by sp...@apache.org.
Merge branch 'js-doc-example' into tp32


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

Branch: refs/heads/TINKERPOP-1595
Commit: c155818793c38a144edfa5bc803284ff82c2e8ca
Parents: 268423d e08651b
Author: Jorge Bay Gondra <jo...@gmail.com>
Authored: Tue Apr 24 10:39:17 2018 +0200
Committer: Jorge Bay Gondra <jo...@gmail.com>
Committed: Tue Apr 24 10:39:17 2018 +0200

----------------------------------------------------------------------
 docs/src/reference/gremlin-variants.asciidoc | 47 +++++++++++++++++------
 1 file changed, 36 insertions(+), 11 deletions(-)
----------------------------------------------------------------------



[26/27] tinkerpop git commit: TINKERPOP-1595 Cleaned up exception handling for giraph

Posted by sp...@apache.org.
TINKERPOP-1595 Cleaned up exception handling for giraph

Some really specific exception handling of deserialization errors in Giraph were causing tests to hang. Corrected those problems and commented heavily.


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

Branch: refs/heads/TINKERPOP-1595
Commit: aef6896bda2fea7708dc16951bb8652a1b488e93
Parents: f2119bc
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 27 10:31:15 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 27 10:33:17 2018 -0400

----------------------------------------------------------------------
 .../giraph/process/computer/GiraphGraphComputer.java |  9 ++++++++-
 .../process/computer/util/VertexProgramHelper.java   | 15 +++++++++++++--
 2 files changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aef6896b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphGraphComputer.java
----------------------------------------------------------------------
diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphGraphComputer.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphGraphComputer.java
index b06b40a..6cd85de 100644
--- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphGraphComputer.java
+++ b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/process/computer/GiraphGraphComputer.java
@@ -22,6 +22,7 @@ import org.apache.commons.configuration.BaseConfiguration;
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.FileConfiguration;
 import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.giraph.conf.GiraphConfiguration;
 import org.apache.giraph.conf.GiraphConstants;
 import org.apache.giraph.job.GiraphJob;
@@ -166,7 +167,13 @@ public final class GiraphGraphComputer extends AbstractHadoopGraphComputer imple
                 try {
                     VertexProgram.createVertexProgram(this.hadoopGraph, ConfUtil.makeApacheConfiguration(this.giraphConfiguration));
                 } catch (final IllegalStateException e) {
-                    if (e.getCause() instanceof NumberFormatException)
+                    // NumberFormatException is likely no longer a possibility here after 3.2.9 as the internal
+                    // serialization format for traversals changed from a delimited list of bytes as a string to a
+                    // base64 encoded string. under the base64 model we shouldn't see NumberFormatException anymore
+                    // but i left it here for now, just in case there's something i'm not seeing. see
+                    // VertexProgramHelper.deserialize() for more information related to this handling
+                    final Throwable root = ExceptionUtils.getRootCause(e);
+                    if (root instanceof NumberFormatException || root instanceof IOException || root instanceof ClassNotFoundException)
                         throw new NotSerializableException("The provided traversal is not serializable and thus, can not be distributed across the cluster");
                 }
                 // remove historic combiners in configuration propagation (this occurs when job chaining)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aef6896b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java
index a1c299d..2297c90 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java
@@ -72,8 +72,19 @@ public final class VertexProgramHelper {
 
     public static <T> T deserialize(final Configuration configuration, final String key) {
         try {
-
-            return (T) Serializer.deserializeObject(Base64.getDecoder().decode(configuration.getString(key).getBytes()));
+            // a bit of a weird double try-catch here. Base64 can throw an IllegalArgumentException if given some
+            // bad data to deserialize. that needs to be caught and then re-cast as a IOException so that downstream
+            // systems can better catch and react to the error. giraph is the big hassle here it seems - see
+            // GiraphGraphComputer.run() for more related notes on this specifically where
+            // VertexProgram.createVertexProgram() is called as it has special handling for errors related to
+            // deserialization. if not handled properly, giraph will hang in tests. i don't want to over-tweak this
+            // code too much for two reasons (1) dont want to alter method signatures too much or mess with existing
+            // logic within 3.2.x (2) giraph is dead in 3.4.x so no point to trying to make this a ton more elegant.
+            try {
+                return (T) Serializer.deserializeObject(Base64.getDecoder().decode(configuration.getString(key).getBytes()));
+            } catch (IllegalArgumentException iae) {
+                throw new IOException(iae.getMessage());
+            }
         } catch (final IOException | ClassNotFoundException e) {
             throw new IllegalArgumentException(e.getMessage(), e);
         }


[17/27] tinkerpop git commit: Remove obsolete NamingConversions.template TINKERPOP-1901 CTR

Posted by sp...@apache.org.
Remove obsolete NamingConversions.template TINKERPOP-1901 CTR


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

Branch: refs/heads/TINKERPOP-1595
Commit: 09fd327abbe142e6ca33d78148d9c1820f85a197
Parents: a4c5a21
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Fri Apr 27 09:22:51 2018 +0200
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Fri Apr 27 09:22:51 2018 +0200

----------------------------------------------------------------------
 gremlin-dotnet/glv/NamingConversions.template | 50 ----------------------
 1 file changed, 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/09fd327a/gremlin-dotnet/glv/NamingConversions.template
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/glv/NamingConversions.template b/gremlin-dotnet/glv/NamingConversions.template
deleted file mode 100644
index 201e74b..0000000
--- a/gremlin-dotnet/glv/NamingConversions.template
+++ /dev/null
@@ -1,50 +0,0 @@
-#region License
-
-/*
- * 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.
- */
-
-#endregion
-
-using System.Collections.Generic;
-
-// THIS IS A GENERATED FILE - DO NOT MODIFY THIS FILE DIRECTLY - see pom.xml
-namespace Gremlin.Net.Process.Traversal
-{
-    internal static class NamingConversions
-    {
-        /// <summary>
-        ///     Gets the Java name equivalent for a given enum value
-        /// </summary>
-        internal static string GetEnumJavaName(string typeName, string value)
-        {
-            var key = \$"{typeName}.{value}";
-            string javaName;
-            if (!CSharpToJavaEnums.TryGetValue(key, out javaName))
-            {
-                throw new KeyNotFoundException(\$"Java name for {key} not found");
-            }
-            return javaName;
-        }
-
-        internal static readonly IDictionary<string, string> CSharpToJavaEnums = new Dictionary<string, string>
-        {
-            <%= body %>
-        };
-    }
-}
\ No newline at end of file