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 2016/01/19 20:02:04 UTC

[01/11] incubator-tinkerpop git commit: Greatly simplified/sped-up AbstractLambdaTraversal. It doesn't need graph, strategy, parent, etc. references and all the complexities of cloning that that stuff entails. Next, it now has a consistent equals()/hashC

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-998 60de1502e -> 406c0f74f


Greatly simplified/sped-up AbstractLambdaTraversal. It doesn't need graph, strategy, parent, etc. references and all the complexities of cloning that that stuff entails. Next, it now has a consistent equals()/hashCode() model. Moreover, that hashCode()/equals() model that was only in DefaultGraphTraversal has now been moved up to DefaultTraversal where it should have been to begin with. Added proper TraverserRequirements to AbstractLambdaTraversal (hasnt bit us yet, but it could).


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

Branch: refs/heads/TINKERPOP-998
Commit: 9851241104eb738cd2646e50cdc9f5a424775ac5
Parents: 77af1a0
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jan 13 08:23:44 2016 -0700
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jan 13 08:23:44 2016 -0700

----------------------------------------------------------------------
 .../dsl/graph/DefaultGraphTraversal.java        | 14 --------
 .../traversal/dsl/graph/GraphTraversal.java     |  2 +-
 .../lambda/AbstractLambdaTraversal.java         | 38 +++++++++++++-------
 .../traversal/lambda/ConstantTraversal.java     |  1 -
 .../traversal/lambda/IdentityTraversal.java     | 15 +++-----
 .../process/traversal/lambda/LoopTraversal.java |  2 +-
 .../process/traversal/lambda/TrueTraversal.java | 19 ++++++----
 .../process/traversal/step/util/EmptyStep.java  |  2 +-
 .../traversal/util/DefaultTraversal.java        | 17 +++++++--
 .../process/traversal/util/EmptyTraversal.java  |  2 +-
 .../process/traversal/util/TraversalRing.java   |  2 +-
 11 files changed, 61 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/98512411/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/DefaultGraphTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/DefaultGraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/DefaultGraphTraversal.java
index e7ac96e..50b9287 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/DefaultGraphTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/DefaultGraphTraversal.java
@@ -46,20 +46,6 @@ public class DefaultGraphTraversal<S, E> extends DefaultTraversal<S, E> implemen
     }
 
     @Override
-    public boolean equals(final Object other) {
-        return other != null && other.getClass().equals(this.getClass()) && this.asAdmin().equals(((DefaultGraphTraversal) other).asAdmin());
-    }
-
-    @Override
-    public int hashCode() {
-        int result = this.getClass().hashCode();
-        for (final Step step : this.asAdmin().getSteps()) {
-            result ^= step.hashCode();
-        }
-        return result;
-    }
-
-    @Override
     public DefaultGraphTraversal<S, E> clone() {
         return (DefaultGraphTraversal<S, E>) super.clone();
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/98512411/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
index 712c893..488298f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
@@ -1120,7 +1120,7 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     }
 
     public default GraphTraversal<S, E> emit() {
-        return this.emit(new TrueTraversal<>());
+        return this.emit(TrueTraversal.instance());
     }
 
     public default GraphTraversal<S, E> until(final Traversal<?, ?> untilTraversal) {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/98512411/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/AbstractLambdaTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/AbstractLambdaTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/AbstractLambdaTraversal.java
index 3c95da6..2f27372 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/AbstractLambdaTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/AbstractLambdaTraversal.java
@@ -37,15 +37,14 @@ import org.apache.tinkerpop.gremlin.structure.Graph;
 import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
+import java.util.Set;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
 public abstract class AbstractLambdaTraversal<S, E> implements Traversal.Admin<S, E> {
 
-    private TraversalStrategies traversalStrategies = EmptyTraversalStrategies.instance();
-    private TraversalParent traversalParent = (TraversalParent) EmptyStep.instance();
-    private transient Graph graph = null;
+    private static final Set<TraverserRequirement> REQUIREMENTS = Collections.singleton(TraverserRequirement.OBJECT);
 
     public List<Step> getSteps() {
         return Collections.emptyList();
@@ -68,7 +67,7 @@ public abstract class AbstractLambdaTraversal<S, E> implements Traversal.Admin<S
 
     @Override
     public void applyStrategies() throws IllegalStateException {
-        this.traversalStrategies.applyStrategies(this);
+
     }
 
     @Override
@@ -98,30 +97,28 @@ public abstract class AbstractLambdaTraversal<S, E> implements Traversal.Admin<S
 
     @Override
     public void setStrategies(final TraversalStrategies strategies) {
-        this.traversalStrategies = strategies.clone();
+
     }
 
     @Override
     public TraversalStrategies getStrategies() {
-        return this.traversalStrategies;
+        return EmptyTraversalStrategies.instance();
     }
 
     @Override
     public void setParent(final TraversalParent step) {
-        this.traversalParent = step;
+
     }
 
     @Override
     public TraversalParent getParent() {
-        return this.traversalParent;
+        return EmptyStep.instance();
     }
 
     @Override
     public Traversal.Admin<S, E> clone() {
         try {
-            final AbstractLambdaTraversal<S, E> clone = (AbstractLambdaTraversal<S, E>) super.clone();
-            clone.traversalStrategies = this.traversalStrategies.clone();
-            return clone;
+            return (AbstractLambdaTraversal<S, E>) super.clone();
         } catch (final CloneNotSupportedException e) {
             throw new IllegalStateException(e.getMessage(), e);
         }
@@ -153,12 +150,27 @@ public abstract class AbstractLambdaTraversal<S, E> implements Traversal.Admin<S
 
     @Override
     public Optional<Graph> getGraph() {
-        return Optional.ofNullable(this.graph);
+        return Optional.empty();
     }
 
     @Override
     public void setGraph(final Graph graph) {
-        this.graph = graph;
+
+    }
+
+    @Override
+    public Set<TraverserRequirement> getTraverserRequirements() {
+        return REQUIREMENTS;
+    }
+
+    @Override
+    public int hashCode() {
+        return this.getClass().hashCode();
+    }
+
+    @Override
+    public boolean equals(final Object object) {
+        return this.getClass().equals(object.getClass()) && this.hashCode() == object.hashCode();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/98512411/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/ConstantTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/ConstantTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/ConstantTraversal.java
index 2bd965c..91973b9 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/ConstantTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/ConstantTraversal.java
@@ -39,7 +39,6 @@ public final class ConstantTraversal<S, E> extends AbstractLambdaTraversal<S, E>
         return "(" + this.end.toString() + ")";
     }
 
-
     @Override
     public int hashCode() {
         return this.getClass().hashCode() ^ this.end.hashCode();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/98512411/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/IdentityTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/IdentityTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/IdentityTraversal.java
index 74e5caf..88496c3 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/IdentityTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/IdentityTraversal.java
@@ -23,15 +23,13 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-public final class IdentityTraversal<S, E> extends AbstractLambdaTraversal<S, E> {
-
-    private static final String IDENTITY = "identity";
+public final class IdentityTraversal<S> extends AbstractLambdaTraversal<S, S> {
 
     private S s;
 
     @Override
-    public E next() {
-        return (E) this.s;
+    public S next() {
+        return this.s;
     }
 
     @Override
@@ -41,11 +39,6 @@ public final class IdentityTraversal<S, E> extends AbstractLambdaTraversal<S, E>
 
     @Override
     public String toString() {
-        return IDENTITY;
-    }
-
-    @Override
-    public int hashCode() {
-        return this.getClass().hashCode();
+        return "identity";
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/98512411/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/LoopTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/LoopTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/LoopTraversal.java
index 8f8a151..c0c40be 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/LoopTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/LoopTraversal.java
@@ -23,7 +23,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-public final class LoopTraversal<S, E> extends AbstractLambdaTraversal<S, E> {
+public final class LoopTraversal<S> extends AbstractLambdaTraversal<S, S> {
 
     private final long maxLoops;
     private boolean allow = false;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/98512411/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/TrueTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/TrueTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/TrueTraversal.java
index 46d3755..84c0db6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/TrueTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/TrueTraversal.java
@@ -21,11 +21,12 @@ package org.apache.tinkerpop.gremlin.process.traversal.lambda;
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-public final class TrueTraversal<S, E> extends AbstractLambdaTraversal<S, E> {
+public final class TrueTraversal<S> extends AbstractLambdaTraversal<S, S> {
+
+    private static final TrueTraversal INSTANCE = new TrueTraversal();
+
+    private TrueTraversal() {
 
-    @Override
-    public boolean hasNext() {
-        return true;
     }
 
     @Override
@@ -33,9 +34,13 @@ public final class TrueTraversal<S, E> extends AbstractLambdaTraversal<S, E> {
         return "true";
     }
 
-    @Override
-    public int hashCode() {
-        return this.getClass().hashCode();
+    public static <S> TrueTraversal<S> instance() {
+        return INSTANCE;
     }
 
+    @Override
+    @SuppressWarnings("CloneDoesntCallSuperClone")
+    public TrueTraversal<S> clone() {
+        return INSTANCE;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/98512411/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/EmptyStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/EmptyStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/EmptyStep.java
index d667749..9c6c5f0 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/EmptyStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/EmptyStep.java
@@ -37,7 +37,7 @@ public final class EmptyStep<S, E> implements Step<S, E>, TraversalParent {
 
     private static final EmptyStep INSTANCE = new EmptyStep<>();
 
-    public static <S, E> Step<S, E> instance() {
+    public static <S, E> EmptyStep<S, E> instance() {
         return INSTANCE;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/98512411/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java
index bcc7aeb..43fc692 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java
@@ -39,7 +39,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Optional;
 import java.util.Set;
-import java.util.stream.Collectors;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -54,7 +53,7 @@ public class DefaultTraversal<S, E> implements Traversal.Admin<S, E> {
     protected List<Step> steps = new ArrayList<>();
     // steps will be repeatedly retrieved from this traversal so wrap them once in an immutable list that can be reused
     protected List<Step> unmodifiableSteps = Collections.unmodifiableList(steps);
-    protected TraversalParent traversalParent = (TraversalParent) EmptyStep.instance();
+    protected TraversalParent traversalParent = EmptyStep.instance();
     protected TraversalSideEffects sideEffects = new DefaultTraversalSideEffects();
     protected TraversalStrategies strategies;
     protected TraversalEngine traversalEngine = StandardTraversalEngine.instance(); // necessary for strategies that need the engine in OLAP message passing (not so bueno)
@@ -297,4 +296,18 @@ public class DefaultTraversal<S, E> implements Traversal.Admin<S, E> {
         this.graph = graph;
     }
 
+    @Override
+    public boolean equals(final Object other) {
+        return other != null && other.getClass().equals(this.getClass()) && this.asAdmin().equals(((Traversal.Admin) other));
+    }
+
+    @Override
+    public int hashCode() {
+        int result = this.getClass().hashCode();
+        for (final Step step : this.asAdmin().getSteps()) {
+            result ^= step.hashCode();
+        }
+        return result;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/98512411/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversal.java
index de789cc..f6fc97c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversal.java
@@ -145,7 +145,7 @@ public class EmptyTraversal<S, E> implements Traversal.Admin<S, E> {
 
     @Override
     public TraversalParent getParent() {
-        return (TraversalParent) EmptyStep.instance();
+        return EmptyStep.instance();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/98512411/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalRing.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalRing.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalRing.java
index 5742966..841f280 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalRing.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalRing.java
@@ -32,7 +32,7 @@ import java.util.List;
  */
 public final class TraversalRing<A, B> implements Serializable, Cloneable {
 
-    private IdentityTraversal<A, B> identityTraversal = new IdentityTraversal<>();
+    private IdentityTraversal identityTraversal = new IdentityTraversal<>();
     private List<Traversal.Admin<A, B>> traversals = new ArrayList<>();
     private int currentTraversal = -1;
 


[07/11] incubator-tinkerpop git commit: Fixed test name.

Posted by sp...@apache.org.
Fixed test name.

"EdgeFunctionalityTest.shouldSupportAddVertexPropertyIfItCanBeAdded" should be "EdgeFunctionalityTest.shouldSupportAddEdgePropertyIfItCanBeAdded".

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

Branch: refs/heads/TINKERPOP-998
Commit: cf2e3b1a99dee9e45540859202cf784913658e47
Parents: f4e28a8
Author: Jonathan Ellithorpe <jd...@cs.stanford.edu>
Authored: Thu Jan 14 16:50:20 2016 -0800
Committer: Jonathan Ellithorpe <jd...@cs.stanford.edu>
Committed: Thu Jan 14 16:50:20 2016 -0800

----------------------------------------------------------------------
 .../org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/cf2e3b1a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
index ac09c84..dcc480b 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
@@ -555,7 +555,7 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
         @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
         @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = EdgeFeatures.FEATURE_ADD_PROPERTY, supported = false)
-        public void shouldSupportAddVertexPropertyIfItCanBeAdded() throws Exception {
+        public void shouldSupportAddEdgePropertyIfItCanBeAdded() throws Exception {
             try {
                 final Vertex v = graph.addVertex();
                 final Edge e = v.addEdge("test", v);


[05/11] incubator-tinkerpop git commit: Clean up javadoc warnings in gremlin-test

Posted by sp...@apache.org.
Clean up javadoc warnings in gremlin-test


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

Branch: refs/heads/TINKERPOP-998
Commit: 7a899278b80575ecf1f1b575f8d44198667eb9ab
Parents: 3ade0b0
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jan 14 12:00:00 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Jan 14 12:00:00 2016 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java | 3 ++-
 .../strategy/verification/ReadOnlyStrategyProcessTest.java        | 3 +--
 .../org/apache/tinkerpop/gremlin/structure/io/IoVertexTest.java   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7a899278/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
index 9128b6c..1d343c8 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
@@ -281,7 +281,8 @@ public interface GraphProvider {
     /**
      * An annotation to be applied to a {@code GraphProvider} implementation that provides additional information
      * about its intentions. The {@code Descriptor} is required by those {@code GraphProvider} implementations
-     * that will be assigned to test suites that use {@link TraversalEngine.Type#COMPUTER}.
+     * that will be assigned to test suites that use
+     * {@link org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine.Type#COMPUTER}.
      */
     @Retention(RetentionPolicy.RUNTIME)
     @Target(ElementType.TYPE)

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7a899278/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategyProcessTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategyProcessTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategyProcessTest.java
index 73eeae3..9da620c 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategyProcessTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReadOnlyStrategyProcessTest.java
@@ -22,11 +22,10 @@ import org.apache.tinkerpop.gremlin.FeatureRequirement;
 import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.structure.Direction;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.junit.Test;
 
-import static org.hamcrest.CoreMatchers.startsWith;
+import static org.hamcrest.core.StringStartsWith.startsWith;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.junit.Assert.fail;
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7a899278/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoVertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoVertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoVertexTest.java
index 60ccfdd..d457bc5 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoVertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoVertexTest.java
@@ -50,7 +50,7 @@ import java.util.function.Predicate;
 
 import static org.apache.tinkerpop.gremlin.structure.Graph.Features.DataTypeFeatures.FEATURE_STRING_VALUES;
 import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.startsWith;
+import static org.hamcrest.core.StringStartsWith.startsWith;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;


[03/11] incubator-tinkerpop git commit: updated CHANGELOG.

Posted by sp...@apache.org.
updated CHANGELOG.


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

Branch: refs/heads/TINKERPOP-998
Commit: 6c85a45f680e0e68ed27b33756c68acd93f368c4
Parents: 7e7b83e
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Jan 14 07:59:59 2016 -0700
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Jan 14 07:59:59 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/6c85a45f/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index ce72316..ddb9077 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,8 @@ image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/
 TinkerPop 3.1.1 (NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Reduced the complexity and execution time of all `AbstractLambdaTraversal` instances.
+* `DefaultTraversal` has a well defined `hashCode()` and `equals()`.
 * Integrated `NumberHelper` in `SackFunctions`.
 * The Spark persistence `StorageLevel` can now be set for both job graphs and `PersistedOutputRDD` data.
 * Added to the list of "invalid binding keys" allowed by Gremlin Server to cover the private fields of `T` which get exposed in the `ScriptEngine` on static imports.


[04/11] incubator-tinkerpop git commit: Cleaned up all the gremlin-core javadoc errors.

Posted by sp...@apache.org.
Cleaned up all the gremlin-core javadoc errors.


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

Branch: refs/heads/TINKERPOP-998
Commit: 3ade0b0f17f8a404285e0107c7c975aac24c97f5
Parents: 6c85a45
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jan 14 11:41:06 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Jan 14 11:41:06 2016 -0500

----------------------------------------------------------------------
 .../traversal/dsl/graph/GraphTraversal.java     | 21 ++++++++++----------
 .../traverser/TraverserRequirement.java         |  3 ++-
 .../traversal/util/DependantMutableMetrics.java |  5 ++---
 .../gremlin/structure/util/ElementHelper.java   |  5 +++--
 4 files changed, 18 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3ade0b0f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
index 488298f..a70a1c2 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
@@ -137,6 +137,7 @@ import org.apache.tinkerpop.gremlin.structure.Column;
 import org.apache.tinkerpop.gremlin.structure.Direction;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Element;
+import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Property;
 import org.apache.tinkerpop.gremlin.structure.PropertyType;
 import org.apache.tinkerpop.gremlin.structure.T;
@@ -188,7 +189,6 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
      * Map a traverser referencing an object of type <code>E</code> to an object of type <code>E2</code>.
      *
      * @param function the lambda expression that does the functional mapping
-     * @param <E2>the  mapping end type
      * @return the traversal with an appended {@link LambdaMapStep}.
      */
     public default <E2> GraphTraversal<S, E2> map(final Function<Traverser<E>, E2> function) {
@@ -1023,17 +1023,17 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
     }
 
     /**
-     * Sets a {@link Property} value and related meta properties if supplied, if supported by the {@link org.apache.tinkerpop.gremlin.structure.Graph}
+     * Sets a {@link Property} value and related meta properties if supplied, if supported by the {@link Graph}
      * and if the {@link Element} is a {@link VertexProperty}.  This method is the long-hand version of
-     * {@link #property(Object, Object, Object...)} with the difference that the {@link VertexProperty.Cardinality}
-     * can be supplied.
+     * {@link #property(Object, Object, Object...)} with the difference that the
+     * {@link org.apache.tinkerpop.gremlin.structure.VertexProperty.Cardinality} can be supplied.
      * <p/>
      * Generally speaking, this method will append an {@link AddPropertyStep} to the {@link Traversal} but when
      * possible, this method will attempt to fold key/value pairs into an {@link AddVertexStep}, {@link AddEdgeStep} or
      * {@link AddVertexStartStep}.  This potential optimization can only happen if cardinality is not supplied
      * and when meta-properties are not included.
      *
-     * @param cardinality the specified cardinality of the property where {@code null} will allow the {@link org.apache.tinkerpop.gremlin.structure.Graph}
+     * @param cardinality the specified cardinality of the property where {@code null} will allow the {@link Graph}
      *                    to use its default settings
      * @param key         the key for the property
      * @param value       the value for the property
@@ -1054,12 +1054,13 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
 
     /**
      * Sets the key and value of a {@link Property}. If the {@link Element} is a {@link VertexProperty} and the
-     * {@link org.apache.tinkerpop.gremlin.structure.Graph} supports it, meta properties can be set.  Use of this method assumes that the
-     * {@link VertexProperty.Cardinality} is defaulted to {@code null} which means that the default cardinality
-     * for the {@link org.apache.tinkerpop.gremlin.structure.Graph} will be used.
+     * {@link Graph} supports it, meta properties can be set.  Use of this method assumes that the
+     * {@link org.apache.tinkerpop.gremlin.structure.VertexProperty.Cardinality} is defaulted to {@code null} which
+     * means that the default cardinality for the {@link Graph} will be used.
      * <p/>
-     * This method is effectively calls {@link #property(VertexProperty.Cardinality, Object, Object, Object...)} as
-     * {@code property(null, key, value, keyValues}.
+     * This method is effectively calls
+     * {@link #property(org.apache.tinkerpop.gremlin.structure.VertexProperty.Cardinality, Object, Object, Object...)}
+     * as {@code property(null, key, value, keyValues}.
      *
      * @param key       the key for the property
      * @param value     the value for the property

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3ade0b0f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/TraverserRequirement.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/TraverserRequirement.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/TraverserRequirement.java
index ac2c509..88d1d21 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/TraverserRequirement.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/TraverserRequirement.java
@@ -26,7 +26,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
  * A {@link TraverserRequirement} is a list of requirements that a {@link Traversal} requires of a {@link Traverser}.
  * The less requirements, the simpler the traverser can be (both in terms of space and time constraints).
  * Every {@link Step} provides its specific requirements via {@link Step#getRequirements()}.
- * Moreover, every {@link Traversal.Admin} can be provided requirements via {@link Traversal.Admin#addTraverserRequirement(TraverserRequirement)}.
+ * Moreover, every {@link org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin} can be provided requirements via
+ * {@link org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin#addTraverserRequirement(TraverserRequirement)}.
  *
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3ade0b0f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DependantMutableMetrics.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DependantMutableMetrics.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DependantMutableMetrics.java
index 0ce939a..bb7d50c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DependantMutableMetrics.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DependantMutableMetrics.java
@@ -41,9 +41,8 @@ public class DependantMutableMetrics extends MutableMetrics {
     }
 
     /**
-     * Returns the actual duration taken by this Metrics by subtracting the duration taken by the upstream Step, if one exists.
-     * @param unit
-     * @return
+     * Returns the actual duration taken by this Metrics by subtracting the duration taken by the upstream Step, if
+     * one exists.
      */
     @Override
     public long getDuration(final TimeUnit unit) {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3ade0b0f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
index 7a7cf03..d42bdee 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
@@ -52,7 +52,7 @@ public final class ElementHelper {
     }
 
     /**
-     * Determine whether the Element label can be legally set. This is typically used as a pre-condition check.
+     * Determine whether the {@link Element} label can be legally set. This is typically used as a pre-condition check.
      *
      * @param label the element label
      * @throws IllegalArgumentException whether the label is legal and if not, a clear reason exception is provided
@@ -70,7 +70,8 @@ public final class ElementHelper {
      * Determine whether an array of ids are either all elements or ids of elements. This is typically used as a pre-condition check.
      *
      * @param clazz the class of the element for which the ids will bind
-     * @param ids   the ids that must be either elements or id objects, else {@link Graph.Exceptions#idArgsMustBeEitherIdOrElement()} is thrown.
+     * @param ids   the ids that must be either elements or id objects, else
+     * {@link org.apache.tinkerpop.gremlin.structure.Graph.Exceptions#idArgsMustBeEitherIdOrElement()} is thrown.
      */
     public static void validateMixedElementIds(final Class<? extends Element> clazz, final Object... ids) throws IllegalArgumentException {
         if (ids.length > 1) {


[06/11] incubator-tinkerpop git commit: Fixed javadoc warnings for gremlin-server.

Posted by sp...@apache.org.
Fixed javadoc warnings for gremlin-server.


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

Branch: refs/heads/TINKERPOP-998
Commit: f4e28a8e119588e66452e8386337614182d5b35b
Parents: 7a89927
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jan 14 12:12:09 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Jan 14 12:12:09 2016 -0500

----------------------------------------------------------------------
 .../gremlin/server/op/standard/StandardOpProcessor.java        | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f4e28a8e/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/standard/StandardOpProcessor.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/standard/StandardOpProcessor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/standard/StandardOpProcessor.java
index 9c64593..893ae75 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/standard/StandardOpProcessor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/standard/StandardOpProcessor.java
@@ -88,9 +88,9 @@ public class StandardOpProcessor extends AbstractEvalOpProcessor {
     /**
      * A useful method for those extending this class, where the means for binding construction can be supplied
      * to this class.  This function is used in {@link #evalOp(Context)} to create the final argument to
-     * {@link super#evalOpInternal(Context, Supplier, BindingSupplier)}. In this way an extending class can use
-     * the default {@link BindingSupplier} which carries a lot of re-usable functionality or provide a new one to
-     * override the existing approach.
+     * {@link AbstractEvalOpProcessor#evalOpInternal(Context, Supplier, org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor.BindingSupplier)}.
+     * In this way an extending class can use the default {@link org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor.BindingSupplier}
+     * which carries a lot of re-usable functionality or provide a new one to override the existing approach.
      */
     protected Function<Context, BindingSupplier> getBindingMaker() {
         return context -> () -> {


[10/11] incubator-tinkerpop git commit: Merge remote-tracking branch 'origin/TINKERPOP-1086'

Posted by sp...@apache.org.
Merge remote-tracking branch 'origin/TINKERPOP-1086'


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

Branch: refs/heads/TINKERPOP-998
Commit: 9eddd6a3a496a57edd44bcf3bd487700946be06f
Parents: 1670e08 74b4c61
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jan 19 06:29:43 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jan 19 06:29:43 2016 -0500

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   1 +
 .../gremlin/structure/io/gryo/GryoMapper.java   |  30 +-
 .../structure/io/gryo/JavaTimeSerializers.java  | 303 +++++++++++++++++++
 .../structure/io/gryo/GryoMapperTest.java       | 109 +++++++
 4 files changed, 442 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[08/11] incubator-tinkerpop git commit: Added gryo serializers for virtually all java.time classes.

Posted by sp...@apache.org.
Added gryo serializers for virtually all java.time classes.

These classes did not have serializers natively to kryo and were also not in the semi-standard contrib package of serializers.


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

Branch: refs/heads/TINKERPOP-998
Commit: 74b4c6186158037b20593a12e9b7ed4105632be1
Parents: cf2e3b1
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jan 15 19:51:39 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Jan 15 19:51:39 2016 -0500

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   1 +
 .../gremlin/structure/io/gryo/GryoMapper.java   |  30 +-
 .../structure/io/gryo/JavaTimeSerializers.java  | 303 +++++++++++++++++++
 .../structure/io/gryo/GryoMapperTest.java       | 109 +++++++
 4 files changed, 442 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/74b4c618/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index ddb9077..0a14e50 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -28,6 +28,7 @@ TinkerPop 3.1.1 (NOT OFFICIALLY RELEASED YET)
 
 * Reduced the complexity and execution time of all `AbstractLambdaTraversal` instances.
 * `DefaultTraversal` has a well defined `hashCode()` and `equals()`.
+* Added serializers to Gryo for `java.time` related classes.
 * Integrated `NumberHelper` in `SackFunctions`.
 * The Spark persistence `StorageLevel` can now be set for both job graphs and `PersistedOutputRDD` data.
 * Added to the list of "invalid binding keys" allowed by Gremlin Server to cover the private fields of `T` which get exposed in the `ScriptEngine` on static imports.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/74b4c618/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
index 7d945ce..cc77fa3 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
@@ -69,6 +69,20 @@ import org.javatuples.Triplet;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.net.URI;
+import java.time.Duration;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.MonthDay;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.Period;
+import java.time.Year;
+import java.time.YearMonth;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Calendar;
@@ -232,7 +246,7 @@ public final class GryoMapper implements Mapper<Kryo> {
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(EnumSet.class, null, 46));
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(HashMap.class, null, 11));
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(HashMap.Entry.class, null, 16));
-            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(HASH_MAP_NODE, null, 92));   // ***LAST ID**
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(HASH_MAP_NODE, null, 92));
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(KryoSerializable.class, null, 36));
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(LinkedHashMap.class, null, 47));
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(LinkedHashSet.class, null, 71));
@@ -282,6 +296,20 @@ public final class GryoMapper implements Mapper<Kryo> {
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(AtomicLong.class, null, 79));
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(DependantMutableMetrics.class, null, 80));
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(Pair.class, kryo -> new PairSerializer(), 88));
+
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(Duration.class, kryo -> new JavaTimeSerializers.DurationSerializer(), 93));
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(Instant.class, kryo -> new JavaTimeSerializers.InstantSerializer(), 94));
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(LocalDate.class, kryo -> new JavaTimeSerializers.LocalDateSerializer(), 95));
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(LocalDateTime.class, kryo -> new JavaTimeSerializers.LocalDateTimeSerializer(), 96));
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(LocalTime.class, kryo -> new JavaTimeSerializers.LocalTimeSerializer(), 97));
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(MonthDay.class, kryo -> new JavaTimeSerializers.MonthDaySerializer(), 98));
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(OffsetDateTime.class, kryo -> new JavaTimeSerializers.OffsetDateTimeSerializer(), 99));
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(OffsetTime.class, kryo -> new JavaTimeSerializers.OffsetTimeSerializer(), 100));
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(Period.class, kryo -> new JavaTimeSerializers.PeriodSerializer(), 101));
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(Year.class, kryo -> new JavaTimeSerializers.YearSerializer(), 102));
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(YearMonth.class, kryo -> new JavaTimeSerializers.YearMonthSerializer(), 103));
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(ZonedDateTime.class, kryo -> new JavaTimeSerializers.ZonedDateTimeSerializer(), 104));
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(ZoneOffset.class, kryo -> new JavaTimeSerializers.ZoneOffsetSerializer(), 105)); // ***LAST ID**
         }};
 
         private final List<IoRegistry> registries = new ArrayList<>();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/74b4c618/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/JavaTimeSerializers.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/JavaTimeSerializers.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/JavaTimeSerializers.java
new file mode 100644
index 0000000..1d4e236
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/JavaTimeSerializers.java
@@ -0,0 +1,303 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.structure.io.gryo;
+
+import org.apache.tinkerpop.shaded.kryo.Kryo;
+import org.apache.tinkerpop.shaded.kryo.Serializer;
+import org.apache.tinkerpop.shaded.kryo.io.Input;
+import org.apache.tinkerpop.shaded.kryo.io.Output;
+
+import java.time.Duration;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.MonthDay;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.Period;
+import java.time.Year;
+import java.time.YearMonth;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
+
+/**
+ * Serializers for classes in the {@code java.time} package.
+ */
+final class JavaTimeSerializers {
+
+    private JavaTimeSerializers() {}
+
+    /**
+     * Serializer for the {@link Duration} class.
+     */
+    final static class DurationSerializer extends Serializer<Duration>
+    {
+        @Override
+        public void write(final Kryo kryo, final Output output, final Duration duration)
+        {
+            output.writeLong(duration.toNanos());
+        }
+
+        @Override
+        public Duration read(final Kryo kryo, final Input input, final Class<Duration> durationClass)
+        {
+            return Duration.ofNanos(input.readLong());
+        }
+    }
+
+    /**
+     * Serializer for the {@link Instant} class.
+     */
+    final static class InstantSerializer extends Serializer<Instant>
+    {
+        @Override
+        public void write(Kryo kryo, Output output, Instant instant)
+        {
+            output.writeLong(instant.getEpochSecond());
+            output.writeInt(instant.getNano());
+        }
+
+        @Override
+        public Instant read(Kryo kryo, Input input, Class<Instant> aClass)
+        {
+            return Instant.ofEpochSecond(input.readLong(), input.readInt());
+        }
+    }
+
+    /**
+     * Serializer for the {@link LocalDate} class.
+     */
+    final static class LocalDateSerializer extends Serializer<LocalDate>
+    {
+        @Override
+        public void write(final Kryo kryo, final Output output, final LocalDate localDate)
+        {
+            output.writeLong(localDate.toEpochDay());
+        }
+
+        @Override
+        public LocalDate read(final Kryo kryo, final Input input, final Class<LocalDate> clazz)
+        {
+            return LocalDate.ofEpochDay(input.readLong());
+        }
+    }
+
+    /**
+     * Serializer for the {@link LocalDateTime} class.
+     */
+    final static class LocalDateTimeSerializer extends Serializer<LocalDateTime>
+    {
+        @Override
+        public void write(final Kryo kryo, final Output output, final LocalDateTime localDateTime)
+        {
+            output.writeInt(localDateTime.getYear());
+            output.writeInt(localDateTime.getMonthValue());
+            output.writeInt(localDateTime.getDayOfMonth());
+            output.writeInt(localDateTime.getHour());
+            output.writeInt(localDateTime.getMinute());
+            output.writeInt(localDateTime.getSecond());
+            output.writeInt(localDateTime.getNano());
+        }
+
+        @Override
+        public LocalDateTime read(final Kryo kryo, final Input input, final Class<LocalDateTime> clazz)
+        {
+            return LocalDateTime.of(input.readInt(), input.readInt(), input.readInt(), input.readInt(), input.readInt(), input.readInt(), input.readInt());
+        }
+    }
+
+    /**
+     * Serializer for the {@link LocalTime} class.
+     */
+    final static class LocalTimeSerializer extends Serializer<LocalTime>
+    {
+        @Override
+        public void write(final Kryo kryo, final Output output, final LocalTime localTime)
+        {
+            output.writeLong(localTime.toNanoOfDay());
+        }
+
+        @Override
+        public LocalTime read(final Kryo kryo, final Input input, final Class<LocalTime> clazz)
+        {
+            return LocalTime.ofNanoOfDay(input.readLong());
+        }
+    }
+
+    /**
+     * Serializer for the {@link MonthDay} class.
+     */
+    final static class MonthDaySerializer extends Serializer<MonthDay>
+    {
+        @Override
+        public void write(final Kryo kryo, final Output output, final MonthDay monthDay)
+        {
+            output.writeInt(monthDay.getMonthValue());
+            output.writeInt(monthDay.getDayOfMonth());
+        }
+
+        @Override
+        public MonthDay read(final Kryo kryo, final Input input, final Class<MonthDay> clazz)
+        {
+            return MonthDay.of(input.readInt(), input.readInt());
+        }
+    }
+
+    /**
+     * Serializer for the {@link OffsetDateTime} class.
+     */
+    final static class OffsetDateTimeSerializer extends Serializer<OffsetDateTime>
+    {
+        @Override
+        public void write(final Kryo kryo, final Output output, final OffsetDateTime offsetDateTime)
+        {
+            kryo.writeObject(output, offsetDateTime.toLocalDateTime());
+            kryo.writeObject(output, offsetDateTime.getOffset());
+        }
+
+        @Override
+        public OffsetDateTime read(final Kryo kryo, final Input input, final Class<OffsetDateTime> clazz)
+        {
+            return OffsetDateTime.of(kryo.readObject(input, LocalDateTime.class), kryo.readObject(input, ZoneOffset.class));
+        }
+    }
+
+    /**
+     * Serializer for the {@link OffsetTime} class.
+     */
+    final static class OffsetTimeSerializer extends Serializer<OffsetTime>
+    {
+        @Override
+        public void write(final Kryo kryo, final Output output, final OffsetTime offsetTime)
+        {
+            kryo.writeObject(output, offsetTime.toLocalTime());
+            kryo.writeObject(output, offsetTime.getOffset());
+        }
+
+        @Override
+        public OffsetTime read(final Kryo kryo, final Input input, final Class<OffsetTime> clazz)
+        {
+            return OffsetTime.of(kryo.readObject(input, LocalTime.class), kryo.readObject(input, ZoneOffset.class));
+        }
+    }
+
+    /**
+     * Serializer for the {@link Period} class.
+     */
+    final static class PeriodSerializer extends Serializer<Period>
+    {
+        @Override
+        public void write(final Kryo kryo, final Output output, final Period period)
+        {
+            output.writeInt(period.getYears());
+            output.writeInt(period.getMonths());
+            output.writeInt(period.getDays());
+        }
+
+        @Override
+        public Period read(final Kryo kryo, final Input input, final Class<Period> clazz)
+        {
+            return Period.of(input.readInt(), input.readInt(), input.readInt());
+        }
+    }
+
+    /**
+     * Serializer for the {@link Year} class.
+     */
+    final static class YearSerializer extends Serializer<Year>
+    {
+        @Override
+        public void write(final Kryo kryo, final Output output, final Year year)
+        {
+            output.writeInt(year.getValue());
+        }
+
+        @Override
+        public Year read(final Kryo kryo, final Input input, final Class<Year> clazz)
+        {
+            return Year.of(input.readInt());
+        }
+    }
+
+    /**
+     * Serializer for the {@link YearMonth} class.
+     */
+    final static class YearMonthSerializer extends Serializer<YearMonth>
+    {
+        @Override
+        public void write(final Kryo kryo, final Output output, final YearMonth monthDay)
+        {
+            output.writeInt(monthDay.getYear());
+            output.writeInt(monthDay.getMonthValue());
+        }
+
+        @Override
+        public YearMonth read(final Kryo kryo, final Input input, final Class<YearMonth> clazz)
+        {
+            return YearMonth.of(input.readInt(), input.readInt());
+        }
+    }
+
+    /**
+     * Serializer for the {@link ZonedDateTime} class.
+     */
+    final static class ZonedDateTimeSerializer extends Serializer<ZonedDateTime>
+    {
+        @Override
+        public void write(final Kryo kryo, final Output output, final ZonedDateTime zonedDateTime)
+        {
+            output.writeInt(zonedDateTime.getYear());
+            output.writeInt(zonedDateTime.getMonthValue());
+            output.writeInt(zonedDateTime.getDayOfMonth());
+            output.writeInt(zonedDateTime.getHour());
+            output.writeInt(zonedDateTime.getMinute());
+            output.writeInt(zonedDateTime.getSecond());
+            output.writeInt(zonedDateTime.getNano());
+            output.writeString(zonedDateTime.getZone().getId());
+        }
+
+        @Override
+        public ZonedDateTime read(final Kryo kryo, final Input input, final Class<ZonedDateTime> clazz)
+        {
+            return ZonedDateTime.of(input.readInt(), input.readInt(), input.readInt(),
+                    input.readInt(), input.readInt(), input.readInt(), input.readInt(),
+                    ZoneId.of(input.readString()));
+        }
+    }
+
+    /**
+     * Serializer for the {@link ZoneOffset} class.
+     */
+    final static class ZoneOffsetSerializer extends Serializer<ZoneOffset>
+    {
+        @Override
+        public void write(final Kryo kryo, final Output output, final ZoneOffset zoneOffset)
+        {
+            output.writeString(zoneOffset.getId());
+        }
+
+        @Override
+        public ZoneOffset read(final Kryo kryo, final Input input, final Class<ZoneOffset> clazz)
+        {
+            return ZoneOffset.of(input.readString());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/74b4c618/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapperTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapperTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapperTest.java
index 76a2804..a915797 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapperTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapperTest.java
@@ -36,6 +36,20 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.time.Duration;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.MonthDay;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.Period;
+import java.time.Year;
+import java.time.YearMonth;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -50,6 +64,10 @@ import static org.junit.Assert.assertNotSame;
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class GryoMapperTest {
+
+    private final GryoMapper sharedMapper = GryoMapper.build().create();
+    private final Kryo sharedKryo = sharedMapper.createMapper();
+
     @Test
     public void shouldMakeNewInstance() {
         final GryoMapper.Builder b = GryoMapper.build();
@@ -200,6 +218,97 @@ public class GryoMapperTest {
         }
     }
 
+    @Test
+    public void shouldHandleDuration()throws Exception  {
+        final Duration o = Duration.ZERO;
+        assertEquals(o, serializeDeserialize(o, Duration.class));
+    }
+
+    @Test
+    public void shouldHandleInstant()throws Exception  {
+        final Instant o = Instant.ofEpochMilli(System.currentTimeMillis());
+        assertEquals(o, serializeDeserialize(o, Instant.class));
+    }
+
+    @Test
+    public void shouldHandleLocalDate()throws Exception  {
+        final LocalDate o = LocalDate.now();
+        assertEquals(o, serializeDeserialize(o, LocalDate.class));
+    }
+
+    @Test
+    public void shouldHandleLocalDateTime()throws Exception  {
+        final LocalDateTime o = LocalDateTime.now();
+        assertEquals(o, serializeDeserialize(o, LocalDateTime.class));
+    }
+
+    @Test
+    public void shouldHandleLocalTime()throws Exception  {
+        final LocalTime o = LocalTime.now();
+        assertEquals(o, serializeDeserialize(o, LocalTime.class));
+    }
+
+    @Test
+    public void shouldHandleMonthDay()throws Exception  {
+        final MonthDay o = MonthDay.now();
+        assertEquals(o, serializeDeserialize(o, MonthDay.class));
+    }
+
+    @Test
+    public void shouldHandleOffsetDateTime()throws Exception  {
+        final OffsetDateTime o = OffsetDateTime.now();
+        assertEquals(o, serializeDeserialize(o, OffsetDateTime.class));
+    }
+
+    @Test
+    public void shouldHandleOffsetTime()throws Exception  {
+        final OffsetTime o = OffsetTime.now();
+        assertEquals(o, serializeDeserialize(o, OffsetTime.class));
+    }
+
+    @Test
+    public void shouldHandlePeriod()throws Exception  {
+        final Period o = Period.ofDays(3);
+        assertEquals(o, serializeDeserialize(o, Period.class));
+    }
+
+    @Test
+    public void shouldHandleYear()throws Exception  {
+        final Year o = Year.now();
+        assertEquals(o, serializeDeserialize(o, Year.class));
+    }
+
+    @Test
+    public void shouldHandleYearMonth()throws Exception  {
+        final YearMonth o = YearMonth.now();
+        assertEquals(o, serializeDeserialize(o, YearMonth.class));
+    }
+
+    @Test
+    public void shouldHandleZonedDateTime()throws Exception  {
+        final ZonedDateTime o = ZonedDateTime.now();
+        assertEquals(o, serializeDeserialize(o, ZonedDateTime.class));
+    }
+
+    @Test
+    public void shouldHandleZonedOffset()throws Exception  {
+        final ZoneOffset o  = ZonedDateTime.now().getOffset();
+        assertEquals(o, serializeDeserialize(o, ZoneOffset.class));
+    }
+
+    public <T> T serializeDeserialize(final Object o, final Class<T> clazz) throws Exception {
+        try (final ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
+            final Output out = new Output(stream);
+            sharedKryo.writeObject(out, o);
+            out.flush();
+
+            try (final InputStream inputStream = new ByteArrayInputStream(stream.toByteArray())) {
+                final Input input = new Input(inputStream);
+                return sharedKryo.readObject(input, clazz);
+            }
+        }
+    }
+
     /**
      * Creates new {@link CustomClassResolver} when requested.
      */


[02/11] incubator-tinkerpop git commit: Merge branch 'TINKERPOP-1083'

Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1083'


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

Branch: refs/heads/TINKERPOP-998
Commit: 7e7b83e301272dce478d1a949e9c7f5e775716b4
Parents: 51c4326 9851241
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Jan 14 07:58:39 2016 -0700
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Jan 14 07:58:39 2016 -0700

----------------------------------------------------------------------
 .../dsl/graph/DefaultGraphTraversal.java        | 14 --------
 .../traversal/dsl/graph/GraphTraversal.java     |  2 +-
 .../lambda/AbstractLambdaTraversal.java         | 38 +++++++++++++-------
 .../traversal/lambda/ConstantTraversal.java     |  1 -
 .../traversal/lambda/IdentityTraversal.java     | 15 +++-----
 .../process/traversal/lambda/LoopTraversal.java |  2 +-
 .../process/traversal/lambda/TrueTraversal.java | 19 ++++++----
 .../process/traversal/step/util/EmptyStep.java  |  2 +-
 .../traversal/util/DefaultTraversal.java        | 17 +++++++--
 .../process/traversal/util/EmptyTraversal.java  |  2 +-
 .../process/traversal/util/TraversalRing.java   |  2 +-
 11 files changed, 61 insertions(+), 53 deletions(-)
----------------------------------------------------------------------



[09/11] incubator-tinkerpop git commit: cleaned up SparkGraphComputer file handling a bit. Just better code organization and no so many configuration.get() calls. Fixed a bug in PersitedInputOutputRDDTest. Moved the loadJars() line closer to context crea

Posted by sp...@apache.org.
cleaned up SparkGraphComputer file handling a bit. Just better code organization and no so many configuration.get() calls. Fixed a bug in PersitedInputOutputRDDTest. Moved the loadJars() line closer to context creation (@dkuppitz). CTR.


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

Branch: refs/heads/TINKERPOP-998
Commit: 1670e08fb76387a52cbae3fb91e4789ab78b7e5c
Parents: cf2e3b1
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Sat Jan 16 10:18:41 2016 -0700
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Sat Jan 16 10:18:53 2016 -0700

----------------------------------------------------------------------
 .../hadoop/structure/io/InputOutputHelper.java  |  4 +--
 .../process/computer/SparkGraphComputer.java    | 31 ++++++++++++--------
 .../io/PersistedInputOutputRDDTest.java         | 11 +++----
 3 files changed, 25 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1670e08f/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/InputOutputHelper.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/InputOutputHelper.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/InputOutputHelper.java
index 48c2ad4..11c579e 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/InputOutputHelper.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/InputOutputHelper.java
@@ -80,11 +80,9 @@ public final class InputOutputHelper {
             newConfiguration.setProperty(Constants.GREMLIN_HADOOP_INPUT_LOCATION, hadoopConfiguration.getOutputLocation());
             if (hadoopConfiguration.containsKey(Constants.GREMLIN_HADOOP_GRAPH_OUTPUT_FORMAT))
                 newConfiguration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_INPUT_FORMAT, InputOutputHelper.getInputFormat(hadoopConfiguration.getGraphOutputFormat()).getCanonicalName());
-            newConfiguration.setProperty(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, hadoopConfiguration.getOutputLocation() + "_");
             newConfiguration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_INPUT_FORMAT_HAS_EDGES, persist.equals(GraphComputer.Persist.EDGES));
-        } else {
-            newConfiguration.setProperty(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, hadoopConfiguration.getOutputLocation() + "_");
         }
+        newConfiguration.setProperty(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, hadoopConfiguration.getOutputLocation() + "_");
         return HadoopGraph.open(newConfiguration);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1670e08f/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputer.java
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputer.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputer.java
index a87f95f..bb7e8bb 100644
--- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputer.java
+++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputer.java
@@ -57,6 +57,7 @@ import org.apache.tinkerpop.gremlin.spark.structure.io.OutputFormatRDD;
 import org.apache.tinkerpop.gremlin.spark.structure.io.OutputRDD;
 import org.apache.tinkerpop.gremlin.spark.structure.io.PersistedOutputRDD;
 import org.apache.tinkerpop.gremlin.spark.structure.io.SparkContextStorage;
+import org.apache.tinkerpop.gremlin.structure.io.Storage;
 
 import java.io.File;
 import java.io.IOException;
@@ -131,14 +132,18 @@ public final class SparkGraphComputer extends AbstractHadoopGraphComputer {
         // create the completable future
         return CompletableFuture.<ComputerResult>supplyAsync(() -> {
             final long startTime = System.currentTimeMillis();
+            final Storage fileSystemStorage = FileSystemStorage.open(hadoopConfiguration);
+            final Storage sparkContextStorage = SparkContextStorage.open(apacheConfiguration);
+            final boolean outputToHDFS = FileOutputFormat.class.isAssignableFrom(hadoopConfiguration.getClass(Constants.GREMLIN_HADOOP_GRAPH_OUTPUT_FORMAT, Object.class));
+            final boolean outputToSpark = PersistedOutputRDD.class.isAssignableFrom(hadoopConfiguration.getClass(Constants.GREMLIN_SPARK_GRAPH_OUTPUT_RDD, Object.class));
             SparkMemory memory = null;
             // delete output location
             final String outputLocation = hadoopConfiguration.get(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, null);
-            try {
-                if (null != outputLocation && FileSystem.get(hadoopConfiguration).exists(new Path(outputLocation)))
-                    FileSystem.get(hadoopConfiguration).delete(new Path(outputLocation), true);
-            } catch (final IOException e) {
-                throw new IllegalStateException(e.getMessage(), e);
+            if (null != outputLocation) {
+                if (outputToHDFS && fileSystemStorage.exists(outputLocation))
+                    fileSystemStorage.rm(outputLocation);
+                if (outputToSpark && sparkContextStorage.exists(outputLocation))
+                    sparkContextStorage.rm(outputLocation);
             }
             // wire up a spark context
             final SparkConf sparkConfiguration = new SparkConf();
@@ -149,10 +154,9 @@ public final class SparkGraphComputer extends AbstractHadoopGraphComputer {
             // execute the vertex program and map reducers and if there is a failure, auto-close the spark context
             try {
                 final JavaSparkContext sparkContext = new JavaSparkContext(SparkContext.getOrCreate(sparkConfiguration));
+                this.loadJars(sparkContext, hadoopConfiguration); // add the project jars to the cluster
                 Spark.create(sparkContext.sc()); // this is the context RDD holder that prevents GC
                 updateLocalConfiguration(sparkContext, sparkConfiguration);
-                // add the project jars to the cluster
-                this.loadJars(sparkContext, hadoopConfiguration);
                 // create a message-passing friendly rdd from the input rdd
                 JavaPairRDD<Object, VertexWritable> graphRDD;
                 try {
@@ -242,14 +246,15 @@ public final class SparkGraphComputer extends AbstractHadoopGraphComputer {
                 }
 
                 // unpersist the graphRDD if it will no longer be used
-                if (!PersistedOutputRDD.class.equals(hadoopConfiguration.getClass(Constants.GREMLIN_SPARK_GRAPH_OUTPUT_RDD, null)) || this.persist.equals(GraphComputer.Persist.NOTHING)) {
+                if (!outputToSpark || this.persist.equals(GraphComputer.Persist.NOTHING))
                     graphRDD.unpersist();
-                    if (apacheConfiguration.containsKey(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION))
-                        SparkContextStorage.open().rm(apacheConfiguration.getString(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION));
-                }
                 // delete any file system output if persist nothing
-                if (FileOutputFormat.class.isAssignableFrom(hadoopConfiguration.getClass(Constants.GREMLIN_HADOOP_GRAPH_OUTPUT_FORMAT, FileInputFormat.class)) && this.persist.equals(GraphComputer.Persist.NOTHING))
-                    FileSystemStorage.open(hadoopConfiguration).rm(apacheConfiguration.getString(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION));
+                if (null != outputLocation && this.persist.equals(GraphComputer.Persist.NOTHING)) {
+                    if (outputToHDFS)
+                        fileSystemStorage.rm(outputLocation);
+                    if (outputToSpark)
+                        sparkContextStorage.rm(outputLocation);
+                }
                 // update runtime and return the newly computed graph
                 finalMemory.setRuntime(System.currentTimeMillis() - startTime);
                 return new DefaultComputerResult(InputOutputHelper.getOutputGraph(apacheConfiguration, this.resultGraph, this.persist), finalMemory.asImmutable());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1670e08f/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/PersistedInputOutputRDDTest.java
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/PersistedInputOutputRDDTest.java b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/PersistedInputOutputRDDTest.java
index 5076e0b..895df01 100644
--- a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/PersistedInputOutputRDDTest.java
+++ b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/PersistedInputOutputRDDTest.java
@@ -255,6 +255,7 @@ public class PersistedInputOutputRDDTest extends AbstractSparkTest {
         Spark.create("local[4]");
 
         final String rddName = TestHelper.makeTestDataDirectory(PersistedInputOutputRDDTest.class, "testComplexChain", "graphRDD");
+        final String rddName2 = TestHelper.makeTestDataDirectory(PersistedInputOutputRDDTest.class, "testComplexChain", "graphRDD2");
         final Configuration configuration = new BaseConfiguration();
         configuration.setProperty("spark.master", "local[4]");
         configuration.setProperty("spark.serializer", GryoSerializer.class.getCanonicalName());
@@ -280,7 +281,7 @@ public class PersistedInputOutputRDDTest extends AbstractSparkTest {
         configuration.setProperty(Constants.GREMLIN_SPARK_GRAPH_INPUT_RDD, PersistedInputRDD.class.getCanonicalName());
         configuration.setProperty(Constants.GREMLIN_HADOOP_INPUT_LOCATION, rddName);
         configuration.setProperty(Constants.GREMLIN_SPARK_GRAPH_OUTPUT_RDD, PersistedOutputRDD.class.getCanonicalName());
-        configuration.setProperty(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, rddName);
+        configuration.setProperty(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, rddName2);
         ////
         graph = GraphFactory.open(configuration);
         graph = graph.compute(SparkGraphComputer.class).persist(GraphComputer.Persist.EDGES).program(PageRankVertexProgram.build().iterations(2).create(graph)).submit().get().graph();
@@ -290,7 +291,7 @@ public class PersistedInputOutputRDDTest extends AbstractSparkTest {
         assertEquals(6l, g.V().values(PageRankVertexProgram.PAGE_RANK).count().next().longValue());
         assertEquals(6l, g.V().values(PageRankVertexProgram.EDGE_COUNT).count().next().longValue());
         ////
-        assertTrue(Spark.hasRDD(Constants.getGraphLocation(rddName)));
+        assertTrue(Spark.hasRDD(Constants.getGraphLocation(rddName2)));
         ////
         graph = GraphFactory.open(configuration);
         graph = graph.compute(SparkGraphComputer.class).persist(GraphComputer.Persist.VERTEX_PROPERTIES).program(PageRankVertexProgram.build().iterations(2).create(graph)).submit().get().graph();
@@ -300,18 +301,18 @@ public class PersistedInputOutputRDDTest extends AbstractSparkTest {
         assertEquals(6l, g.V().values(PageRankVertexProgram.PAGE_RANK).count().next().longValue());
         assertEquals(6l, g.V().values(PageRankVertexProgram.EDGE_COUNT).count().next().longValue());
         ////
-        assertTrue(Spark.hasRDD(Constants.getGraphLocation(rddName)));
+        assertTrue(Spark.hasRDD(Constants.getGraphLocation(rddName2)));
         ////
         graph = GraphFactory.open(configuration);
         graph.compute(SparkGraphComputer.class).persist(GraphComputer.Persist.NOTHING).program(PageRankVertexProgram.build().iterations(2).create(graph)).submit().get().graph();
-        assertFalse(Spark.hasRDD(Constants.getGraphLocation(rddName)));
+        assertFalse(Spark.hasRDD(Constants.getGraphLocation(rddName2)));
         g = graph.traversal();
         assertEquals(0l, g.V().count().next().longValue());
         assertEquals(0l, g.E().count().next().longValue());
         assertEquals(0l, g.V().values(PageRankVertexProgram.PAGE_RANK).count().next().longValue());
         assertEquals(0l, g.V().values(PageRankVertexProgram.EDGE_COUNT).count().next().longValue());
         ////
-        assertFalse(Spark.hasRDD(Constants.getGraphLocation(rddName)));
+        assertFalse(Spark.hasRDD(Constants.getGraphLocation(rddName2)));
         Spark.close();
     }
 }


[11/11] incubator-tinkerpop git commit: Merge remote-tracking branch 'origin/master' into TINKERPOP-998

Posted by sp...@apache.org.
Merge remote-tracking branch 'origin/master' into TINKERPOP-998


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

Branch: refs/heads/TINKERPOP-998
Commit: 406c0f74fabf46bba1fc6c7425e03369f3d680c1
Parents: 60de150 9eddd6a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jan 19 14:01:44 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jan 19 14:01:44 2016 -0500

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   3 +
 .../dsl/graph/DefaultGraphTraversal.java        |  14 -
 .../traversal/dsl/graph/GraphTraversal.java     |  23 +-
 .../lambda/AbstractLambdaTraversal.java         |  38 ++-
 .../traversal/lambda/ConstantTraversal.java     |   1 -
 .../traversal/lambda/IdentityTraversal.java     |  15 +-
 .../process/traversal/lambda/LoopTraversal.java |   2 +-
 .../process/traversal/lambda/TrueTraversal.java |  19 +-
 .../process/traversal/step/util/EmptyStep.java  |   2 +-
 .../traverser/TraverserRequirement.java         |   3 +-
 .../traversal/util/DefaultTraversal.java        |  17 +-
 .../traversal/util/DependantMutableMetrics.java |   5 +-
 .../process/traversal/util/EmptyTraversal.java  |   2 +-
 .../process/traversal/util/TraversalRing.java   |   2 +-
 .../gremlin/structure/io/gryo/GryoMapper.java   |  30 +-
 .../structure/io/gryo/JavaTimeSerializers.java  | 303 +++++++++++++++++++
 .../gremlin/structure/util/ElementHelper.java   |   5 +-
 .../structure/io/gryo/GryoMapperTest.java       | 109 +++++++
 .../server/op/standard/StandardOpProcessor.java |   6 +-
 .../apache/tinkerpop/gremlin/GraphProvider.java |   3 +-
 .../ReadOnlyStrategyProcessTest.java            |   3 +-
 .../gremlin/structure/FeatureSupportTest.java   |   2 +-
 .../gremlin/structure/io/IoVertexTest.java      |   2 +-
 .../hadoop/structure/io/InputOutputHelper.java  |   4 +-
 .../process/computer/SparkGraphComputer.java    |  31 +-
 .../io/PersistedInputOutputRDDTest.java         |  11 +-
 26 files changed, 556 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/406c0f74/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --cc CHANGELOG.asciidoc
index 9fb8cc7,0a14e50..7c46b3d
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@@ -26,8 -26,10 +26,11 @@@ image::https://raw.githubusercontent.co
  TinkerPop 3.1.1 (NOT OFFICIALLY RELEASED YET)
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
+ * Reduced the complexity and execution time of all `AbstractLambdaTraversal` instances.
+ * `DefaultTraversal` has a well defined `hashCode()` and `equals()`.
+ * Added serializers to Gryo for `java.time` related classes.
  * Integrated `NumberHelper` in `SackFunctions`.
 +* Deprecated `VertexPropertyFeatures.supportsAddProperty()` which effectively was a duplicate of `VertexFeatures.supportsMetaProperties`.
  * The Spark persistence `StorageLevel` can now be set for both job graphs and `PersistedOutputRDD` data.
  * Added to the list of "invalid binding keys" allowed by Gremlin Server to cover the private fields of `T` which get exposed in the `ScriptEngine` on static imports.
  * Added `BulkDumperVertex` that allows to dump a whole graph in any of the supported IO formats (GraphSON, Gryo, Script).

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/406c0f74/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
----------------------------------------------------------------------