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 2017/07/11 12:45:10 UTC

[01/50] [abbrv] tinkerpop git commit: fixed old, dead codehaus links. removed dead repo. CTR [Forced Update!]

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1686 df914d02f -> dee27e337 (forced update)


fixed old, dead codehaus links. removed dead repo. CTR


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

Branch: refs/heads/TINKERPOP-1686
Commit: 84608546582f8bd09468959f3e5dc44134b4ad6d
Parents: e7f5ef7
Author: Robert Dale <ro...@gmail.com>
Authored: Tue Jul 4 08:45:19 2017 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Tue Jul 4 08:45:19 2017 -0400

----------------------------------------------------------------------
 docker/resources/groovy/grapeConfig.xml                      | 1 -
 docs/src/reference/gremlin-applications.asciidoc             | 8 ++++----
 docs/src/reference/intro.asciidoc                            | 2 +-
 .../groovy/plugin/UtilitiesGremlinPluginScript.groovy        | 4 ++--
 4 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/84608546/docker/resources/groovy/grapeConfig.xml
----------------------------------------------------------------------
diff --git a/docker/resources/groovy/grapeConfig.xml b/docker/resources/groovy/grapeConfig.xml
index 1cdfeb4..ba20af8 100644
--- a/docker/resources/groovy/grapeConfig.xml
+++ b/docker/resources/groovy/grapeConfig.xml
@@ -6,7 +6,6 @@
         <ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
         <artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
       </filesystem>
-      <ibiblio name="codehaus" root="http://repository.codehaus.org/" m2compatible="true"/>
       <ibiblio name="central" root="http://central.maven.org/maven2/" m2compatible="true"/>
       <ibiblio name="java.net2" root="http://download.java.net/maven/2/" m2compatible="true"/>
       <ibiblio name="hyracs-releases" root="http://obelix.ics.uci.edu/nexus/content/groups/hyracks-public-releases/" m2compatible="true"/>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/84608546/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index a5c162e..af9ae48 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -31,12 +31,12 @@ Console and Server, where a universal plugin system makes it possible to extend
 important aspects of the plugin system is the ability to help the user install the plugins through the command line
 thus automating the process of gathering dependencies and other error prone activities.
 
-The process of plugin installation is handled by link:http://groovy.codehaus.org/Grape[Grape], which helps resolve
+The process of plugin installation is handled by link:http://www.groovy-lang.org/Grape[Grape], which helps resolve
 dependencies into the classpath.  It is therefore important to ensure that Grape is properly configured in order to
 use the automated capabilities of plugin installation.  Grape is configured by `~/.groovy/grapeConfig.xml` and
 generally speaking, if that file is not present, the default settings will suffice.  However, they will not suffice
 if a required dependency is not in one of the default configured repositories. Please see the
-link:http://groovy.codehaus.org/Grape[Custom Ivy Settings] section of the Grape documentation for more details on
+link:http://www.groovy-lang.org/Grape[Custom Ivy Settings] section of the Grape documentation for more details on
 the defaults.  TinkerPop recommends the following configuration in that file:
 
 [source,xml]
@@ -102,7 +102,7 @@ more information on the `:plugin use` command to manually enable plugins. These
 These plugins can only be deactivated.
 
 The Gremlin Console is loaded and ready for commands. Recall that the console hosts the Gremlin-Groovy language.
-Please review link:http://groovy.codehaus.org/[Groovy] for help on Groovy-related constructs. In short, Groovy is a
+Please review link:http://www.groovy-lang.org/[Groovy] for help on Groovy-related constructs. In short, Groovy is a
 superset of Java. What works in Java, works in Groovy. However, Groovy provides many shorthands to make it easier
 to interact with the Java API.  Moreoever, Gremlin provides many neat shorthands to make it easier to express paths
 through a property graph.
@@ -130,7 +130,7 @@ TIP: When using Gremlin-Groovy in a Groovy class file, add `static { GremlinLoad
 Console Commands
 ~~~~~~~~~~~~~~~~
 
-In addition to the standard commands of the link:http://groovy.codehaus.org/Groovy+Shell[Groovy Shell], Gremlin adds
+In addition to the standard commands of the link:http://www.groovy-lang.org/Groovy+Shell[Groovy Shell], Gremlin adds
 some other useful operations.  The following table outlines the most commonly used commands:
 
 [width="100%",cols="3,^2,10",options="header"]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/84608546/docs/src/reference/intro.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/intro.asciidoc b/docs/src/reference/intro.asciidoc
index e19742f..7daffc8 100644
--- a/docs/src/reference/intro.asciidoc
+++ b/docs/src/reference/intro.asciidoc
@@ -175,7 +175,7 @@ assert(IteratorUtils.count(graph.edges()) == 0)
 // tada!
 
 IMPORTANT: image:groovy-logo.png[width=175,float=left] Gremlin-Groovy leverages the
-link:http://groovy.codehaus.org/[Groovy 2.x language] to express Gremlin traversals. One of the major benefits of
+link:http://www.groovy-lang.org/[Groovy 2.x language] to express Gremlin traversals. One of the major benefits of
 Groovy is the inclusion of a runtime console that makes it easy for developers to practice with the Gremlin language
 and for production users to connect to their graph and execute traversals in an interactive manner. Moreover,
 Gremlin-Groovy provides various syntax simplifications.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/84608546/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/UtilitiesGremlinPluginScript.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/UtilitiesGremlinPluginScript.groovy b/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/UtilitiesGremlinPluginScript.groovy
index 5f5e3c6..bfa6690 100644
--- a/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/UtilitiesGremlinPluginScript.groovy
+++ b/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/UtilitiesGremlinPluginScript.groovy
@@ -34,7 +34,7 @@ describeGraph = { Class<? extends org.apache.tinkerpop.gremlin.structure.Graph>
     def testsOptedOut = optOuts != null && optOuts.size() > 0 ? optOuts.collect { "> " + it.test() + "#" + it.method() + "${lf}\t\"" + it.reason() + "\"" }.join(lf) : "> none";
 
     // not the use of {lf} here rather than triple quoted string is that groovy 2.4.0 seems to have trouble
-    // parsing that into groovysh - note the bug report here: https://jira.codehaus.org/browse/GROOVY-7290
+    // parsing that into groovysh - note the bug report here: https://issues.apache.org/jira/browse/GROOVY-7290
     return "${lf}" +
 "IMPLEMENTATION - ${c.getCanonicalName()} ${lf}" +
 "TINKERPOP TEST SUITE ${lf}" +
@@ -49,4 +49,4 @@ describeGraph = { Class<? extends org.apache.tinkerpop.gremlin.structure.Graph>
 "the implementation itself.  Compliant implementations will faithfully and ${lf}" +
 "honestly supply these Annotations to provide the most accurate depiction of ${lf}" +
 "their support."
-}
\ No newline at end of file
+}


[40/50] [abbrv] tinkerpop git commit: TINKERPOP-1698 Update the upgrade docs for gryo 3.0

Posted by sp...@apache.org.
TINKERPOP-1698 Update the upgrade docs for gryo 3.0


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

Branch: refs/heads/TINKERPOP-1686
Commit: 5554fea708ab72e4f9f1e290f5595f7ac82ffb0e
Parents: 207cc34
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jun 29 11:21:36 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 14:14:03 2017 -0400

----------------------------------------------------------------------
 docs/src/upgrade/release-3.3.x.asciidoc | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5554fea7/docs/src/upgrade/release-3.3.x.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.3.x.asciidoc b/docs/src/upgrade/release-3.3.x.asciidoc
index be37f91..e02bc6e 100644
--- a/docs/src/upgrade/release-3.3.x.asciidoc
+++ b/docs/src/upgrade/release-3.3.x.asciidoc
@@ -36,6 +36,7 @@ GraphSON 2.0
 ^^^^^^^^^^^^
 
 TODO - RE-READ THIS WHOLE SECTION - IT MIGHT BE A MESS WITH GRAPHSON 3.0 CHANGES COMING IN
+SHOULD PROBABLY FOLD THESE CHANGES DOWN INTO THE "Changes to IO" SECTION AND ONE SOLID SECTION
 
 Both TinkerGraph and Gremlin Server have been defaulted to work with GraphSON 2.0. For TinkerGraph this means that
 the following commands:
@@ -111,6 +112,15 @@ Changes to IO
 * GraphSON
 ** embedTypes is gone, use typeInfo setting. will default to no types for GraphSON 1.0 and partial types for graphson 2.0 TINKERPOP-1700
 
+Gryo 3.0
+++++++++
+
+Gryo 3.0 fixes a number of inconsistencies with Gryo 1.0 and hopefully marks a point where Gryo is better versioned
+over time. Gryo 3.0 is not compatible with Gryo 1.0 and is now the default version of Gryo exposed by TinkerPop in
+Gremlin Server and IO.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1698[TINKERPOP-1698]
+
 Graphite and Ganglia
 ^^^^^^^^^^^^^^^^^^^^
 


[39/50] [abbrv] tinkerpop git commit: TINKERPOP-1698 Cleaned up comments

Posted by sp...@apache.org.
TINKERPOP-1698 Cleaned up comments


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

Branch: refs/heads/TINKERPOP-1686
Commit: 207cc342abf5e1ca0c85328ceeafde07afa32498
Parents: 98b7ffa
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jun 29 11:14:10 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 14:14:03 2017 -0400

----------------------------------------------------------------------
 .../gremlin/structure/io/gryo/GryoSerializersV3d0.java   | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/207cc342/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
index 82fa178..8a57a06 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
@@ -78,8 +78,10 @@ public final class GryoSerializersV3d0 {
 
             // temporary try/catch perhaps? need this to get SparkSingleIterationStrategyTest to work. Trying to grab
             // the label of the adjacent vertex ends in error if there's a StarEdge in the ComputerGraph$ComputerEdge.
-            // maybe this gets fixed up when TINKERPOP-1592 is in play. hopefully this serializer will get better
-            // with that
+            // apparently this is how we handle things in DetachedElement. i'll write here in the comments what was
+            // written there:
+            //
+            // ghetto
             try {
                 output.writeString(edge.inVertex().label());
             } catch (Exception ex) {
@@ -88,10 +90,7 @@ public final class GryoSerializersV3d0 {
 
             kryo.writeClassAndObject(output, edge.outVertex().id());
 
-            // temporary try/catch perhaps? need this to get SparkSingleIterationStrategyTest to work. Trying to grab
-            // the label of the adjacent vertex ends in error if there's a StarEdge in the ComputerGraph$ComputerEdge.
-            // maybe this gets fixed up when TINKERPOP-1592 is in play. hopefully this serializer will get better
-            // with that
+            // same nonsense as above for a default label
             try {
                 output.writeString(edge.outVertex().label());
             } catch (Exception ex) {


[12/50] [abbrv] tinkerpop git commit: updated the docs with @dkuppitz recommended tweaks.

Posted by sp...@apache.org.
updated the docs with @dkuppitz recommended tweaks.


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

Branch: refs/heads/TINKERPOP-1686
Commit: f6290331b9a393b9ddf1828c5850092806c86168
Parents: 41c16fa
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jul 5 07:31:08 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jul 5 07:31:08 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f6290331/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 738255e..e7d9d25 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -2592,7 +2592,7 @@ g.V().has('name','marko').out('knows').fold().count(global) <4>
 
 <1> Marko knows 2 people.
 <2> A list of Marko's friends is created and thus, one object is counted (the single list).
-<3> A list of Marko's fiends is created and a `local`-count yields the number of objects in that list.
+<3> A list of Marko's friends is created and a `local`-count yields the number of objects in that list.
 <4> `count(global)` is the same as `count()` as the default behavior for most scoped steps is `global`.
 
 The steps that support scoping are:
@@ -2604,6 +2604,7 @@ The steps that support scoping are:
 * <<min-step, `min()`>>: get the min value in the local collection or global stream.
 * <<order-step,`order()`>>: order the objects in the local collection or global stream.
 * <<range-step, `range()`>>: clip the local collection or global stream.
+* <<limit-step, `limit()`>>: clip the local collection or global stream.
 * <<sample-step, `sample()`>>: sample objects from the local collection or global stream.
 * <<tail-step, `tail()`>>: get the tail of the objects in the local collection or global stream.
 


[16/50] [abbrv] tinkerpop git commit: Merge branch 'tp32'

Posted by sp...@apache.org.
Merge branch 'tp32'


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

Branch: refs/heads/TINKERPOP-1686
Commit: c0d375cba9c21d6ddcc4a8073738e0ad6e87a2ef
Parents: e4bf027 77d6dfd
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jul 5 08:54:50 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jul 5 08:54:50 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 53 ++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c0d375cb/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------


[19/50] [abbrv] tinkerpop git commit: Fixed Gephi plugin now that TraversalSource.Builder is gone

Posted by sp...@apache.org.
Fixed Gephi plugin now that TraversalSource.Builder is gone

I guess no one ran tests when #650 was voted/merged and this change was missed. shame shame CTR


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

Branch: refs/heads/TINKERPOP-1686
Commit: b4b78de5366adbc801965b8f1640b0f7b578ca1b
Parents: 0d532aa
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jul 6 07:18:24 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Jul 6 07:20:21 2017 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/console/jsr223/GephiRemoteAcceptor.groovy    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b4b78de5/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/jsr223/GephiRemoteAcceptor.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/jsr223/GephiRemoteAcceptor.groovy b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/jsr223/GephiRemoteAcceptor.groovy
index 28cd85f..b5f6ec3 100644
--- a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/jsr223/GephiRemoteAcceptor.groovy
+++ b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/jsr223/GephiRemoteAcceptor.groovy
@@ -133,7 +133,7 @@ class GephiRemoteAcceptor implements RemoteAcceptor {
                 throw new RemoteException("Invalid argument to 'visualTraversal' - first parameter must be a Graph instance")
 
             def gVar = args.size() == 3 ? args[2] : "vg"
-            def theG = GraphTraversalSource.build().with(new GephiTraversalVisualizationStrategy(this)).create(graphVar)
+            def theG = graphVar.traversal().withStrategies(new GephiTraversalVisualizationStrategy(this))
             shell.setVariable(gVar, theG)
         } else
             throw new RemoteException("Invalid config arguments - check syntax")


[17/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1603'

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

Conflicts:
	CHANGELOG.asciidoc


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

Branch: refs/heads/TINKERPOP-1686
Commit: bcd186cd3d732d200fcb1ffececdc6a6159bc44a
Parents: c0d375c 8105faa
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jul 5 11:45:41 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Jul 5 11:45:41 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  9 +-
 .../src/reference/gremlin-applications.asciidoc |  3 +-
 docs/src/reference/the-graph.asciidoc           |  4 +-
 docs/src/upgrade/release-3.3.x.asciidoc         | 42 +++++++--
 .../tinkerpop/gremlin/console/Console.groovy    | 10 +--
 .../console/jsr223/DriverRemoteAcceptor.java    | 11 +--
 .../jsr223/DriverRemoteAcceptorTest.java        |  6 --
 .../structure/io/graphson/GraphSONMapper.java   | 41 ++-------
 .../io/graphson/LegacyGraphSONReader.java       |  2 +-
 .../GraphSONMapperEmbeddedTypeTest.java         |  2 +-
 .../io/graphson/GraphSONMapperTest.java         |  2 +-
 ...aphSONMapperV2d0PartialEmbeddedTypeTest.java |  4 +-
 .../tinkerpop/gremlin/driver/Cluster.java       | 21 -----
 .../tinkerpop/gremlin/driver/Connection.java    |  5 --
 .../tinkerpop/gremlin/driver/Settings.java      | 27 +-----
 .../apache/tinkerpop/gremlin/driver/Tokens.java | 92 --------------------
 .../AbstractGraphSONMessageSerializerV1d0.java  | 32 +------
 .../AbstractGraphSONMessageSerializerV2d0.java  | 31 +------
 .../ser/AbstractGryoMessageSerializerV1d0.java  | 29 +-----
 .../ser/AbstractGryoMessageSerializerV3d0.java  | 24 +----
 .../GraphSONMessageSerializerGremlinV1d0.java   |  3 +-
 .../ser/GraphSONMessageSerializerV1d0.java      |  3 +-
 .../tinkerpop/gremlin/driver/SettingsTest.java  |  2 -
 .../gremlin/server/AbstractChannelizer.java     |  3 -
 .../handler/SaslAuthenticationHandler.java      |  6 +-
 .../server/GremlinDriverIntegrateTest.java      |  1 -
 .../gremlin/structure/SerializationTest.java    |  9 +-
 .../gremlin/structure/io/IoCustomTest.java      |  4 +-
 .../gremlin/structure/io/IoEdgeTest.java        |  4 +-
 .../gremlin/structure/io/IoPropertyTest.java    |  4 +-
 .../tinkerpop/gremlin/structure/io/IoTest.java  |  4 +-
 .../gremlin/structure/io/IoVertexTest.java      |  4 +-
 .../structure/IoDataGenerationTest.java         | 10 +--
 .../tinkergraph/structure/TinkerGraphTest.java  |  3 +-
 34 files changed, 99 insertions(+), 358 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bcd186cd/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --cc CHANGELOG.asciidoc
index 6f47550,8c62c29..bfdd43d
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@@ -26,10 -26,7 +26,11 @@@ image::https://raw.githubusercontent.co
  TinkerPop 3.3.0 (Release Date: NOT OFFICIALLY RELEASED YET)
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
 +* Removed previously deprecated `TraversalSource.Builder` class.
 +* Removed previously deprecated `ConnectiveP`, `AndP`, `OrP` constructors.
 +* Removed previously deprecated `TraversalScriptFunction` class.
 +* Removed previously deprecated `TraversalScriptHelper` class.
+ * `gremlin.sh` and `gremln.bat` no longer support the option to pass a script as an argument for execution mode without using the `-i` option.
  * Graphite and Ganglia are no longer packaged with the Gremlin Server distribution.
  * `TransactionException` is no longer a class of `AbstractTransaction` and it extends `RuntimeException`.
  * Included an ellipse on long property names that are truncated.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bcd186cd/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bcd186cd/docs/src/upgrade/release-3.3.x.asciidoc
----------------------------------------------------------------------


[38/50] [abbrv] tinkerpop git commit: TINKERPOP-1698 Cleaned up docs with old serializer output in them

Posted by sp...@apache.org.
TINKERPOP-1698 Cleaned up docs with old serializer output in them


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

Branch: refs/heads/TINKERPOP-1686
Commit: 98b7ffa3fc18fb8def3f65afb160c97aa4d8f9a2
Parents: fdc15df
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jun 29 10:28:44 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 14:14:03 2017 -0400

----------------------------------------------------------------------
 .../src/reference/gremlin-applications.asciidoc | 21 +++++++++-------
 docs/src/reference/gremlin-variants.asciidoc    | 14 +++++------
 .../gremlin-language-variants/index.asciidoc    |  9 ++++---
 docs/src/upgrade/release-3.3.x.asciidoc         | 25 ++++++++------------
 4 files changed, 32 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/98b7ffa3/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 592afa8..38e6be6 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -415,21 +415,24 @@ $ bin/gremlin-server.sh conf/gremlin-server-modern.yaml
          (o o)
 -----oOOo-(3)-oOOo-----
 
-[INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-modern.yaml
+[INFO] GremlinServer - Configuring Gremlin Server from /home/smallette/git/apache/incubator-tinkerpop/gremlin-server/target/apache-tinkerpop-gremlin-server-3.3.0-SNAPSHOT-standalone/conf/gremlin-server.yaml
+[INFO] MetricManager - Configured Metrics ConsoleReporter configured with report interval=180000ms
+[INFO] MetricManager - Configured Metrics CsvReporter configured with report interval=180000ms to fileName=/tmp/gremlin-server-metrics.csv
+[INFO] MetricManager - Configured Metrics JmxReporter configured with domain= and agentId=
 [INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
-[INFO] GraphManager - Graph [graph] was successfully configured via [conf/tinkergraph-empty.properties].
+[INFO] DefaultGraphManager - Graph [graph] was successfully configured via [conf/tinkergraph-empty.properties].
 [INFO] ServerGremlinExecutor - Initialized Gremlin thread pool.  Threads in pool named with pattern gremlin-*
-[INFO] ServerGremlinExecutor - Initialized GremlinExecutor and configured ScriptEngines.
+[INFO] ServerGremlinExecutor - Initialized GremlinExecutor and preparing GremlinScriptEngines instances.
+[INFO] ServerGremlinExecutor - Initialized gremlin-groovy GremlinScriptEngine and registered metrics
 [INFO] ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
 [INFO] OpLoader - Adding the standard OpProcessor.
 [INFO] OpLoader - Adding the session OpProcessor.
 [INFO] OpLoader - Adding the traversal OpProcessor.
 [INFO] TraversalOpProcessor - Initialized cache for TraversalOpProcessor with size 1000 and expiration time of 600000 ms
 [INFO] GremlinServer - Executing start up LifeCycleHook
-[INFO] Logger$info - Loading 'modern' graph data.
-[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
-[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-lite with org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0
-[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
+[INFO] Logger$info - Executed once at startup of Gremlin Server.
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
 [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0
 [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v2.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0
 [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
@@ -741,7 +744,7 @@ The following table describes the various configuration options for the Gremlin
 |password |The password to submit on requests that require authentication. |_none_
 |port |The port of the Gremlin Server to connect to. The same port will be applied for all hosts. |8192
 |protocol |Sets the `AuthProperties.Property.PROTOCOL` properties for authentication to Gremlin Server. |_none_
-|serializer.className |The fully qualified class name of the `MessageSerializer` that will be used to communicate with the server. Note that the serializer configured on the client should be supported by the server configuration. |`GryoMessageSerializerV1d0`
+|serializer.className |The fully qualified class name of the `MessageSerializer` that will be used to communicate with the server. Note that the serializer configured on the client should be supported by the server configuration. |_none_
 |serializer.config |A `Map` of configuration settings for the serializer. |_none_
 |username |The username to submit on requests that require authentication. |_none_
 |workerPoolSize |Size of the pool for handling background work. |available processors * 2
@@ -785,7 +788,7 @@ This can be done manually as follows:
 
 [source,java]
 GryoMapper kryo = GryoMapper.build().addRegistry(TitanIoRegistry.INSTANCE).create();
-MessageSerializer serializer = new GryoMessageSerializerV1d0(kryo);
+MessageSerializer serializer = new GryoMessageSerializerV3d0(kryo);
 Cluster cluster = Cluster.build()
                 .serializer(serializer)
                 .create();

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/98b7ffa3/docs/src/reference/gremlin-variants.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc
index 86358ef..2f4e3f5 100644
--- a/docs/src/reference/gremlin-variants.asciidoc
+++ b/docs/src/reference/gremlin-variants.asciidoc
@@ -144,21 +144,19 @@ $ bin/gremlin-server.sh conf/gremlin-server-modern-py.yaml
 [INFO] ServerGremlinExecutor - Initialized GremlinExecutor and configured ScriptEngines.
 [INFO] ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
 [INFO] OpLoader - Adding the standard OpProcessor.
-[INFO] OpLoader - Adding the control OpProcessor.
 [INFO] OpLoader - Adding the session OpProcessor.
 [INFO] OpLoader - Adding the traversal OpProcessor.
 [INFO] TraversalOpProcessor - Initialized cache for TraversalOpProcessor with size 1000 and expiration time of 600000 ms
 [INFO] GremlinServer - Executing start up LifeCycleHook
-[INFO] Logger$info - Loading 'modern' graph data.
-[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
-[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-lite with org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0
-[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
+[INFO] Logger$info - Executed once at startup of Gremlin Server.
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
 [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0
 [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v2.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0
-[INFO] AbstractChannelizer - Configured application/json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0
-[INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 8 and boss thread pool of 1.
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
+[INFO] AbstractChannelizer - Configured application/json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
+[INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 4 and boss thread pool of 1.
 [INFO] GremlinServer$1 - Channel started at port 8182.
-
 ----
 
 NOTE: The command to use `install` need only be executed once to gather `gremlin-python` dependencies into Gremlin Servers'

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/98b7ffa3/docs/src/tutorials/gremlin-language-variants/index.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/tutorials/gremlin-language-variants/index.asciidoc b/docs/src/tutorials/gremlin-language-variants/index.asciidoc
index 2c54ee9..5c4c99a 100644
--- a/docs/src/tutorials/gremlin-language-variants/index.asciidoc
+++ b/docs/src/tutorials/gremlin-language-variants/index.asciidoc
@@ -539,15 +539,14 @@ $ bin/gremlin-server.sh conf/gremlin-server-modern-py.yaml
 [INFO] OpLoader - Adding the traversal OpProcessor.
 [INFO] TraversalOpProcessor - Initialized cache for TraversalOpProcessor with size 1000 and expiration time of 600000 ms
 [INFO] GremlinServer - Executing start up LifeCycleHook
-[INFO] Logger$info - Loading 'modern' graph data.
-[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
-[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-lite with org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0
-[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
+[INFO] Logger$info - Executed once at startup of Gremlin Server.
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
 [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0
 [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v2.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0
 [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
 [INFO] AbstractChannelizer - Configured application/json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
-[INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 8 and boss thread pool of 1.
+[INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 4 and boss thread pool of 1.
 [INFO] GremlinServer$1 - Channel started at port 8182.
 ----
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/98b7ffa3/docs/src/upgrade/release-3.3.x.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.3.x.asciidoc b/docs/src/upgrade/release-3.3.x.asciidoc
index d729da8..be37f91 100644
--- a/docs/src/upgrade/release-3.3.x.asciidoc
+++ b/docs/src/upgrade/release-3.3.x.asciidoc
@@ -35,6 +35,8 @@ Upgrading for Users
 GraphSON 2.0
 ^^^^^^^^^^^^
 
+TODO - RE-READ THIS WHOLE SECTION - IT MIGHT BE A MESS WITH GRAPHSON 3.0 CHANGES COMING IN
+
 Both TinkerGraph and Gremlin Server have been defaulted to work with GraphSON 2.0. For TinkerGraph this means that
 the following commands:
 
@@ -65,32 +67,25 @@ try (InputStream stream = new FileInputStream("tinkerpop-modern.json")) {
 ----
 
 For Gremlin Server, this change means that the `application/json` mime type no longer returns GraphSON 1.0 without
-type embedding. Instead, Gremlin Server will return GraphSON 2.0 with partial types enabled (i.e. which is equivalent
-to `application/vnd.gremlin-v2.0+json`). The `serializers` section the sample Gremlin Server YAML files now typically
+type embedding. Instead, Gremlin Server will return GraphSON 3.0 with partial types enabled (i.e. which is equivalent
+to `application/vnd.gremlin-v3.0+json`). The `serializers` section the sample Gremlin Server YAML files now typically
 look like this:
 
 [source,yaml]
 ----
 serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }}             # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }}         # application/vnd.gremlin-v1.0+gryo-lite
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}         # application/vnd.gremlin-v1.0+gryo-stringd
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistry] }} # application/vnd.gremlin-v1.0+json
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { useMapperFromGraph: graph  }} # application/vnd.gremlin-v2.0+json
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0, config: { useMapperFromGraph: graph }}         # application/json
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}             # application/vnd.gremlin-v3.0+gryo
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}                                                                       # application/vnd.gremlin-v3.0+gryo-stringd
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}         # application/json
 ----
 
 It is possible to bring back the original configuration for `application/json` by changing the last entry as follows:
 
 [source,yaml]
 ----
-serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }}             # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }}         # application/vnd.gremlin-v1.0+gryo-lite
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}         # application/vnd.gremlin-v1.0+gryo-stringd
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistry] }} # application/vnd.gremlin-v1.0+json
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { useMapperFromGraph: graph  }} # application/vnd.gremlin-v2.0+json
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { useMapperFromGraph: graph }}         # application/json
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}             # application/vnd.gremlin-v3.0+gryo
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}                                                                       # application/vnd.gremlin-v3.0+gryo-stringd
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0]  }}        # application/json
 ----
 
 See: link:https://issues.apache.org/jira/browse/TINKERPOP-1414[TINKERPOP-1414]


[47/50] [abbrv] tinkerpop git commit: TINKERPOP-1686 Made MutableMetrics thread-safe for nested results and counts

Posted by sp...@apache.org.
TINKERPOP-1686 Made MutableMetrics thread-safe for nested results and counts


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

Branch: refs/heads/TINKERPOP-1686
Commit: d136455b83955a81440d97b5fa26bd5d60f23f4b
Parents: c536435
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jun 28 07:55:51 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 11 08:04:55 2017 -0400

----------------------------------------------------------------------
 .../gremlin/process/traversal/util/ImmutableMetrics.java     | 8 ++++++--
 .../gremlin/process/traversal/util/MutableMetrics.java       | 5 ++++-
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d136455b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/ImmutableMetrics.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/ImmutableMetrics.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/ImmutableMetrics.java
index a563bbd..d2b1430 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/ImmutableMetrics.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/ImmutableMetrics.java
@@ -23,11 +23,15 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 
 /**
+ * A {@link Metrics} implementation that cannot be modified.
+ *
  * @author Bob Briody (http://bobbriody.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class ImmutableMetrics implements Metrics, Serializable {
 
@@ -35,9 +39,9 @@ public class ImmutableMetrics implements Metrics, Serializable {
 
     protected String id;
     protected String name;
-    protected Map<String, AtomicLong> counts = new HashMap<>();
+    protected Map<String, AtomicLong> counts = new ConcurrentHashMap<>();
     protected long durationNs = 0l;
-    protected final Map<String, Object> annotations = new HashMap<>();
+    protected final Map<String, Object> annotations = new ConcurrentHashMap<>();
     protected final Map<String, ImmutableMetrics> nested = new LinkedHashMap<>();
 
     protected ImmutableMetrics() {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d136455b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/MutableMetrics.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/MutableMetrics.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/MutableMetrics.java
index 34fa370..b3ee5f0 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/MutableMetrics.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/MutableMetrics.java
@@ -27,7 +27,10 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 
 /**
+ * A {@link Metrics} implementation that can be modified.
+ *
  * @author Bob Briody (http://bobbriody.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class MutableMetrics extends ImmutableMetrics implements Cloneable {
 
@@ -61,7 +64,7 @@ public class MutableMetrics extends ImmutableMetrics implements Cloneable {
         other.getNested().forEach(nested -> this.addNested(new MutableMetrics(nested)));
     }
 
-    public void addNested(final MutableMetrics metrics) {
+    public synchronized void addNested(final MutableMetrics metrics) {
         if (finalized) throw new IllegalStateException("Metrics have been finalized and cannot be modified");
         this.nested.put(metrics.getId(), metrics);
     }


[33/50] [abbrv] tinkerpop git commit: TINKERPOP-1698 Fixed up a bunch of tests with Gryo V3

Posted by sp...@apache.org.
TINKERPOP-1698 Fixed up a bunch of tests with Gryo V3

Basically had to default everything to work on V3. Might need to change up some tests to validate V1 specifically still.


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

Branch: refs/heads/TINKERPOP-1686
Commit: cfcdd26edfb44cc2ac4bd56b51d1b367fdd27440
Parents: dc9a87b
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 26 09:03:13 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 14:14:02 2017 -0400

----------------------------------------------------------------------
 .../src/test/resources/gremlin-server.yaml      |   1 +
 .../io/gryo/GryoClassResolverV1d0.java          |   2 +-
 .../io/gryo/GryoClassResolverV3d0.java          |   2 +-
 .../gremlin/structure/io/gryo/GryoMapper.java   |   2 +-
 .../gremlin/structure/io/gryo/GryoPool.java     |   2 +-
 .../structure/io/gryo/GryoSerializersV3d0.java  |  32 +-
 .../gremlin/structure/io/gryo/GryoVersion.java  |  10 +-
 .../structure/io/gryo/GryoMapperTest.java       |  49 +-
 .../tinkerpop/gremlin/driver/Cluster.java       |   2 +-
 .../tinkerpop/gremlin/driver/Settings.java      |   4 +-
 .../gremlin/driver/ser/Serializers.java         |   3 +
 .../gremlin/driver/simple/NioClient.java        |   4 +-
 .../gremlin/driver/simple/WebSocketClient.java  |   5 +-
 .../ser/GryoBaseMessageSerializerTest.java      | 617 +++++++++++++++++++
 .../ser/GryoBaseMessageSerializerV1d0Test.java  | 613 ------------------
 .../server/GremlinDriverIntegrateTest.java      |   4 +-
 .../server/GremlinResultSetIntegrateTest.java   |   8 +-
 .../remote/gremlin-server-integration.yaml      |   1 +
 .../server/gremlin-server-integration.yaml      |   1 +
 .../gremlin/structure/SerializationTest.java    |   3 +-
 .../gremlin/structure/io/IoCustomTest.java      |  10 +-
 .../io/gryo/GryoCompatibilityTest.java          |   4 +-
 .../structure/io/gryo/GryoRegistrator.java      |   3 +-
 .../jsr223/TinkerGraphGremlinPlugin.java        |   2 +
 .../TinkerGraphGryoSerializerV2d0Test.java      |   2 +-
 .../TinkerGraphGryoSerializerV3d0Test.java      |  80 +++
 .../tinkergraph/structure/TinkerGraphTest.java  |   5 +-
 27 files changed, 795 insertions(+), 676 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
index ffe4d07..c0e4e3c 100644
--- a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
@@ -30,6 +30,7 @@ scriptEngines: {
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern.groovy]}}}}
 serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}       # application/vnd.gremlin-v1.0+gryo
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0], custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}   # application/vnd.gremlin-v1.0+gryo-stringd
 metrics: {
   slf4jReporter: {enabled: true, interval: 180000}}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV1d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV1d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV1d0.java
index 12a9bfb..82531b0 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV1d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV1d0.java
@@ -57,7 +57,7 @@ public class GryoClassResolverV1d0 extends AbstractGryoClassResolver {
             type = Edge.class;
         else if (!ReferenceVertexProperty.class.isAssignableFrom(clazz) && !DetachedVertexProperty.class.isAssignableFrom(clazz) && VertexProperty.class.isAssignableFrom(clazz))
             type = VertexProperty.class;
-        else if (!ReferenceProperty.class.isAssignableFrom(clazz) && !DetachedProperty.class.isAssignableFrom(clazz) && !DetachedVertexProperty.class.isAssignableFrom(clazz) && Property.class.isAssignableFrom(clazz))
+        else if (!ReferenceProperty.class.isAssignableFrom(clazz) && !DetachedProperty.class.isAssignableFrom(clazz) && !DetachedVertexProperty.class.isAssignableFrom(clazz) && !ReferenceVertexProperty.class.isAssignableFrom(clazz) && Property.class.isAssignableFrom(clazz))
             type = Property.class;
         else if (!ReferencePath.class.isAssignableFrom(clazz) && !DetachedPath.class.isAssignableFrom(clazz) && Path.class.isAssignableFrom(clazz))
             type = Path.class;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV3d0.java
index 9b0f726..99a7c4a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV3d0.java
@@ -59,7 +59,7 @@ public class GryoClassResolverV3d0 extends AbstractGryoClassResolver {
             type = Edge.class;
         else if (!ReferenceVertexProperty.class.isAssignableFrom(clazz) && !DetachedVertexProperty.class.isAssignableFrom(clazz) && VertexProperty.class.isAssignableFrom(clazz))
             type = VertexProperty.class;
-        else if (!ReferenceProperty.class.isAssignableFrom(clazz) && !DetachedProperty.class.isAssignableFrom(clazz) && !DetachedVertexProperty.class.isAssignableFrom(clazz) && Property.class.isAssignableFrom(clazz))
+        else if (!ReferenceProperty.class.isAssignableFrom(clazz) && !DetachedProperty.class.isAssignableFrom(clazz) && !DetachedVertexProperty.class.isAssignableFrom(clazz) && !ReferenceVertexProperty.class.isAssignableFrom(clazz) && Property.class.isAssignableFrom(clazz))
             type = Property.class;
         else if (!ReferencePath.class.isAssignableFrom(clazz) && !DetachedPath.class.isAssignableFrom(clazz) && Path.class.isAssignableFrom(clazz))
             type = Path.class;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/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 2db34b4..ca4764d 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
@@ -138,7 +138,7 @@ public final class GryoMapper implements Mapper<Kryo> {
      */
     public static class Builder implements Mapper.Builder<Builder> {
 
-        private GryoVersion version = GryoVersion.V1_0;
+        private GryoVersion version = GryoVersion.V3_0;
 
         /**
          * Note that the following are pre-registered boolean, Boolean, byte, Byte, char, Character, double, Double,

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java
index 4e3ab13..485ac98 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java
@@ -207,7 +207,7 @@ public final class GryoPool {
          * @return the new pool
          */
         public GryoPool create() {
-            final GryoMapper.Builder mapper = GryoMapper.build();
+            final GryoMapper.Builder mapper = GryoMapper.build().version(GryoVersion.V1_0);
             final GryoPool gryoPool = new GryoPool();
             if (null != this.ioRegistries)
                 this.ioRegistries.forEach(mapper::addRegistry);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
index 580bc86..fe53ce5 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
@@ -127,12 +127,16 @@ public final class GryoSerializersV3d0 {
                 output.writeString(vp.label());
                 kryo.writeClassAndObject(output, vp.value());
 
-                final List<Property> metaProperties = IteratorUtils.asList(vp.properties());
-                output.writeInt(metaProperties.size());
-                metaProperties.forEach(p -> {
-                    output.writeString(p.key());
-                    kryo.writeClassAndObject(output, p.value());
-                });
+                if (vp instanceof DetachedVertexProperty || (vertex.graph().features().vertex().supportsMetaProperties())) {
+                    final List<Property> metaProperties = IteratorUtils.asList(vp.properties());
+                    output.writeInt(metaProperties.size());
+                    metaProperties.forEach(p -> {
+                        output.writeString(p.key());
+                        kryo.writeClassAndObject(output, p.value());
+                    });
+                } else {
+                    output.writeInt(0);
+                }
             });
         }
 
@@ -192,12 +196,16 @@ public final class GryoSerializersV3d0 {
             kryo.writeClassAndObject(output, vertexProperty.element().id());
             output.writeString(vertexProperty.element().label());
 
-            final List<Property> metaProperties = IteratorUtils.asList(vertexProperty.properties());
-            output.writeInt(metaProperties.size());
-            metaProperties.forEach(p -> {
-                output.writeString(p.key());
-                kryo.writeClassAndObject(output, p.value());
-            });
+            if (vertexProperty instanceof DetachedVertexProperty || (vertexProperty.graph().features().vertex().supportsMetaProperties())) {
+                final List<Property> metaProperties = IteratorUtils.asList(vertexProperty.properties());
+                output.writeInt(metaProperties.size());
+                metaProperties.forEach(p -> {
+                    output.writeString(p.key());
+                    kryo.writeClassAndObject(output, p.value());
+                });
+            } else {
+                output.writeInt(0);
+            }
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
index e06f5b3..aca1638 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
@@ -268,11 +268,11 @@ public enum GryoVersion {
             add(GryoTypeReg.of(InetAddress.class, 162, new UtilSerializers.InetAddressSerializer()));
             add(GryoTypeReg.of(ByteBuffer.class, 163, new UtilSerializers.ByteBufferSerializer()));
 
-//            add(GryoTypeReg.of(ReferenceEdge.class, 81));
-//            add(GryoTypeReg.of(ReferenceVertexProperty.class, 82));
-//            add(GryoTypeReg.of(ReferenceProperty.class, 83));
-//            add(GryoTypeReg.of(ReferenceVertex.class, 84));
-//            add(GryoTypeReg.of(ReferencePath.class, 85));
+            add(GryoTypeReg.of(ReferenceEdge.class, 81));
+            add(GryoTypeReg.of(ReferenceVertexProperty.class, 82));
+            add(GryoTypeReg.of(ReferenceProperty.class, 83));
+            add(GryoTypeReg.of(ReferenceVertex.class, 84));
+            add(GryoTypeReg.of(ReferencePath.class, 85));
 
             add(GryoTypeReg.of(StarGraph.class, 86, new StarGraphSerializer(Direction.BOTH, new GraphFilter())));
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/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 12e99b3..fcb040a 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
@@ -35,6 +35,8 @@ import org.apache.tinkerpop.shaded.kryo.Serializer;
 import org.apache.tinkerpop.shaded.kryo.io.Input;
 import org.apache.tinkerpop.shaded.kryo.io.Output;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -75,10 +77,21 @@ import static org.junit.Assert.fail;
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
+@RunWith(Parameterized.class)
 public class GryoMapperTest {
 
-    private final GryoMapper sharedMapper = GryoMapper.build().create();
-    private final Kryo sharedKryo = sharedMapper.createMapper();
+    @Parameterized.Parameters
+    public static Iterable<Object[]> data() {
+        return Arrays.asList(new Object[][]{
+                {"1_0", (Supplier<GryoMapper.Builder>) () -> GryoMapper.build().version(GryoVersion.V1_0)},
+                {"3_0", (Supplier<GryoMapper.Builder>) () -> GryoMapper.build().version(GryoVersion.V3_0)}});
+    }
+
+    @Parameterized.Parameter
+    public String name;
+
+    @Parameterized.Parameter(value = 1)
+    public Supplier<GryoMapper.Builder> builder;
 
     @Test
     public void shouldMakeNewInstance() {
@@ -88,7 +101,7 @@ public class GryoMapperTest {
 
     @Test
     public void shouldSerializeDeserialize() throws Exception {
-        final GryoMapper mapper = GryoMapper.build().create();
+        final GryoMapper mapper = builder.get().create();
         final Kryo kryo = mapper.createMapper();
         try (final OutputStream stream = new ByteArrayOutputStream()) {
             final Output out = new Output(stream);
@@ -116,7 +129,7 @@ public class GryoMapperTest {
     @Test
     public void shouldSerializeWithCustomClassResolverToDetachedVertex() throws Exception {
         final Supplier<ClassResolver> classResolver = new CustomClassResolverSupplier();
-        final GryoMapper mapper = GryoMapper.build().classResolver(classResolver).create();
+        final GryoMapper mapper = builder.get().classResolver(classResolver).create();
         final Kryo kryo = mapper.createMapper();
         try (final OutputStream stream = new ByteArrayOutputStream()) {
             final Output out = new Output(stream);
@@ -124,7 +137,7 @@ public class GryoMapperTest {
 
             kryo.writeClassAndObject(out, x);
 
-            final GryoMapper mapperWithoutKnowledgeOfIox = GryoMapper.build().create();
+            final GryoMapper mapperWithoutKnowledgeOfIox = builder.get().create();
             final Kryo kryoWithoutKnowledgeOfIox = mapperWithoutKnowledgeOfIox.createMapper();
             try (final InputStream inputStream = new ByteArrayInputStream(out.toBytes())) {
                 final Input input = new Input(inputStream);
@@ -137,7 +150,7 @@ public class GryoMapperTest {
     @Test
     public void shouldSerializeWithCustomClassResolverToHashMap() throws Exception {
         final Supplier<ClassResolver> classResolver = new CustomClassResolverSupplier();
-        final GryoMapper mapper = GryoMapper.build().classResolver(classResolver).create();
+        final GryoMapper mapper = builder.get().classResolver(classResolver).create();
         final Kryo kryo = mapper.createMapper();
         try (final OutputStream stream = new ByteArrayOutputStream()) {
             final Output out = new Output(stream);
@@ -145,7 +158,7 @@ public class GryoMapperTest {
 
             kryo.writeClassAndObject(out, y);
 
-            final GryoMapper mapperWithoutKnowledgeOfIoy = GryoMapper.build().create();
+            final GryoMapper mapperWithoutKnowledgeOfIoy = builder.get().create();
             final Kryo kryoWithoutKnowledgeOfIox = mapperWithoutKnowledgeOfIoy.createMapper();
             try (final InputStream inputStream = new ByteArrayInputStream(out.toBytes())) {
                 final Input input = new Input(inputStream);
@@ -157,7 +170,7 @@ public class GryoMapperTest {
 
     @Test
     public void shouldSerializeWithoutRegistration() throws Exception {
-        final GryoMapper mapper = GryoMapper.build().registrationRequired(false).create();
+        final GryoMapper mapper = builder.get().registrationRequired(false).create();
         final Kryo kryo = mapper.createMapper();
         try (final OutputStream stream = new ByteArrayOutputStream()) {
             final Output out = new Output(stream);
@@ -178,8 +191,7 @@ public class GryoMapperTest {
 
     @Test
     public void shouldRegisterMultipleIoRegistryToSerialize() throws Exception {
-        final GryoMapper mapper = GryoMapper.build()
-                .addRegistry(IoXIoRegistry.InstanceBased.instance())
+        final GryoMapper mapper = builder.get().addRegistry(IoXIoRegistry.InstanceBased.instance())
                 .addRegistry(IoYIoRegistry.InstanceBased.instance()).create();
         final Kryo kryo = mapper.createMapper();
         try (final OutputStream stream = new ByteArrayOutputStream()) {
@@ -201,8 +213,7 @@ public class GryoMapperTest {
 
     @Test
     public void shouldExpectReadFailureAsIoRegistryOrderIsNotRespected() throws Exception {
-        final GryoMapper mapperWrite = GryoMapper.build()
-                .addRegistry(IoXIoRegistry.InstanceBased.instance())
+        final GryoMapper mapperWrite = builder.get().addRegistry(IoXIoRegistry.InstanceBased.instance())
                 .addRegistry(IoYIoRegistry.InstanceBased.instance()).create();
 
         final GryoMapper mapperRead = GryoMapper.build()
@@ -232,8 +243,7 @@ public class GryoMapperTest {
 
     @Test
     public void shouldOverrideExistingSerializer() throws Exception {
-        final GryoMapper mapper = GryoMapper.build()
-                .addCustom(Duration.class, new OverrideDurationSerializer()).create();
+        final GryoMapper mapper = builder.get().addCustom(Duration.class, new OverrideDurationSerializer()).create();
 
         try (final OutputStream stream = new ByteArrayOutputStream()) {
             final Output out = new Output(stream);
@@ -368,14 +378,15 @@ public class GryoMapperTest {
     }
 
     public <T> T serializeDeserialize(final Object o, final Class<T> clazz) throws Exception {
+        final Kryo kryo = builder.get().create().createMapper();
         try (final ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
             final Output out = new Output(stream);
-            sharedKryo.writeObject(out, o);
+            kryo.writeObject(out, o);
             out.flush();
 
             try (final InputStream inputStream = new ByteArrayInputStream(stream.toByteArray())) {
                 final Input input = new Input(inputStream);
-                return sharedKryo.readObject(input, clazz);
+                return kryo.readObject(input, clazz);
             }
         }
     }
@@ -383,7 +394,7 @@ public class GryoMapperTest {
     /**
      * Creates new {@link CustomClassResolver} when requested.
      */
-    public static class CustomClassResolverSupplier implements Supplier<ClassResolver> {
+    private static class CustomClassResolverSupplier implements Supplier<ClassResolver> {
         @Override
         public ClassResolver get() {
             return new CustomClassResolver();
@@ -397,7 +408,7 @@ public class GryoMapperTest {
      * TinkerPop which then removes the requirement for providers to expose serializers on the client side for user
      * consumption.
      */
-    public static class CustomClassResolver extends GryoClassResolverV1d0 {
+    private static class CustomClassResolver extends GryoClassResolverV1d0 {
         private IoXIoRegistry.IoXToVertexSerializer ioXToVertexSerializer = new IoXIoRegistry.IoXToVertexSerializer();
         private IoYIoRegistry.IoYToHashMapSerializer ioYToHashMapSerializer = new IoYIoRegistry.IoYToHashMapSerializer();
 
@@ -414,7 +425,7 @@ public class GryoMapperTest {
         }
     }
 
-    final static class OverrideDurationSerializer extends Serializer<Duration>
+    private final static class OverrideDurationSerializer extends Serializer<Duration>
     {
         @Override
         public void write(final Kryo kryo, final Output output, final Duration duration)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
index fa59b22..87b79ee 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
@@ -469,7 +469,7 @@ public final class Cluster {
     public final static class Builder {
         private List<InetAddress> addresses = new ArrayList<>();
         private int port = 8182;
-        private MessageSerializer serializer = Serializers.GRYO_V1D0.simpleInstance();
+        private MessageSerializer serializer = Serializers.GRYO_V3D0.simpleInstance();
         private int nioPoolSize = Runtime.getRuntime().availableProcessors();
         private int workerPoolSize = Runtime.getRuntime().availableProcessors() * 2;
         private int minConnectionPoolSize = ConnectionPool.MIN_POOL_SIZE;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
index 03374cc..f3fb430 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
@@ -18,8 +18,8 @@
  */
 package org.apache.tinkerpop.gremlin.driver;
 
-import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
 import org.apache.commons.configuration.Configuration;
+import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.yaml.snakeyaml.TypeDescription;
 import org.yaml.snakeyaml.Yaml;
@@ -324,7 +324,7 @@ final class Settings {
          * The fully qualified class name of the {@link MessageSerializer} that will be used to communicate with the
          * server. Note that the serializer configured on the client should be supported by the server configuration.
          */
-        public String className = GryoMessageSerializerV1d0.class.getCanonicalName();
+        public String className = GryoMessageSerializerV3d0.class.getCanonicalName();
 
         /**
          * The configuration for the specified serializer with the {@link #className}.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/Serializers.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/Serializers.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/Serializers.java
index 69e8287..e64fc8b 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/Serializers.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/Serializers.java
@@ -34,6 +34,7 @@ public enum Serializers {
     GRAPHSON_V2D0(SerTokens.MIME_GRAPHSON_V2D0),
     GRAPHSON_V3D0(SerTokens.MIME_GRAPHSON_V3D0),
     GRYO_V1D0(SerTokens.MIME_GRYO_V1D0),
+    GRYO_V3D0(SerTokens.MIME_GRYO_V3D0),
     GRYO_LITE_V1D0(SerTokens.MIME_GRYO_LITE_V1D0);
 
     private String value;
@@ -72,6 +73,8 @@ public enum Serializers {
                 return new GraphSONMessageSerializerV3d0();
             case SerTokens.MIME_GRYO_V1D0:
                 return new GryoMessageSerializerV1d0();
+            case SerTokens.MIME_GRYO_V3D0:
+                return new GryoMessageSerializerV3d0();
             case SerTokens.MIME_GRYO_LITE_V1D0:
                 return new GryoLiteMessageSerializerV1d0();
             default:

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/simple/NioClient.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/simple/NioClient.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/simple/NioClient.java
index a135761..cda5043 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/simple/NioClient.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/simple/NioClient.java
@@ -24,13 +24,13 @@ import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
 import org.apache.tinkerpop.gremlin.driver.handler.NioGremlinRequestEncoder;
 import org.apache.tinkerpop.gremlin.driver.handler.NioGremlinResponseDecoder;
 import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
-import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
 import io.netty.bootstrap.Bootstrap;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelInitializer;
 import io.netty.channel.ChannelPipeline;
 import io.netty.channel.socket.SocketChannel;
 import io.netty.channel.socket.nio.NioSocketChannel;
+import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0;
 
 import java.io.IOException;
 import java.net.URI;
@@ -53,7 +53,7 @@ public class NioClient extends AbstractClient {
         b.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
 
         try {
-            final MessageSerializer serializer = new GryoMessageSerializerV1d0();
+            final MessageSerializer serializer = new GryoMessageSerializerV3d0();
             b.channel(NioSocketChannel.class)
                     .handler(new ChannelInitializer<SocketChannel>() {
                         @Override

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/simple/WebSocketClient.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/simple/WebSocketClient.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/simple/WebSocketClient.java
index 0148ac9..cc7dd8f 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/simple/WebSocketClient.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/simple/WebSocketClient.java
@@ -26,18 +26,17 @@ import org.apache.tinkerpop.gremlin.driver.handler.WebSocketClientHandler;
 import org.apache.tinkerpop.gremlin.driver.handler.WebSocketGremlinRequestEncoder;
 import org.apache.tinkerpop.gremlin.driver.handler.WebSocketGremlinResponseDecoder;
 import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
-import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
 import io.netty.bootstrap.Bootstrap;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelInitializer;
 import io.netty.channel.ChannelPipeline;
 import io.netty.channel.socket.SocketChannel;
 import io.netty.channel.socket.nio.NioSocketChannel;
-import io.netty.handler.codec.http.DefaultHttpHeaders;
 import io.netty.handler.codec.http.HttpClientCodec;
 import io.netty.handler.codec.http.HttpObjectAggregator;
 import io.netty.handler.codec.http.websocketx.WebSocketClientHandshakerFactory;
 import io.netty.handler.codec.http.websocketx.WebSocketVersion;
+import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0;
 
 import java.io.IOException;
 import java.net.URI;
@@ -69,7 +68,7 @@ public class WebSocketClient extends AbstractClient {
                     new WebSocketClientHandler(
                             WebSocketClientHandshakerFactory.newHandshaker(
                                     uri, WebSocketVersion.V13, null, false, HttpHeaders.EMPTY_HEADERS, 65536));
-            final MessageSerializer serializer = new GryoMessageSerializerV1d0();
+            final MessageSerializer serializer = new GryoMessageSerializerV3d0();
             b.channel(NioSocketChannel.class)
                     .handler(new ChannelInitializer<SocketChannel>() {
                         @Override

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerTest.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerTest.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerTest.java
new file mode 100644
index 0000000..fff95dd
--- /dev/null
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerTest.java
@@ -0,0 +1,617 @@
+/*
+ * 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.driver.ser;
+
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.ByteBufAllocator;
+import io.netty.buffer.UnpooledByteBufAllocator;
+import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
+import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
+import org.apache.tinkerpop.gremlin.driver.message.ResponseMessage;
+import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.io.AbstractIoRegistry;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoClassResolverV1d0;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.apache.tinkerpop.shaded.kryo.ClassResolver;
+import org.apache.tinkerpop.shaded.kryo.Kryo;
+import org.apache.tinkerpop.shaded.kryo.KryoException;
+import org.apache.tinkerpop.shaded.kryo.Registration;
+import org.apache.tinkerpop.shaded.kryo.Serializer;
+import org.apache.tinkerpop.shaded.kryo.io.Input;
+import org.apache.tinkerpop.shaded.kryo.io.Output;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+import java.util.function.Supplier;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+@RunWith(Parameterized.class)
+public class GryoBaseMessageSerializerTest {
+    @Parameterized.Parameters(name = "expect({0})")
+    public static Iterable<Object[]> data() {
+        final GryoMessageSerializerV1d0 v1d0Text = new GryoMessageSerializerV1d0();
+        v1d0Text.configure(config, null);
+
+        final GryoMessageSerializerV1d0 v1d0LiteText = new GryoMessageSerializerV1d0();
+        v1d0LiteText.configure(config, null);
+
+        final GryoMessageSerializerV3d0 v3d0Text = new GryoMessageSerializerV3d0();
+        v3d0Text.configure(config, null);
+
+        return Arrays.asList(new Object[][]{
+                {"V1d0", new GryoMessageSerializerV1d0(), v1d0Text},
+                {"V1d0Lite", new GryoLiteMessageSerializerV1d0(), v1d0LiteText },
+                {"V3d0", new GryoMessageSerializerV3d0(), v3d0Text}});
+    }
+
+    @Parameterized.Parameter(value = 0)
+    public String name;
+
+    @Parameterized.Parameter(value = 1)
+    public MessageSerializer binarySerializer;
+
+    @Parameterized.Parameter(value = 2)
+    public MessageSerializer textSerializer;
+
+    private static final Map<String, Object> config = new HashMap<String, Object>() {{
+        put(GryoMessageSerializerV1d0.TOKEN_SERIALIZE_RESULT_TO_STRING, true);
+    }};
+
+    private UUID requestId = UUID.fromString("6457272A-4018-4538-B9AE-08DD5DDC0AA1");
+    private ResponseMessage.Builder responseMessageBuilder = ResponseMessage.build(requestId);
+    private static ByteBufAllocator allocator = UnpooledByteBufAllocator.DEFAULT;
+
+    @Test
+    public void shouldConfigureIoRegistry() throws Exception {
+        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
+        final Map<String, Object> config = new HashMap<String, Object>() {{
+            put(GryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES, Arrays.asList(ColorIoRegistry.class.getName()));
+        }};
+
+        serializer.configure(config, null);
+
+        final ResponseMessage toSerialize = ResponseMessage.build(requestId).result(Color.RED).create();
+        final ByteBuf bb = serializer.serializeResponseAsBinary(toSerialize, allocator);
+        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
+
+        assertCommon(deserialized);
+        assertEquals(Color.RED, deserialized.getResult().getData());
+    }
+
+    @Test
+    public void shouldConfigureIoRegistryInstance() throws Exception {
+        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
+        final Map<String, Object> config = new HashMap<String, Object>() {{
+            put(GryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES, Arrays.asList(ColorIoRegistryInstance.class.getName()));
+        }};
+
+        serializer.configure(config, null);
+
+        final ResponseMessage toSerialize = ResponseMessage.build(requestId).result(Color.RED).create();
+        final ByteBuf bb = serializer.serializeResponseAsBinary(toSerialize, allocator);
+        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
+
+        assertCommon(deserialized);
+        assertEquals(Color.RED, deserialized.getResult().getData());
+    }
+
+    @Test
+    public void shouldConfigureIoRegistryGetInstance() throws Exception {
+        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
+        final Map<String, Object> config = new HashMap<String, Object>() {{
+            put(GryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES, Arrays.asList(ColorIoRegistryGetInstance.class.getName()));
+        }};
+
+        serializer.configure(config, null);
+
+        final ResponseMessage toSerialize = ResponseMessage.build(requestId).result(Color.RED).create();
+        final ByteBuf bb = serializer.serializeResponseAsBinary(toSerialize, allocator);
+        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
+
+        assertCommon(deserialized);
+        assertEquals(Color.RED, deserialized.getResult().getData());
+    }
+
+    @Test
+    public void shouldConfigureCustomClassResolver() {
+        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
+        final Map<String, Object> config = new HashMap<String, Object>() {{
+            put(GryoMessageSerializerV1d0.TOKEN_CLASS_RESOLVER_SUPPLIER, ErrorOnlyClassResolverSupplier.class.getName());
+        }};
+
+        serializer.configure(config, null);
+
+        try {
+            serializer.serializeResponseAsBinary(responseMessageBuilder.create(), allocator);
+            fail("Should fail because the ClassResolver used here always generates an error");
+        } catch (Exception ex) {
+            assertEquals("java.lang.RuntimeException: Registration is not allowed with this ClassResolver - it is not a good implementation", ex.getMessage());
+        }
+    }
+
+    @Test
+    public void shouldConfigureCustomClassResolverFromInstance() {
+        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
+        final Map<String, Object> config = new HashMap<String, Object>() {{
+            put(GryoMessageSerializerV1d0.TOKEN_CLASS_RESOLVER_SUPPLIER, ErrorOnlyClassResolverSupplierAsInstance.class.getName());
+        }};
+
+        serializer.configure(config, null);
+
+        try {
+            serializer.serializeResponseAsBinary(responseMessageBuilder.create(), allocator);
+            fail("Should fail because the ClassResolver used here always generates an error");
+        } catch (Exception ex) {
+            assertEquals("java.lang.RuntimeException: Registration is not allowed with this ClassResolver - it is not a good implementation", ex.getMessage());
+        }
+    }
+
+    @Test
+    public void shouldConfigureCustomClassResolverFromGetInstance() {
+        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
+        final Map<String, Object> config = new HashMap<String, Object>() {{
+            put(GryoMessageSerializerV1d0.TOKEN_CLASS_RESOLVER_SUPPLIER, ErrorOnlyClassResolverSupplierAsGetInstance.class.getName());
+        }};
+
+        serializer.configure(config, null);
+
+        try {
+            serializer.serializeResponseAsBinary(responseMessageBuilder.create(), allocator);
+            fail("Should fail because the ClassResolver used here always generates an error");
+        } catch (Exception ex) {
+            assertEquals("java.lang.RuntimeException: Registration is not allowed with this ClassResolver - it is not a good implementation", ex.getMessage());
+        }
+    }
+
+    @Test
+    public void shouldSerializeIterable() throws Exception {
+        final ArrayList<Integer> list = new ArrayList<>();
+        list.add(1);
+        list.add(100);
+
+        final ResponseMessage response = convertBinary(list);
+        assertCommon(response);
+
+        final java.util.List<Integer> deserializedFunList = (java.util.List<Integer>) response.getResult().getData();
+        assertEquals(2, deserializedFunList.size());
+        assertEquals(new Integer(1), deserializedFunList.get(0));
+        assertEquals(new Integer(100), deserializedFunList.get(1));
+    }
+
+    @Test
+    public void shouldSerializeIterableToString() throws Exception {
+        final ArrayList<Integer> list = new ArrayList<>();
+        list.add(1);
+        list.add(100);
+
+        final ResponseMessage response = convertText(list);
+        assertCommon(response);
+
+        final java.util.List deserializedFunList = (java.util.List) response.getResult().getData();
+        assertEquals(2, deserializedFunList.size());
+        assertEquals("1", deserializedFunList.get(0));
+        assertEquals("100", deserializedFunList.get(1));
+    }
+
+    @Test
+    public void shouldSerializeIterableToStringWithNull() throws Exception {
+        final ArrayList<Integer> list = new ArrayList<>();
+        list.add(1);
+        list.add(null);
+        list.add(100);
+
+        final ResponseMessage response = convertText(list);
+        assertCommon(response);
+
+        final java.util.List deserializedFunList = (java.util.List) response.getResult().getData();
+        assertEquals(3, deserializedFunList.size());
+        assertEquals("1", deserializedFunList.get(0).toString());
+        assertEquals("null", deserializedFunList.get(1).toString());
+        assertEquals("100", deserializedFunList.get(2).toString());
+    }
+
+    @Test
+    public void shouldSerializeIterableWithNull() throws Exception {
+        final ArrayList<Integer> list = new ArrayList<>();
+        list.add(1);
+        list.add(null);
+        list.add(100);
+
+        final ResponseMessage response = convertBinary(list);
+        assertCommon(response);
+
+        final java.util.List<Integer> deserializedFunList = (java.util.List<Integer>) response.getResult().getData();
+        assertEquals(3, deserializedFunList.size());
+        assertEquals(new Integer(1), deserializedFunList.get(0));
+        assertNull(deserializedFunList.get(1));
+        assertEquals(new Integer(100), deserializedFunList.get(2));
+    }
+
+    @Test
+    public void shouldSerializeMap() throws Exception {
+        final Map<String, Object> map = new HashMap<>();
+        final Map<String, String> innerMap = new HashMap<>();
+        innerMap.put("a", "b");
+
+        map.put("x", 1);
+        map.put("y", "some");
+        map.put("z", innerMap);
+
+        final ResponseMessage response = convertBinary(map);
+        assertCommon(response);
+
+        final Map<String, Object> deserializedMap = (Map<String, Object>) response.getResult().getData();
+        assertEquals(3, deserializedMap.size());
+        assertEquals(1, deserializedMap.get("x"));
+        assertEquals("some", deserializedMap.get("y"));
+
+        final Map<String, String> deserializedInnerMap = (Map<String, String>) deserializedMap.get("z");
+        assertEquals(1, deserializedInnerMap.size());
+        assertEquals("b", deserializedInnerMap.get("a"));
+    }
+
+    @Test
+    public void shouldSerializeMapEntry() throws Exception {
+        final Graph graph = TinkerGraph.open();
+        final Vertex v1 = graph.addVertex();
+        final Date d = new Date();
+
+        final Map<Object, Object> map = new HashMap<>();
+        map.put("x", 1);
+        map.put(v1, 100);
+        map.put(d, "test");
+
+        final ResponseMessage response = convertBinary(IteratorUtils.asList(map.entrySet()));
+        assertCommon(response);
+
+        final java.util.List<Map.Entry<Object, Object>> deserializedEntries = (java.util.List<Map.Entry<Object, Object>>) response.getResult().getData();
+        assertEquals(3, deserializedEntries.size());
+        deserializedEntries.forEach(e -> {
+            if (e.getKey().equals("x"))
+                assertEquals(1, e.getValue());
+            else if (e.getKey().equals(v1))
+                assertEquals(100, e.getValue());
+            else if (e.getKey().equals(d))
+                assertEquals("test", e.getValue());
+            else
+                fail("Map entries contains a key that is not part of what was serialized");
+        });
+    }
+
+    @Test
+    public void shouldSerializeTree() throws Exception {
+        final Graph g = TinkerFactory.createModern();
+        final Tree t = g.traversal().V().out().out().tree().by("name").next();
+
+        final ResponseMessage response = convertBinary(t);
+        assertCommon(response);
+
+        final Tree deserialized = (Tree) response.getResult().getData();
+        assertEquals(t, deserialized);
+
+        assertThat(deserialized.containsKey("marko"), is(true));
+        assertEquals(1, deserialized.size());
+
+        final Tree markoChildren = (Tree) deserialized.get("marko");
+        assertThat(markoChildren.containsKey("josh"), is(true));
+        assertEquals(1, markoChildren.size());
+
+        final Tree joshChildren = (Tree) markoChildren.get("josh");
+        assertThat(joshChildren.containsKey("lop"), is(true));
+        assertThat(joshChildren.containsKey("ripple"), is(true));
+        assertEquals(2, joshChildren.size());
+    }
+
+    @Test
+    public void shouldSerializeFullResponseMessage() throws Exception {
+        final UUID id = UUID.randomUUID();
+
+        final Map<String, Object> metaData = new HashMap<>();
+        metaData.put("test", "this");
+        metaData.put("one", 1);
+
+        final Map<String, Object> attributes = new HashMap<>();
+        attributes.put("test", "that");
+        attributes.put("two", 2);
+
+        final ResponseMessage response = ResponseMessage.build(id)
+                .responseMetaData(metaData)
+                .code(ResponseStatusCode.SUCCESS)
+                .result("some-result")
+                .statusAttributes(attributes)
+                .statusMessage("worked")
+                .create();
+
+        final ByteBuf bb = binarySerializer.serializeResponseAsBinary(response, allocator);
+        final ResponseMessage deserialized = binarySerializer.deserializeResponse(bb);
+
+        assertEquals(id, deserialized.getRequestId());
+        assertEquals("this", deserialized.getResult().getMeta().get("test"));
+        assertEquals(1, deserialized.getResult().getMeta().get("one"));
+        assertEquals("some-result", deserialized.getResult().getData());
+        assertEquals("that", deserialized.getStatus().getAttributes().get("test"));
+        assertEquals(2, deserialized.getStatus().getAttributes().get("two"));
+        assertEquals(ResponseStatusCode.SUCCESS.getValue(), deserialized.getStatus().getCode().getValue());
+        assertEquals("worked", deserialized.getStatus().getMessage());
+    }
+
+    @Test
+    public void shouldHaveTooSmallBufferToSerializeResponseMessage() throws Exception {
+        final UUID id = UUID.randomUUID();
+
+        final Map<String, Object> metaData = new HashMap<>();
+        metaData.put("test", "this");
+        metaData.put("one", 1);
+
+        final Map<String, Object> attributes = new HashMap<>();
+        attributes.put("test", "that");
+        attributes.put("two", 2);
+
+        final ResponseMessage response = ResponseMessage.build(id)
+                .responseMetaData(metaData)
+                .code(ResponseStatusCode.SUCCESS)
+                .result("some-result")
+                .statusAttributes(attributes)
+                .statusMessage("worked")
+                .create();
+
+        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
+        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
+            put("bufferSize", 1);
+        }};
+        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
+
+        try {
+            binarySerializerWithSmallBuffer.serializeResponseAsBinary(response, allocator);
+            fail("Should have a buffer size that is too small");
+        } catch (Exception ex) {
+            final Throwable root = ExceptionUtils.getRootCause(ex);
+            assertThat(root, instanceOf(KryoException.class));
+        }
+    }
+
+    @Test
+    public void shouldReturnAllBytesInResponse() throws Exception {
+        final UUID id = UUID.randomUUID();
+
+        final Map<String, Object> metaData = new HashMap<>();
+        metaData.put("test", "this");
+        metaData.put("one", 1);
+
+        final Map<String, Object> attributes = new HashMap<>();
+        attributes.put("test", "that");
+        attributes.put("two", 2);
+
+        final ResponseMessage response = ResponseMessage.build(id)
+                .responseMetaData(metaData)
+                .code(ResponseStatusCode.SUCCESS)
+                .result("some-result")
+                .statusAttributes(attributes)
+                .statusMessage("worked")
+                .create();
+
+        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
+        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
+            // set to bufferSize < total message size but still greater than any individual object requires
+            put("bufferSize", 50);
+        }};
+        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
+
+        final ByteBuf buf = binarySerializerWithSmallBuffer.serializeResponseAsBinary(response, allocator);
+        assertTrue(buf.isReadable());
+        assertEquals(82, buf.readableBytes());
+    }
+
+    @Test
+    public void shouldSerializeFullRequestMessage() throws Exception {
+        final UUID id = UUID.randomUUID();
+
+        final RequestMessage request = RequestMessage.build("try")
+                .overrideRequestId(id)
+                .processor("pro")
+                .addArg("test", "this")
+                .create();
+        final ByteBuf bb = binarySerializer.serializeRequestAsBinary(request, allocator);
+        final int mimeLen = bb.readByte();
+        bb.readBytes(new byte[mimeLen]);
+        final RequestMessage deserialized = binarySerializer.deserializeRequest(bb);
+
+        assertEquals(id, deserialized.getRequestId());
+        assertEquals("pro", deserialized.getProcessor());
+        assertEquals("try", deserialized.getOp());
+        assertEquals("this", deserialized.getArgs().get("test"));
+    }
+
+    @Test
+    public void shouldHaveTooSmallBufferToSerializeRequestMessage() throws Exception {
+        final UUID id = UUID.randomUUID();
+
+        final RequestMessage request = RequestMessage.build("try")
+                .overrideRequestId(id)
+                .processor("pro")
+                .addArg("test", "this")
+                .create();
+
+        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
+        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
+            put("bufferSize", 1);
+        }};
+        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
+
+        try {
+            binarySerializerWithSmallBuffer.serializeRequestAsBinary(request, allocator);
+            fail("Should have a buffer size that is too small");
+        } catch (Exception ex) {
+            final Throwable root = ExceptionUtils.getRootCause(ex);
+            assertThat(root, instanceOf(KryoException.class));
+        }
+    }
+
+    @Test
+    public void shouldReturnAllBytesInRequest() throws Exception {
+        final UUID id = UUID.randomUUID();
+
+        final RequestMessage request = RequestMessage.build("try")
+                .overrideRequestId(id)
+                .processor("pro")
+                .addArg("test", "this")
+                .create();
+
+        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
+        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
+            // set to bufferSize < total message size but still greater than any individual object requires
+            put("bufferSize", 50);
+        }};
+        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
+
+        ByteBuf buf = binarySerializerWithSmallBuffer.serializeRequestAsBinary(request, allocator);
+        assertTrue(buf.isReadable());
+        assertEquals(71, buf.readableBytes());
+    }
+
+    private void assertCommon(final ResponseMessage response) {
+        assertEquals(requestId, response.getRequestId());
+        assertEquals(ResponseStatusCode.SUCCESS, response.getStatus().getCode());
+    }
+
+    private ResponseMessage convertBinary(final Object toSerialize) throws SerializationException {
+        final ByteBuf bb = binarySerializer.serializeResponseAsBinary(responseMessageBuilder.result(toSerialize).create(), allocator);
+        return binarySerializer.deserializeResponse(bb);
+    }
+
+    private ResponseMessage convertText(final Object toSerialize) throws SerializationException {
+        final ByteBuf bb = textSerializer.serializeResponseAsBinary(responseMessageBuilder.result(toSerialize).create(), allocator);
+        return textSerializer.deserializeResponse(bb);
+    }
+
+    public static class ErrorOnlyClassResolverSupplierAsInstance implements Supplier<ClassResolver> {
+
+        private static final ErrorOnlyClassResolverSupplierAsInstance instance = new ErrorOnlyClassResolverSupplierAsInstance();
+
+        private ErrorOnlyClassResolverSupplierAsInstance() {}
+
+        public static ErrorOnlyClassResolverSupplierAsInstance instance() {
+            return instance;
+        }
+
+        @Override
+        public ClassResolver get() {
+            return new ErrorOnlyClassResolver();
+        }
+    }
+
+    public static class ErrorOnlyClassResolverSupplierAsGetInstance implements Supplier<ClassResolver> {
+
+        private static final ErrorOnlyClassResolverSupplierAsInstance instance = new ErrorOnlyClassResolverSupplierAsInstance();
+
+        private ErrorOnlyClassResolverSupplierAsGetInstance() {}
+
+        public static ErrorOnlyClassResolverSupplierAsInstance getInstance() {
+            return instance;
+        }
+
+        @Override
+        public ClassResolver get() {
+            return new ErrorOnlyClassResolver();
+        }
+    }
+
+    public static class ErrorOnlyClassResolverSupplier implements Supplier<ClassResolver> {
+        @Override
+        public ClassResolver get() {
+            return new ErrorOnlyClassResolver();
+        }
+    }
+
+    public static class ErrorOnlyClassResolver extends GryoClassResolverV1d0 {
+        @Override
+        public Registration getRegistration(Class clazz) {
+            throw new RuntimeException("Registration is not allowed with this ClassResolver - it is not a good implementation");
+        }
+    }
+
+    public static class ColorIoRegistry extends AbstractIoRegistry {
+        public ColorIoRegistry() {
+            register(GryoIo.class, Color.class, new ColorSerializer());
+        }
+    }
+
+    public static class ColorIoRegistryInstance extends AbstractIoRegistry {
+
+        private static final ColorIoRegistry instance = new ColorIoRegistry();
+
+        private ColorIoRegistryInstance() {
+            register(GryoIo.class, Color.class, new ColorSerializer());
+        }
+
+        public static ColorIoRegistry instance() {
+            return instance;
+        }
+    }
+
+    public static class ColorIoRegistryGetInstance extends AbstractIoRegistry {
+
+        private static final ColorIoRegistry instance = new ColorIoRegistry();
+
+        private ColorIoRegistryGetInstance() {
+            register(GryoIo.class, Color.class, new ColorSerializer());
+        }
+
+        public static ColorIoRegistry getInstance() {
+            return instance;
+        }
+    }
+
+    public static class ColorSerializer extends Serializer<Color> {
+        @Override
+        public void write(final Kryo kryo, final Output output, final Color color) {
+            output.write(color.equals(Color.RED) ? 1 : 0);
+        }
+
+        @Override
+        public Color read(final Kryo kryo, final Input input, final Class<Color> aClass) {
+            return input.read() == 1 ? Color.RED : Color.BLACK;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerV1d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerV1d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerV1d0Test.java
deleted file mode 100644
index 92627eb..0000000
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerV1d0Test.java
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.driver.ser;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.ByteBufAllocator;
-import io.netty.buffer.UnpooledByteBufAllocator;
-import org.apache.commons.lang.exception.ExceptionUtils;
-import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
-import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
-import org.apache.tinkerpop.gremlin.driver.message.ResponseMessage;
-import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.io.AbstractIoRegistry;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoClassResolverV1d0;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.apache.tinkerpop.shaded.kryo.ClassResolver;
-import org.apache.tinkerpop.shaded.kryo.Kryo;
-import org.apache.tinkerpop.shaded.kryo.KryoException;
-import org.apache.tinkerpop.shaded.kryo.Registration;
-import org.apache.tinkerpop.shaded.kryo.Serializer;
-import org.apache.tinkerpop.shaded.kryo.io.Input;
-import org.apache.tinkerpop.shaded.kryo.io.Output;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
-import java.awt.*;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-import java.util.function.Supplier;
-
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-@RunWith(Parameterized.class)
-public class GryoBaseMessageSerializerV1d0Test {
-    @Parameterized.Parameters(name = "expect({0})")
-    public static Iterable<Object[]> data() {
-        final GryoMessageSerializerV1d0 v1d0Text = new GryoMessageSerializerV1d0();
-        v1d0Text.configure(config, null);
-
-        final GryoMessageSerializerV1d0 v1d0LiteText = new GryoMessageSerializerV1d0();
-        v1d0LiteText.configure(config, null);
-
-        return Arrays.asList(new Object[][]{
-                {"V1d0", new GryoMessageSerializerV1d0(), v1d0Text},
-                {"V1d0Lite", new GryoLiteMessageSerializerV1d0(), v1d0LiteText }});
-    }
-
-    @Parameterized.Parameter(value = 0)
-    public String name;
-
-    @Parameterized.Parameter(value = 1)
-    public MessageSerializer binarySerializer;
-
-    @Parameterized.Parameter(value = 2)
-    public MessageSerializer textSerializer;
-
-    private static final Map<String, Object> config = new HashMap<String, Object>() {{
-        put(GryoMessageSerializerV1d0.TOKEN_SERIALIZE_RESULT_TO_STRING, true);
-    }};
-
-    private UUID requestId = UUID.fromString("6457272A-4018-4538-B9AE-08DD5DDC0AA1");
-    private ResponseMessage.Builder responseMessageBuilder = ResponseMessage.build(requestId);
-    private static ByteBufAllocator allocator = UnpooledByteBufAllocator.DEFAULT;
-
-    @Test
-    public void shouldConfigureIoRegistry() throws Exception {
-        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> config = new HashMap<String, Object>() {{
-            put(GryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES, Arrays.asList(ColorIoRegistry.class.getName()));
-        }};
-
-        serializer.configure(config, null);
-
-        final ResponseMessage toSerialize = ResponseMessage.build(requestId).result(Color.RED).create();
-        final ByteBuf bb = serializer.serializeResponseAsBinary(toSerialize, allocator);
-        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
-
-        assertCommon(deserialized);
-        assertEquals(Color.RED, deserialized.getResult().getData());
-    }
-
-    @Test
-    public void shouldConfigureIoRegistryInstance() throws Exception {
-        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> config = new HashMap<String, Object>() {{
-            put(GryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES, Arrays.asList(ColorIoRegistryInstance.class.getName()));
-        }};
-
-        serializer.configure(config, null);
-
-        final ResponseMessage toSerialize = ResponseMessage.build(requestId).result(Color.RED).create();
-        final ByteBuf bb = serializer.serializeResponseAsBinary(toSerialize, allocator);
-        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
-
-        assertCommon(deserialized);
-        assertEquals(Color.RED, deserialized.getResult().getData());
-    }
-
-    @Test
-    public void shouldConfigureIoRegistryGetInstance() throws Exception {
-        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> config = new HashMap<String, Object>() {{
-            put(GryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES, Arrays.asList(ColorIoRegistryGetInstance.class.getName()));
-        }};
-
-        serializer.configure(config, null);
-
-        final ResponseMessage toSerialize = ResponseMessage.build(requestId).result(Color.RED).create();
-        final ByteBuf bb = serializer.serializeResponseAsBinary(toSerialize, allocator);
-        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
-
-        assertCommon(deserialized);
-        assertEquals(Color.RED, deserialized.getResult().getData());
-    }
-
-    @Test
-    public void shouldConfigureCustomClassResolver() {
-        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> config = new HashMap<String, Object>() {{
-            put(GryoMessageSerializerV1d0.TOKEN_CLASS_RESOLVER_SUPPLIER, ErrorOnlyClassResolverSupplier.class.getName());
-        }};
-
-        serializer.configure(config, null);
-
-        try {
-            serializer.serializeResponseAsBinary(responseMessageBuilder.create(), allocator);
-            fail("Should fail because the ClassResolver used here always generates an error");
-        } catch (Exception ex) {
-            assertEquals("java.lang.RuntimeException: Registration is not allowed with this ClassResolver - it is not a good implementation", ex.getMessage());
-        }
-    }
-
-    @Test
-    public void shouldConfigureCustomClassResolverFromInstance() {
-        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> config = new HashMap<String, Object>() {{
-            put(GryoMessageSerializerV1d0.TOKEN_CLASS_RESOLVER_SUPPLIER, ErrorOnlyClassResolverSupplierAsInstance.class.getName());
-        }};
-
-        serializer.configure(config, null);
-
-        try {
-            serializer.serializeResponseAsBinary(responseMessageBuilder.create(), allocator);
-            fail("Should fail because the ClassResolver used here always generates an error");
-        } catch (Exception ex) {
-            assertEquals("java.lang.RuntimeException: Registration is not allowed with this ClassResolver - it is not a good implementation", ex.getMessage());
-        }
-    }
-
-    @Test
-    public void shouldConfigureCustomClassResolverFromGetInstance() {
-        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> config = new HashMap<String, Object>() {{
-            put(GryoMessageSerializerV1d0.TOKEN_CLASS_RESOLVER_SUPPLIER, ErrorOnlyClassResolverSupplierAsGetInstance.class.getName());
-        }};
-
-        serializer.configure(config, null);
-
-        try {
-            serializer.serializeResponseAsBinary(responseMessageBuilder.create(), allocator);
-            fail("Should fail because the ClassResolver used here always generates an error");
-        } catch (Exception ex) {
-            assertEquals("java.lang.RuntimeException: Registration is not allowed with this ClassResolver - it is not a good implementation", ex.getMessage());
-        }
-    }
-
-    @Test
-    public void shouldSerializeIterable() throws Exception {
-        final ArrayList<Integer> list = new ArrayList<>();
-        list.add(1);
-        list.add(100);
-
-        final ResponseMessage response = convertBinary(list);
-        assertCommon(response);
-
-        final java.util.List<Integer> deserializedFunList = (java.util.List<Integer>) response.getResult().getData();
-        assertEquals(2, deserializedFunList.size());
-        assertEquals(new Integer(1), deserializedFunList.get(0));
-        assertEquals(new Integer(100), deserializedFunList.get(1));
-    }
-
-    @Test
-    public void shouldSerializeIterableToString() throws Exception {
-        final ArrayList<Integer> list = new ArrayList<>();
-        list.add(1);
-        list.add(100);
-
-        final ResponseMessage response = convertText(list);
-        assertCommon(response);
-
-        final java.util.List deserializedFunList = (java.util.List) response.getResult().getData();
-        assertEquals(2, deserializedFunList.size());
-        assertEquals("1", deserializedFunList.get(0));
-        assertEquals("100", deserializedFunList.get(1));
-    }
-
-    @Test
-    public void shouldSerializeIterableToStringWithNull() throws Exception {
-        final ArrayList<Integer> list = new ArrayList<>();
-        list.add(1);
-        list.add(null);
-        list.add(100);
-
-        final ResponseMessage response = convertText(list);
-        assertCommon(response);
-
-        final java.util.List deserializedFunList = (java.util.List) response.getResult().getData();
-        assertEquals(3, deserializedFunList.size());
-        assertEquals("1", deserializedFunList.get(0).toString());
-        assertEquals("null", deserializedFunList.get(1).toString());
-        assertEquals("100", deserializedFunList.get(2).toString());
-    }
-
-    @Test
-    public void shouldSerializeIterableWithNull() throws Exception {
-        final ArrayList<Integer> list = new ArrayList<>();
-        list.add(1);
-        list.add(null);
-        list.add(100);
-
-        final ResponseMessage response = convertBinary(list);
-        assertCommon(response);
-
-        final java.util.List<Integer> deserializedFunList = (java.util.List<Integer>) response.getResult().getData();
-        assertEquals(3, deserializedFunList.size());
-        assertEquals(new Integer(1), deserializedFunList.get(0));
-        assertNull(deserializedFunList.get(1));
-        assertEquals(new Integer(100), deserializedFunList.get(2));
-    }
-
-    @Test
-    public void shouldSerializeMap() throws Exception {
-        final Map<String, Object> map = new HashMap<>();
-        final Map<String, String> innerMap = new HashMap<>();
-        innerMap.put("a", "b");
-
-        map.put("x", 1);
-        map.put("y", "some");
-        map.put("z", innerMap);
-
-        final ResponseMessage response = convertBinary(map);
-        assertCommon(response);
-
-        final Map<String, Object> deserializedMap = (Map<String, Object>) response.getResult().getData();
-        assertEquals(3, deserializedMap.size());
-        assertEquals(1, deserializedMap.get("x"));
-        assertEquals("some", deserializedMap.get("y"));
-
-        final Map<String, String> deserializedInnerMap = (Map<String, String>) deserializedMap.get("z");
-        assertEquals(1, deserializedInnerMap.size());
-        assertEquals("b", deserializedInnerMap.get("a"));
-    }
-
-    @Test
-    public void shouldSerializeMapEntry() throws Exception {
-        final Graph graph = TinkerGraph.open();
-        final Vertex v1 = graph.addVertex();
-        final Date d = new Date();
-
-        final Map<Object, Object> map = new HashMap<>();
-        map.put("x", 1);
-        map.put(v1, 100);
-        map.put(d, "test");
-
-        final ResponseMessage response = convertBinary(IteratorUtils.asList(map.entrySet()));
-        assertCommon(response);
-
-        final java.util.List<Map.Entry<Object, Object>> deserializedEntries = (java.util.List<Map.Entry<Object, Object>>) response.getResult().getData();
-        assertEquals(3, deserializedEntries.size());
-        deserializedEntries.forEach(e -> {
-            if (e.getKey().equals("x"))
-                assertEquals(1, e.getValue());
-            else if (e.getKey().equals(v1))
-                assertEquals(100, e.getValue());
-            else if (e.getKey().equals(d))
-                assertEquals("test", e.getValue());
-            else
-                fail("Map entries contains a key that is not part of what was serialized");
-        });
-    }
-
-    @Test
-    public void shouldSerializeTree() throws Exception {
-        final Graph g = TinkerFactory.createModern();
-        final Tree t = g.traversal().V().out().out().tree().by("name").next();
-
-        final ResponseMessage response = convertBinary(t);
-        assertCommon(response);
-
-        final Tree deserialized = (Tree) response.getResult().getData();
-        assertEquals(t, deserialized);
-
-        assertThat(deserialized.containsKey("marko"), is(true));
-        assertEquals(1, deserialized.size());
-
-        final Tree markoChildren = (Tree) deserialized.get("marko");
-        assertThat(markoChildren.containsKey("josh"), is(true));
-        assertEquals(1, markoChildren.size());
-
-        final Tree joshChildren = (Tree) markoChildren.get("josh");
-        assertThat(joshChildren.containsKey("lop"), is(true));
-        assertThat(joshChildren.containsKey("ripple"), is(true));
-        assertEquals(2, joshChildren.size());
-    }
-
-    @Test
-    public void shouldSerializeFullResponseMessage() throws Exception {
-        final UUID id = UUID.randomUUID();
-
-        final Map<String, Object> metaData = new HashMap<>();
-        metaData.put("test", "this");
-        metaData.put("one", 1);
-
-        final Map<String, Object> attributes = new HashMap<>();
-        attributes.put("test", "that");
-        attributes.put("two", 2);
-
-        final ResponseMessage response = ResponseMessage.build(id)
-                .responseMetaData(metaData)
-                .code(ResponseStatusCode.SUCCESS)
-                .result("some-result")
-                .statusAttributes(attributes)
-                .statusMessage("worked")
-                .create();
-
-        final ByteBuf bb = binarySerializer.serializeResponseAsBinary(response, allocator);
-        final ResponseMessage deserialized = binarySerializer.deserializeResponse(bb);
-
-        assertEquals(id, deserialized.getRequestId());
-        assertEquals("this", deserialized.getResult().getMeta().get("test"));
-        assertEquals(1, deserialized.getResult().getMeta().get("one"));
-        assertEquals("some-result", deserialized.getResult().getData());
-        assertEquals("that", deserialized.getStatus().getAttributes().get("test"));
-        assertEquals(2, deserialized.getStatus().getAttributes().get("two"));
-        assertEquals(ResponseStatusCode.SUCCESS.getValue(), deserialized.getStatus().getCode().getValue());
-        assertEquals("worked", deserialized.getStatus().getMessage());
-    }
-
-    @Test
-    public void shouldHaveTooSmallBufferToSerializeResponseMessage() throws Exception {
-        final UUID id = UUID.randomUUID();
-
-        final Map<String, Object> metaData = new HashMap<>();
-        metaData.put("test", "this");
-        metaData.put("one", 1);
-
-        final Map<String, Object> attributes = new HashMap<>();
-        attributes.put("test", "that");
-        attributes.put("two", 2);
-
-        final ResponseMessage response = ResponseMessage.build(id)
-                .responseMetaData(metaData)
-                .code(ResponseStatusCode.SUCCESS)
-                .result("some-result")
-                .statusAttributes(attributes)
-                .statusMessage("worked")
-                .create();
-
-        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
-            put("bufferSize", 1);
-        }};
-        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
-
-        try {
-            binarySerializerWithSmallBuffer.serializeResponseAsBinary(response, allocator);
-            fail("Should have a buffer size that is too small");
-        } catch (Exception ex) {
-            final Throwable root = ExceptionUtils.getRootCause(ex);
-            assertThat(root, instanceOf(KryoException.class));
-        }
-    }
-
-    @Test
-    public void shouldReturnAllBytesInResponse() throws Exception {
-        final UUID id = UUID.randomUUID();
-
-        final Map<String, Object> metaData = new HashMap<>();
-        metaData.put("test", "this");
-        metaData.put("one", 1);
-
-        final Map<String, Object> attributes = new HashMap<>();
-        attributes.put("test", "that");
-        attributes.put("two", 2);
-
-        final ResponseMessage response = ResponseMessage.build(id)
-                .responseMetaData(metaData)
-                .code(ResponseStatusCode.SUCCESS)
-                .result("some-result")
-                .statusAttributes(attributes)
-                .statusMessage("worked")
-                .create();
-
-        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
-            // set to bufferSize < total message size but still greater than any individual object requires
-            put("bufferSize", 50);
-        }};
-        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
-
-        final ByteBuf buf = binarySerializerWithSmallBuffer.serializeResponseAsBinary(response, allocator);
-        assertTrue(buf.isReadable());
-        assertEquals(82, buf.readableBytes());
-    }
-
-    @Test
-    public void shouldSerializeFullRequestMessage() throws Exception {
-        final UUID id = UUID.randomUUID();
-
-        final RequestMessage request = RequestMessage.build("try")
-                .overrideRequestId(id)
-                .processor("pro")
-                .addArg("test", "this")
-                .create();
-        final ByteBuf bb = binarySerializer.serializeRequestAsBinary(request, allocator);
-        final int mimeLen = bb.readByte();
-        bb.readBytes(new byte[mimeLen]);
-        final RequestMessage deserialized = binarySerializer.deserializeRequest(bb);
-
-        assertEquals(id, deserialized.getRequestId());
-        assertEquals("pro", deserialized.getProcessor());
-        assertEquals("try", deserialized.getOp());
-        assertEquals("this", deserialized.getArgs().get("test"));
-    }
-
-    @Test
-    public void shouldHaveTooSmallBufferToSerializeRequestMessage() throws Exception {
-        final UUID id = UUID.randomUUID();
-
-        final RequestMessage request = RequestMessage.build("try")
-                .overrideRequestId(id)
-                .processor("pro")
-                .addArg("test", "this")
-                .create();
-
-        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
-            put("bufferSize", 1);
-        }};
-        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
-
-        try {
-            binarySerializerWithSmallBuffer.serializeRequestAsBinary(request, allocator);
-            fail("Should have a buffer size that is too small");
-        } catch (Exception ex) {
-            final Throwable root = ExceptionUtils.getRootCause(ex);
-            assertThat(root, instanceOf(KryoException.class));
-        }
-    }
-
-    @Test
-    public void shouldReturnAllBytesInRequest() throws Exception {
-        final UUID id = UUID.randomUUID();
-
-        final RequestMessage request = RequestMessage.build("try")
-                .overrideRequestId(id)
-                .processor("pro")
-                .addArg("test", "this")
-                .create();
-
-        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
-            // set to bufferSize < total message size but still greater than any individual object requires
-            put("bufferSize", 50);
-        }};
-        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
-
-        ByteBuf buf = binarySerializerWithSmallBuffer.serializeRequestAsBinary(request, allocator);
-        assertTrue(buf.isReadable());
-        assertEquals(71, buf.readableBytes());
-    }
-
-    private void assertCommon(final ResponseMessage response) {
-        assertEquals(requestId, response.getRequestId());
-        assertEquals(ResponseStatusCode.SUCCESS, response.getStatus().getCode());
-    }
-
-    private ResponseMessage convertBinary(final Object toSerialize) throws SerializationException {
-        final ByteBuf bb = binarySerializer.serializeResponseAsBinary(responseMessageBuilder.result(toSerialize).create(), allocator);
-        return binarySerializer.deserializeResponse(bb);
-    }
-
-    private ResponseMessage convertText(final Object toSerialize) throws SerializationException {
-        final ByteBuf bb = textSerializer.serializeResponseAsBinary(responseMessageBuilder.result(toSerialize).create(), allocator);
-        return textSerializer.deserializeResponse(bb);
-    }
-
-    public static class ErrorOnlyClassResolverSupplierAsInstance implements Supplier<ClassResolver> {
-
-        private static final ErrorOnlyClassResolverSupplierAsInstance instance = new ErrorOnlyClassResolverSupplierAsInstance();
-
-        private ErrorOnlyClassResolverSupplierAsInstance() {}
-
-        public static ErrorOnlyClassResolverSupplierAsInstance instance() {
-            return instance;
-        }
-
-        @Override
-        public ClassResolver get() {
-            return new ErrorOnlyClassResolver();
-        }
-    }
-
-    public static class ErrorOnlyClassResolverSupplierAsGetInstance implements Supplier<ClassResolver> {
-
-        private static final ErrorOnlyClassResolverSupplierAsInstance instance = new ErrorOnlyClassResolverSupplierAsInstance();
-
-        private ErrorOnlyClassResolverSupplierAsGetInstance() {}
-
-        public static ErrorOnlyClassResolverSupplierAsInstance getInstance() {
-            return instance;
-        }
-
-        @Override
-        public ClassResolver get() {
-            return new ErrorOnlyClassResolver();
-        }
-    }
-
-    public static class ErrorOnlyClassResolverSupplier implements Supplier<ClassResolver> {
-        @Override
-        public ClassResolver get() {
-            return new ErrorOnlyClassResolver();
-        }
-    }
-
-    public static class ErrorOnlyClassResolver extends GryoClassResolverV1d0 {
-        @Override
-        public Registration getRegistration(Class clazz) {
-            throw new RuntimeException("Registration is not allowed with this ClassResolver - it is not a good implementation");
-        }
-    }
-
-    public static class ColorIoRegistry extends AbstractIoRegistry {
-        public ColorIoRegistry() {
-            register(GryoIo.class, Color.class, new ColorSerializer());
-        }
-    }
-
-    public static class ColorIoRegistryInstance extends AbstractIoRegistry {
-
-        private static final ColorIoRegistry instance = new ColorIoRegistry();
-
-        private ColorIoRegistryInstance() {
-            register(GryoIo.class, Color.class, new ColorSerializer());
-        }
-
-        public static ColorIoRegistry instance() {
-            return instance;
-        }
-    }
-
-    public static class ColorIoRegistryGetInstance extends AbstractIoRegistry {
-
-        private static final ColorIoRegistry instance = new ColorIoRegistry();
-
-        private ColorIoRegistryGetInstance() {
-            register(GryoIo.class, Color.class, new ColorSerializer());
-        }
-
-        public static ColorIoRegistry getInstance() {
-            return instance;
-        }
-    }
-
-    public static class ColorSerializer extends Serializer<Color> {
-        @Override
-        public void write(final Kryo kryo, final Output output, final Color color) {
-            output.write(color.equals(Color.RED) ? 1 : 0);
-        }
-
-        @Override
-        public Color read(final Kryo kryo, final Input input, final Class<Color> aClass) {
-            return input.read() == 1 ? Color.RED : Color.BLACK;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
index 746c6f8..041095c 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
@@ -342,8 +342,8 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
             fail("Should have thrown exception over bad serialization");
         } catch (Exception ex) {
             final Throwable inner = ExceptionUtils.getRootCause(ex);
-            assertTrue(inner instanceof RuntimeException);
-            assertThat(inner.getMessage(), startsWith("Encountered unregistered class ID:"));
+            assertThat(inner, instanceOf(ResponseException.class));
+            assertEquals(ResponseStatusCode.SERVER_ERROR_SERIALIZATION, ((ResponseException) inner).getResponseStatusCode());
         }
 
         // should not die completely just because we had a bad serialization error.  that kind of stuff happens

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java
index e691e1c..94b6513 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java
@@ -23,7 +23,7 @@ import org.apache.tinkerpop.gremlin.driver.Cluster;
 import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
 import org.apache.tinkerpop.gremlin.driver.Result;
 import org.apache.tinkerpop.gremlin.driver.ResultSet;
-import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
+import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0;
 import org.apache.tinkerpop.gremlin.driver.ser.Serializers;
 import org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin;
 import org.apache.tinkerpop.gremlin.process.traversal.Path;
@@ -42,7 +42,7 @@ import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.hamcrest.CoreMatchers;
 import org.junit.After;
@@ -80,9 +80,9 @@ public class GremlinResultSetIntegrateTest extends AbstractGremlinServerIntegrat
 
     @Before
     public void beforeTest() {
-        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
+        final MessageSerializer serializer = new GryoMessageSerializerV3d0();
         final Map<String,Object> c = new HashMap<>();
-        c.put("ioRegistries", Collections.singletonList(TinkerIoRegistryV1d0.class.getName()));
+        c.put("ioRegistries", Collections.singletonList(TinkerIoRegistryV3d0.class.getName()));
         c.put("custom", Collections.singletonList("groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer"));
 
         serializer.configure(c, null);


[45/50] [abbrv] tinkerpop git commit: TINKERPOP-1686 Refactored DefaultTraversalMetrics

Posted by sp...@apache.org.
TINKERPOP-1686 Refactored DefaultTraversalMetrics

There seems to be some weird problem in gryo serialization for this class that is difficult to reproduce. It seemed to have something to do with nested maps or perhaps TreeMap, but I wasn't able to easily isolate it to create a bug report to Kryo. All I know is that these changes made the serialization failure (a buffer underflow) go away. It also fixed a problem where deserialization with GraphSON did not allow the getMetrics(int) method to work.


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

Branch: refs/heads/TINKERPOP-1686
Commit: 4a5efabc07700f5c497f0e8e2e57c13dc8826359
Parents: f5ffa0d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jun 7 15:06:10 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 11 08:02:47 2017 -0400

----------------------------------------------------------------------
 .../traversal/util/DefaultTraversalMetrics.java | 220 +++++++------------
 1 file changed, 81 insertions(+), 139 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4a5efabc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
index 291c7ea..9d4adaf 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
@@ -23,6 +23,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.ProfileStep;
+import org.javatuples.Pair;
 
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -31,7 +32,6 @@ import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.TreeMap;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -41,6 +41,7 @@ import java.util.concurrent.atomic.AtomicInteger;
  *
  * @author Bob Briody (http://bobbriody.com)
  * @author Marko A. Rodriguez (http://markorodriguez.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public final class DefaultTraversalMetrics implements TraversalMetrics, Serializable {
     /**
@@ -48,8 +49,10 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
      */
     private static final String[] HEADERS = {"Step", "Count", "Traversers", "Time (ms)", "% Dur"};
 
-    private final Map<String, MutableMetrics> metrics = new HashMap<>();
-    private final TreeMap<Integer, String> indexToLabelMap = new TreeMap<>();
+    /**
+     * {@link ImmutableMetrics} indexed by their step identifier.
+     */
+    private final Map<String, ImmutableMetrics> stepIndexedMetrics = new HashMap<>();
 
     /**
      * A computed value representing the total time spent on all steps.
@@ -57,9 +60,9 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
     private long totalStepDuration;
 
     /**
-     * The metrics that are reported to the caller of profile() which are computed once all metrics have been gathered.
+     * {@link ImmutableMetrics} indexed by their step position.
      */
-    private Map<String, ImmutableMetrics> computedMetrics = new LinkedHashMap<>();
+    private Map<Integer, ImmutableMetrics> positionIndexedMetrics = new LinkedHashMap<>();
 
     /**
      * Determines if final metrics have been computed
@@ -72,14 +75,12 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
     /**
      * This is only a convenient constructor needed for GraphSON deserialization.
      */
-    public DefaultTraversalMetrics(final long totalStepDurationNs, final List<MutableMetrics> metricsMap) {
-        this.totalStepDuration = totalStepDurationNs;
-        this.computedMetrics = new LinkedHashMap<>(this.metrics.size());
-        final AtomicInteger counter = new AtomicInteger(0);
-        metricsMap.forEach(metric -> {
-            this.computedMetrics.put(metric.getId(), metric.getImmutableClone());
-            this.indexToLabelMap.put(counter.getAndIncrement(), metric.getId());
-        });
+    public DefaultTraversalMetrics(final long totalStepDurationNs, final List<MutableMetrics> orderedMetrics) {
+        totalStepDuration = totalStepDurationNs;
+        for (int ix = 0; ix < orderedMetrics.size(); ix++) {
+            stepIndexedMetrics.put(orderedMetrics.get(ix).getId(), orderedMetrics.get(ix).getImmutableClone());
+            positionIndexedMetrics.put(ix, orderedMetrics.get(ix).getImmutableClone());
+        }
     }
 
     @Override
@@ -89,18 +90,17 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
 
     @Override
     public Metrics getMetrics(final int index) {
-        // adjust index to account for the injected profile steps
-        return this.computedMetrics.get(this.indexToLabelMap.get(index));
+        return this.positionIndexedMetrics.get(index);
     }
 
     @Override
     public Metrics getMetrics(final String id) {
-        return this.computedMetrics.get(id);
+        return this.stepIndexedMetrics.get(id);
     }
 
     @Override
     public Collection<ImmutableMetrics> getMetrics() {
-        return this.computedMetrics.values();
+        return this.positionIndexedMetrics.values();
     }
 
     /**
@@ -120,7 +120,7 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
 
         sb.append("\n=============================================================================================================");
 
-        appendMetrics(this.computedMetrics.values(), sb, 0);
+        appendMetrics(this.positionIndexedMetrics.values(), sb, 0);
 
         // Append total duration
         sb.append(String.format("%n%50s %21s %11s %15.3f %8s",
@@ -136,137 +136,34 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
     public synchronized void setMetrics(final Traversal.Admin traversal, final boolean onGraphComputer) {
         if (finalized) throw new IllegalStateException("Metrics have been finalized and cannot be modified");
         finalized = true;
-        addTopLevelMetrics(traversal, onGraphComputer);
         handleNestedTraversals(traversal, null, onGraphComputer);
-        computeTotals();
-    }
-
-    private void appendMetrics(final Collection<? extends Metrics> metrics, final StringBuilder sb, final int indent) {
-        // Append each StepMetric's row. indexToLabelMap values are ordered by index.
-        for (Metrics m : metrics) {
-            String rowName = m.getName();
-
-            // Handle indentation
-            for (int ii = 0; ii < indent; ii++) {
-                rowName = "  " + rowName;
-            }
-            // Abbreviate if necessary
-            rowName = StringUtils.abbreviate(rowName, 50);
-
-            // Grab the values
-            final Long itemCount = m.getCount(ELEMENT_COUNT_ID);
-            final Long traverserCount = m.getCount(TRAVERSER_COUNT_ID);
-            final Double percentDur = (Double) m.getAnnotation(PERCENT_DURATION_KEY);
-
-            // Build the row string
-
-            sb.append(String.format("%n%-50s", rowName));
-
-            if (itemCount != null) {
-                sb.append(String.format(" %21d", itemCount));
-            } else {
-                sb.append(String.format(" %21s", ""));
-            }
-
-            if (traverserCount != null) {
-                sb.append(String.format(" %11d", traverserCount));
-            } else {
-                sb.append(String.format(" %11s", ""));
-            }
-
-            sb.append(String.format(" %15.3f", m.getDuration(TimeUnit.MICROSECONDS) / 1000.0));
-
-            if (percentDur != null) {
-                sb.append(String.format(" %8.2f", percentDur));
-            }
-
-            // process any annotations
-            final Map<String,Object> annotations = m.getAnnotations();
-            if (!annotations.isEmpty()) {
-                // ignore the PERCENT_DURATION_KEY as that is a TinkerPop annotation that is displayed by default
-                annotations.entrySet().stream().filter(kv -> !kv.getKey().equals(PERCENT_DURATION_KEY)).forEach(kv -> {
-                    final String prefix = "    \\_";
-                    final String separator = "=";
-                    final String k = prefix + StringUtils.abbreviate(kv.getKey(), 30);
-                    final int valueIndentLen = separator.length() + k.length() + indent;
-                    final int leftover = 110 - valueIndentLen;
-
-                    final String[] splitValues = splitOnSize(kv.getValue().toString(), leftover);
-                    for (int ix = 0; ix < splitValues.length; ix++) {
-                        // the first lines gets the annotation prefix. the rest are indented to the separator
-                        if (ix == 0) {
-                            sb.append(String.format("%n%s", k + separator + splitValues[ix]));
-                        } else {
-                            sb.append(String.format("%n%s", padLeft(splitValues[ix], valueIndentLen - 1)));
-                        }
-                    }
-                });
-            }
-
-            appendMetrics(m.getNested(), sb, indent + 1);
-        }
+        addTopLevelMetrics(traversal, onGraphComputer);
     }
 
-    private static String[] splitOnSize(final String text, final int size) {
-        final String[] ret = new String[(text.length() + size - 1) / size];
-
-        int counter = 0;
-        for (int start = 0; start < text.length(); start += size) {
-            ret[counter] = text.substring(start, Math.min(text.length(), start + size));
-            counter++;
-        }
+    private void addTopLevelMetrics(final Traversal.Admin traversal, final boolean onGraphComputer) {
+        this.totalStepDuration = 0;
 
-        return ret;
-    }
+        final List<ProfileStep> profileSteps = TraversalHelper.getStepsOfClass(ProfileStep.class, traversal);
+        final List<Pair<Integer, MutableMetrics>> tempMetrics = new ArrayList<>(profileSteps.size());
 
-    private static String padLeft(final String text, final int amountToPad) {
-        // not sure why this method needed to exist. stupid string format stuff and commons utilities wouldn't
-        // work for some reason in the context this method was used above.
-        String newText = text;
-        for (int ix = 0; ix < amountToPad; ix++) {
-            newText = " " + newText;
-        }
-        return newText;
-    }
+        for (int ii = 0; ii < profileSteps.size(); ii++) {
+            // The index is necessary to ensure that step order is preserved after a merge.
+            final ProfileStep step = profileSteps.get(ii);
+            final MutableMetrics stepMetrics = onGraphComputer ? traversal.getSideEffects().get(step.getId()) : step.getMetrics();
 
-    private void computeTotals() {
-        // Create temp list of ordered metrics
-        final List<MutableMetrics> tempMetrics = new ArrayList<>(this.metrics.size());
-        for (final String label : this.indexToLabelMap.values()) {
-            // The indexToLabelMap is sorted by index (key)
-            tempMetrics.add(this.metrics.get(label).clone());
+            this.totalStepDuration += stepMetrics.getDuration(MutableMetrics.SOURCE_UNIT);
+            tempMetrics.add(Pair.with(ii, stepMetrics.clone()));
         }
 
-        // Calculate total duration
-        this.totalStepDuration = 0;
-        tempMetrics.forEach(metric -> this.totalStepDuration += metric.getDuration(MutableMetrics.SOURCE_UNIT));
-
-        // Assign %'s
         tempMetrics.forEach(m -> {
-            final double dur = m.getDuration(TimeUnit.NANOSECONDS) * 100.d / this.totalStepDuration;
-            m.setAnnotation(PERCENT_DURATION_KEY, dur);
+            final double dur = m.getValue1().getDuration(TimeUnit.NANOSECONDS) * 100.d / this.totalStepDuration;
+            m.getValue1().setAnnotation(PERCENT_DURATION_KEY, dur);
         });
 
-        // Store immutable instances of the calculated metrics
-        this.computedMetrics = new LinkedHashMap<>(this.metrics.size());
-        tempMetrics.forEach(it -> this.computedMetrics.put(it.getId(), it.getImmutableClone()));
-    }
-
-    private void addTopLevelMetrics(final Traversal.Admin traversal, final boolean onGraphComputer) {
-        final List<ProfileStep> profileSteps = TraversalHelper.getStepsOfClass(ProfileStep.class, traversal);
-        for (int ii = 0; ii < profileSteps.size(); ii++) {
-            // The index is necessary to ensure that step order is preserved after a merge.
-            final ProfileStep step = profileSteps.get(ii);
-            if (onGraphComputer) {
-                final MutableMetrics stepMetrics = traversal.getSideEffects().get(step.getId());
-                this.indexToLabelMap.put(ii, stepMetrics.getId());
-                this.metrics.put(stepMetrics.getId(), stepMetrics);
-            } else {
-                final MutableMetrics stepMetrics = step.getMetrics();
-                this.indexToLabelMap.put(ii, stepMetrics.getId());
-                this.metrics.put(stepMetrics.getId(), stepMetrics);
-            }
-        }
+        tempMetrics.forEach(p -> {
+            this.stepIndexedMetrics.put(p.getValue1().getId(), p.getValue1().getImmutableClone());
+            this.positionIndexedMetrics.put(p.getValue0(), p.getValue1().getImmutableClone());
+        });
     }
 
     private void handleNestedTraversals(final Traversal.Admin traversal, final MutableMetrics parentMetrics, final boolean onGraphComputer) {
@@ -320,7 +217,7 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
             // Grab the values
             final Long itemCount = m.getCount(ELEMENT_COUNT_ID);
             final Long traverserCount = m.getCount(TRAVERSER_COUNT_ID);
-            Double percentDur = (Double) m.getAnnotation(PERCENT_DURATION_KEY);
+            final Double percentDur = (Double) m.getAnnotation(PERCENT_DURATION_KEY);
 
             // Build the row string
 
@@ -344,7 +241,52 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
                 sb.append(String.format(" %8.2f", percentDur));
             }
 
+            // process any annotations
+            final Map<String,Object> annotations = m.getAnnotations();
+            if (!annotations.isEmpty()) {
+                // ignore the PERCENT_DURATION_KEY as that is a TinkerPop annotation that is displayed by default
+                annotations.entrySet().stream().filter(kv -> !kv.getKey().equals(PERCENT_DURATION_KEY)).forEach(kv -> {
+                    final String prefix = "    \\_";
+                    final String separator = "=";
+                    final String k = prefix + StringUtils.abbreviate(kv.getKey(), 30);
+                    final int valueIndentLen = separator.length() + k.length() + indent;
+                    final int leftover = 110 - valueIndentLen;
+
+                    final String[] splitValues = splitOnSize(kv.getValue().toString(), leftover);
+                    for (int ix = 0; ix < splitValues.length; ix++) {
+                        // the first lines gets the annotation prefix. the rest are indented to the separator
+                        if (ix == 0) {
+                            sb.append(String.format("%n%s", k + separator + splitValues[ix]));
+                        } else {
+                            sb.append(String.format("%n%s", padLeft(splitValues[ix], valueIndentLen - 1)));
+                        }
+                    }
+                });
+            }
+
             appendMetrics(m.getNested(), sb, indent + 1);
         }
     }
+
+    private static String[] splitOnSize(final String text, final int size) {
+        final String[] ret = new String[(text.length() + size - 1) / size];
+
+        int counter = 0;
+        for (int start = 0; start < text.length(); start += size) {
+            ret[counter] = text.substring(start, Math.min(text.length(), start + size));
+            counter++;
+        }
+
+        return ret;
+    }
+
+    private static String padLeft(final String text, final int amountToPad) {
+        // not sure why this method needed to exist. stupid string format stuff and commons utilities wouldn't
+        // work for some reason in the context this method was used above.
+        String newText = text;
+        for (int ix = 0; ix < amountToPad; ix++) {
+            newText = " " + newText;
+        }
+        return newText;
+    }
 }


[48/50] [abbrv] tinkerpop git commit: TINKERPOP-1686 Update changelog

Posted by sp...@apache.org.
TINKERPOP-1686 Update changelog


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

Branch: refs/heads/TINKERPOP-1686
Commit: c5364356bd40e14dfba93f5b32b04628aa5b9234
Parents: 4ec6921
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jun 28 07:38:40 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 11 08:04:55 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                      | 2 ++
 docs/src/upgrade/release-3.3.x.asciidoc | 1 +
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c5364356/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 8c08d5d..07d85fc 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,8 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.3.0 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* `TraversalMetrics` and `Metrics` Gryo formats changed given internal changes to the implementations.
+* Made `TraversalMetrics` safe to write to from multiple threads.
 * Established the Gryo 3.0 format.
 * `GryoVersion` now includes a default `ClassResolver` to supply to the `GryoMapper`.
 * `GryoClassResolver` renamed to `GryoClassResolverV1d0` which has an abstract class that for providers to extend in `AbstractGryoClassResolver`.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c5364356/docs/src/upgrade/release-3.3.x.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.3.x.asciidoc b/docs/src/upgrade/release-3.3.x.asciidoc
index e02bc6e..3f201e5 100644
--- a/docs/src/upgrade/release-3.3.x.asciidoc
+++ b/docs/src/upgrade/release-3.3.x.asciidoc
@@ -109,6 +109,7 @@ Changes to IO
 * Gryo incompatibilities with 3.2.x:
 ** `RequestMessage`
 ** `ResponseMessage`
+** `TraversalMetrics`
 * GraphSON
 ** embedTypes is gone, use typeInfo setting. will default to no types for GraphSON 1.0 and partial types for graphson 2.0 TINKERPOP-1700
 


[05/50] [abbrv] tinkerpop git commit: Merge branch 'tp32'

Posted by sp...@apache.org.
Merge branch 'tp32'


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

Branch: refs/heads/TINKERPOP-1686
Commit: e37e2f9498c884df11fc7f97cedc277d8f9751d5
Parents: 50b405b faa7611
Author: Robert Dale <ro...@gmail.com>
Authored: Tue Jul 4 08:49:34 2017 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Tue Jul 4 08:49:34 2017 -0400

----------------------------------------------------------------------
 .../gremlin/console/jsr223/UtilitiesGremlinPluginScript.groovy   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[21/50] [abbrv] tinkerpop git commit: Merge branch 'tp32'

Posted by sp...@apache.org.
Merge branch 'tp32'

Conflicts:
	gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java


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

Branch: refs/heads/TINKERPOP-1686
Commit: 3477dc7ce29f7d473076b179ebe6a3a58c73828d
Parents: b4b78de 8880118
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jul 6 10:16:39 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Jul 6 10:16:39 2017 -0400

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


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3477dc7c/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
----------------------------------------------------------------------


[42/50] [abbrv] tinkerpop git commit: Merge branch 'tp32'

Posted by sp...@apache.org.
Merge branch 'tp32'


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

Branch: refs/heads/TINKERPOP-1686
Commit: 4062898a0d15de030b656283a038eaa7c0b128d0
Parents: 5554fea bd4b989
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jul 11 07:45:33 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 11 07:45:33 2017 -0400

----------------------------------------------------------------------
 docs/src/dev/developer/administration.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[14/50] [abbrv] tinkerpop git commit: Merge branch 'tp32'

Posted by sp...@apache.org.
Merge branch 'tp32'


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

Branch: refs/heads/TINKERPOP-1686
Commit: e4bf0271bf6b30c112244e84f3d5d7730215b1f1
Parents: 8343072 5f56495
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jul 5 08:53:42 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jul 5 08:53:42 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e4bf0271/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------


[13/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1710' into tp32

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


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

Branch: refs/heads/TINKERPOP-1686
Commit: 5f56495ef999800e67e68fcdbf359ba4cb3e363b
Parents: e12cc7c e962f59
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jul 5 08:53:30 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jul 5 08:53:30 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------



[20/50] [abbrv] tinkerpop git commit: Didn't account for a null value in the config

Posted by sp...@apache.org.
Didn't account for a null value in the config

When the warn message got added it didn't account for null configs. CTR


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

Branch: refs/heads/TINKERPOP-1686
Commit: 8880118d05465571663291e0a70c9a3df22bda5c
Parents: e12cc7c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jul 6 10:13:18 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Jul 6 10:13:18 2017 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/server/AbstractChannelizer.java       | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8880118d/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
index 0a784d9..476cdd5 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
@@ -200,16 +200,17 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
                 }
 
                 final MessageSerializer serializer = (MessageSerializer) clazz.newInstance();
-                final Map<String, Graph> graphsDefinedAtStartup = new HashMap<String, Graph>();
+                final Map<String, Graph> graphsDefinedAtStartup = new HashMap<>();
                 for (String graphName : settings.graphs.keySet()) {
                     graphsDefinedAtStartup.put(graphName, graphManager.getGraph(graphName));
                 }
 
-                if (config.config.containsKey(AbstractGryoMessageSerializerV1d0.TOKEN_USE_MAPPER_FROM_GRAPH))
-                    logger.warn("{} utilizes the {} configuration setting which is deprecated - prefer use of {}", config.className, AbstractGryoMessageSerializerV1d0.TOKEN_USE_MAPPER_FROM_GRAPH, AbstractGryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES);
+                if (config.config != null) {
+                    if (config.config.containsKey(AbstractGryoMessageSerializerV1d0.TOKEN_USE_MAPPER_FROM_GRAPH))
+                        logger.warn("{} utilizes the {} configuration setting which is deprecated - prefer use of {}", config.className, AbstractGryoMessageSerializerV1d0.TOKEN_USE_MAPPER_FROM_GRAPH, AbstractGryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES);
 
-                if (config.config != null)
                     serializer.configure(config.config, graphsDefinedAtStartup);
+                }
 
                 return Optional.ofNullable(serializer);
             } catch (ClassNotFoundException cnfe) {


[30/50] [abbrv] tinkerpop git commit: TINKERPOP-1698 Initialize computedMetrics

Posted by sp...@apache.org.
TINKERPOP-1698 Initialize computedMetrics

Without that initialization there are scenarios in sparkgraphcomputer where serialization will fail. The Gryo 3.0 TraversalMetricSerializer gets a collection of computed metrics and null pointers basically.


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

Branch: refs/heads/TINKERPOP-1686
Commit: 0501d42e029f920960bc12beb150d2f442199cb3
Parents: 21b35c4
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 26 15:41:38 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 14:14:02 2017 -0400

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


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0501d42e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
index c5f290a..584456a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
@@ -52,7 +52,7 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
     The following are computed values upon the completion of profiling in order to report the results back to the user
      */
     private long totalStepDuration;
-    private Map<String, ImmutableMetrics> computedMetrics;
+    private Map<String, ImmutableMetrics> computedMetrics = new LinkedHashMap<>();
 
     public DefaultTraversalMetrics() {
     }


[10/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1289'

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


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

Branch: refs/heads/TINKERPOP-1686
Commit: 69053b9db3a7b3b32a5470d769c4c42ca1c1d81a
Parents: 1744b3f 00df1b2
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jul 5 07:14:38 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jul 5 07:14:38 2017 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                           | 1 +
 docs/src/upgrade/release-3.3.x.asciidoc                      | 3 +++
 .../tinkerpop/gremlin/process/traversal/util/AndP.java       | 8 --------
 .../gremlin/process/traversal/util/ConnectiveP.java          | 8 --------
 .../apache/tinkerpop/gremlin/process/traversal/util/OrP.java | 8 --------
 5 files changed, 4 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/69053b9d/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --cc CHANGELOG.asciidoc
index 42fc7b7,9c116b6..3a61c49
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@@ -26,7 -26,7 +26,8 @@@ image::https://raw.githubusercontent.co
  TinkerPop 3.3.0 (Release Date: NOT OFFICIALLY RELEASED YET)
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
 +* Removed previously deprecated `TraversalSource.Builder` class.
+ * Removed previously deprecated `ConnectiveP`, `AndP`, `OrP` constructors.
  * Graphite and Ganglia are no longer packaged with the Gremlin Server distribution.
  * `TransactionException` is no longer a class of `AbstractTransaction` and it extends `RuntimeException`.
  * Included an ellipse on long property names that are truncated.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/69053b9d/docs/src/upgrade/release-3.3.x.asciidoc
----------------------------------------------------------------------
diff --cc docs/src/upgrade/release-3.3.x.asciidoc
index f04f564,992381e..04e5615
--- a/docs/src/upgrade/release-3.3.x.asciidoc
+++ b/docs/src/upgrade/release-3.3.x.asciidoc
@@@ -202,7 -202,9 +202,10 @@@ The following deprecated classes, metho
  ** `org.apache.tinkerpop.gremlin.jsr223.SingleGremlinScriptEngineManager#getInstance()`
  ** `org.apache.tinkerpop.gremlin.jsr223.GremlinScriptEngineManager#addModule(GremlinModule)`
  ** `org.apache.tinkerpop.gremlin.jsr223.console.PluginAcceptor`
 +** `org.apache.tinkerpop.gremlin.process.traversal.TraversalSource.Builder`
+ ** `org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP(P...)`
+ ** `org.apache.tinkerpop.gremlin.process.traversal.util.AndP(P...)`
+ ** `org.apache.tinkerpop.gremlin.process.traversal.util.OrP(P...)`
  ** `org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexPropertyFeatures#supportsAddProperty()`
  ** `org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexPropertyFeatures#FEATURE_ADD_PROPERTY`
  ** `org.apache.tinkerpop.gremlin.structure.Graph.OptIn#SUITE_GROOVY_PROCESS_STANDARD`


[36/50] [abbrv] tinkerpop git commit: TINKERPOP-1698 Changed format of property writes

Posted by sp...@apache.org.
TINKERPOP-1698 Changed format of property writes

Write properties with streams instead of pulling them into a List in memory


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

Branch: refs/heads/TINKERPOP-1686
Commit: 155e50d8097caa817a68d385ad6192a2df0e36f9
Parents: 0a7f7f6
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jun 27 08:46:35 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 14:14:03 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   1 +
 .../structure/io/gryo/GryoSerializersV3d0.java  |  75 ++++++++++---------
 .../structure/io/gryo/kryoshim/InputShim.java   |   2 +
 .../structure/io/gryo/kryoshim/OutputShim.java  |   2 +
 .../kryoshim/shaded/ShadedInputAdapter.java     |   5 ++
 .../kryoshim/shaded/ShadedOutputAdapter.java    |   7 +-
 .../structure/io/gryo/_3_3_0/edge-v3d0.kryo     | Bin 41 -> 39 bytes
 .../io/gryo/_3_3_0/standardresult-v3d0.kryo     | Bin 235 -> 229 bytes
 .../io/gryo/_3_3_0/traversalmetrics-v1d0.kryo   | Bin 294 -> 306 bytes
 .../io/gryo/_3_3_0/traverser-v3d0.kryo          | Bin 216 -> 210 bytes
 .../structure/io/gryo/_3_3_0/tree-v3d0.kryo     | Bin 293 -> 277 bytes
 .../structure/io/gryo/_3_3_0/vertex-v3d0.kryo   | Bin 207 -> 201 bytes
 .../io/gryo/_3_3_0/vertexproperty-v3d0.kryo     | Bin 26 -> 23 bytes
 .../kryoshim/unshaded/UnshadedInputAdapter.java |   5 ++
 .../unshaded/UnshadedOutputAdapter.java         |   5 ++
 15 files changed, 66 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 2fe7094..8c08d5d 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.3.0 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Established the Gryo 3.0 format.
 * `GryoVersion` now includes a default `ClassResolver` to supply to the `GryoMapper`.
 * `GryoClassResolver` renamed to `GryoClassResolverV1d0` which has an abstract class that for providers to extend in `AbstractGryoClassResolver`.
 * Removed previously deprecated `TraversalSource.Builder` class.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
index 20e13c4..82fa178 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
@@ -31,10 +31,10 @@ import org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics;
 import org.apache.tinkerpop.gremlin.process.traversal.util.OrP;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMetrics;
 import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Element;
 import org.apache.tinkerpop.gremlin.structure.Property;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.InputShim;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShim;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.OutputShim;
@@ -51,6 +51,7 @@ import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
@@ -86,14 +87,18 @@ public final class GryoSerializersV3d0 {
             }
 
             kryo.writeClassAndObject(output, edge.outVertex().id());
-            output.writeString(edge.outVertex().label());
-
-            final List<Property> properties = IteratorUtils.asList(edge.properties());
-            output.writeInt(properties.size());
-            properties.forEach(p -> {
-                output.writeString(p.key());
-                kryo.writeClassAndObject(output, p.value());
-            });
+
+            // temporary try/catch perhaps? need this to get SparkSingleIterationStrategyTest to work. Trying to grab
+            // the label of the adjacent vertex ends in error if there's a StarEdge in the ComputerGraph$ComputerEdge.
+            // maybe this gets fixed up when TINKERPOP-1592 is in play. hopefully this serializer will get better
+            // with that
+            try {
+                output.writeString(edge.outVertex().label());
+            } catch (Exception ex) {
+                output.writeString(Vertex.DEFAULT_LABEL);
+            }
+
+            writeElementProperties(kryo, output, edge);
         }
 
         @Override
@@ -112,8 +117,7 @@ public final class GryoSerializersV3d0 {
             outV.setLabel(input.readString());
             builder.setOutV(outV.create());
 
-            final int numberOfProperties = input.readInt();
-            for (int ix = 0; ix < numberOfProperties; ix ++) {
+            while(input.readBoolean()) {
                 builder.addProperty(new DetachedProperty<>(input.readString(), kryo.readClassAndObject(input)));
             }
 
@@ -130,24 +134,22 @@ public final class GryoSerializersV3d0 {
             kryo.writeClassAndObject(output, vertex.id());
             output.writeString(vertex.label());
 
-            final List<VertexProperty> properties = IteratorUtils.asList(vertex.properties());
-            output.writeInt(properties.size());
-            properties.forEach(vp -> {
+            final Iterator<? extends VertexProperty> properties = vertex.properties();
+            output.writeBoolean(properties.hasNext());
+            while (properties.hasNext()) {
+                final VertexProperty vp = properties.next();
                 kryo.writeClassAndObject(output, vp.id());
                 output.writeString(vp.label());
                 kryo.writeClassAndObject(output, vp.value());
 
                 if (vp instanceof DetachedVertexProperty || (vertex.graph().features().vertex().supportsMetaProperties())) {
-                    final List<Property> metaProperties = IteratorUtils.asList(vp.properties());
-                    output.writeInt(metaProperties.size());
-                    metaProperties.forEach(p -> {
-                        output.writeString(p.key());
-                        kryo.writeClassAndObject(output, p.value());
-                    });
+                    writeElementProperties(kryo, output, vp);
                 } else {
-                    output.writeInt(0);
+                    output.writeBoolean(false);
                 }
-            });
+
+                output.writeBoolean(properties.hasNext());
+            }
         }
 
         @Override
@@ -156,15 +158,13 @@ public final class GryoSerializersV3d0 {
             builder.setId(kryo.readClassAndObject(input));
             builder.setLabel(input.readString());
 
-            final int numberOfProperties = input.readInt();
-            for (int ix = 0; ix < numberOfProperties; ix ++) {
+            while(input.readBoolean()) {
                 final DetachedVertexProperty.Builder vpBuilder = DetachedVertexProperty.build();
                 vpBuilder.setId(kryo.readClassAndObject(input));
                 vpBuilder.setLabel(input.readString());
                 vpBuilder.setValue(kryo.readClassAndObject(input));
 
-                final int numberOfMetaProperties = input.readInt();
-                for (int iy = 0; iy < numberOfMetaProperties; iy ++) {
+                while(input.readBoolean()) {
                     vpBuilder.addProperty(new DetachedProperty<>(input.readString(), kryo.readClassAndObject(input)));
                 }
 
@@ -207,14 +207,9 @@ public final class GryoSerializersV3d0 {
             output.writeString(vertexProperty.element().label());
 
             if (vertexProperty instanceof DetachedVertexProperty || (vertexProperty.graph().features().vertex().supportsMetaProperties())) {
-                final List<Property> metaProperties = IteratorUtils.asList(vertexProperty.properties());
-                output.writeInt(metaProperties.size());
-                metaProperties.forEach(p -> {
-                    output.writeString(p.key());
-                    kryo.writeClassAndObject(output, p.value());
-                });
+                writeElementProperties(kryo, output, vertexProperty);
             } else {
-                output.writeInt(0);
+                output.writeBoolean(false);
             }
         }
 
@@ -230,8 +225,7 @@ public final class GryoSerializersV3d0 {
             host.setLabel(input.readString());
             vpBuilder.setV(host.create());
 
-            final int numberOfMetaProperties = input.readInt();
-            for (int iy = 0; iy < numberOfMetaProperties; iy ++) {
+            while(input.readBoolean()) {
                 vpBuilder.addProperty(new DetachedProperty<>(input.readString(), kryo.readClassAndObject(input)));
             }
 
@@ -465,4 +459,15 @@ public final class GryoSerializersV3d0 {
             return m;
         }
     }
+
+    private static void writeElementProperties(final KryoShim kryo, final OutputShim output, final Element element) {
+        final Iterator<? extends Property> properties = element.properties();
+        output.writeBoolean(properties.hasNext());
+        while (properties.hasNext()) {
+            final Property p = properties.next();
+            output.writeString(p.key());
+            kryo.writeClassAndObject(output, p.value());
+            output.writeBoolean(properties.hasNext());
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/InputShim.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/InputShim.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/InputShim.java
index d6ba06d..21bfd1f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/InputShim.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/InputShim.java
@@ -36,5 +36,7 @@ public interface InputShim {
 
     public int readInt();
 
+    public boolean readBoolean();
+
     public double readDouble();
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/OutputShim.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/OutputShim.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/OutputShim.java
index 85cba71..abfe8bf 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/OutputShim.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/OutputShim.java
@@ -38,5 +38,7 @@ public interface OutputShim {
 
     public void writeShort(final int s);
 
+    public void writeBoolean(final boolean b);
+
     public void flush();
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedInputAdapter.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedInputAdapter.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedInputAdapter.java
index 22a45ee..aa7741b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedInputAdapter.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedInputAdapter.java
@@ -67,4 +67,9 @@ public class ShadedInputAdapter implements InputShim {
     public double readDouble() {
         return shadedInput.readDouble();
     }
+
+    @Override
+    public boolean readBoolean() {
+        return shadedInput.readBoolean();
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedOutputAdapter.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedOutputAdapter.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedOutputAdapter.java
index 5ecc0fc..1b1697b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedOutputAdapter.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedOutputAdapter.java
@@ -60,11 +60,16 @@ public class ShadedOutputAdapter implements OutputShim {
     }
 
     @Override
-    public void writeShort(int s) {
+    public void writeShort(final int s) {
         shadedOutput.writeShort(s);
     }
 
     @Override
+    public void writeBoolean(final boolean b) {
+        shadedOutput.writeBoolean(b);
+    }
+
+    @Override
     public void flush() {
         shadedOutput.flush();
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/edge-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/edge-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/edge-v3d0.kryo
index b58bff1..6dfbefb 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/edge-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/edge-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/standardresult-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/standardresult-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/standardresult-v3d0.kryo
index b1a2558..06c5d8a 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/standardresult-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/standardresult-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo
index 1aee9e9..2d02c43 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traverser-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traverser-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traverser-v3d0.kryo
index 9ec67de..7c1fb0d 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traverser-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traverser-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/tree-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/tree-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/tree-v3d0.kryo
index 94d1357..d5a9dd9 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/tree-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/tree-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertex-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertex-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertex-v3d0.kryo
index eb46417..4464039 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertex-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertex-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertexproperty-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertexproperty-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertexproperty-v3d0.kryo
index 3139408..95f8be0 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertexproperty-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertexproperty-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedInputAdapter.java
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedInputAdapter.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedInputAdapter.java
index f8177e3..8e1ea05 100644
--- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedInputAdapter.java
+++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedInputAdapter.java
@@ -67,4 +67,9 @@ public class UnshadedInputAdapter implements InputShim {
     public double readDouble() {
         return unshadedInput.readDouble();
     }
+
+    @Override
+    public boolean readBoolean() {
+        return unshadedInput.readBoolean();
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/155e50d8/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedOutputAdapter.java
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedOutputAdapter.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedOutputAdapter.java
index 3799ee4..7f53bd1 100644
--- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedOutputAdapter.java
+++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/kryoshim/unshaded/UnshadedOutputAdapter.java
@@ -68,6 +68,11 @@ public class UnshadedOutputAdapter implements OutputShim {
     }
 
     @Override
+    public void writeBoolean(final boolean b) {
+        unshadedOutput.writeBoolean(b);
+    }
+
+    @Override
     public void flush() {
         unshadedOutput.flush();
     }


[26/50] [abbrv] tinkerpop git commit: Merge branch 'tp32'

Posted by sp...@apache.org.
Merge branch 'tp32'


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

Branch: refs/heads/TINKERPOP-1686
Commit: c3cfaea5a3d2f056bd0074f0d805be7c62acd501
Parents: 4eafc3e 31daf32
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Jul 10 07:24:27 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Jul 10 07:24:27 2017 -0600

----------------------------------------------------------------------
 .../main/jython/tests/driver/test_driver_remote_connection.py | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------



[34/50] [abbrv] tinkerpop git commit: TINKERPOP-1698 Folded Gryo lite tests into main gryo tests

Posted by sp...@apache.org.
TINKERPOP-1698 Folded Gryo lite tests into main gryo tests


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

Branch: refs/heads/TINKERPOP-1686
Commit: 9c046638fe0f76a37c520ae3ccef96d9d979017c
Parents: b9e5490
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 26 11:28:29 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 14:14:02 2017 -0400

----------------------------------------------------------------------
 .../ser/GryoLiteMessageSerializerV1d0Test.java  | 150 -------------------
 .../ser/GryoMessageSerializerV1d0Test.java      | 120 +++++++++------
 2 files changed, 78 insertions(+), 192 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9c046638/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoLiteMessageSerializerV1d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoLiteMessageSerializerV1d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoLiteMessageSerializerV1d0Test.java
deleted file mode 100644
index 2a23d02..0000000
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoLiteMessageSerializerV1d0Test.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.driver.ser;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.ByteBufAllocator;
-import io.netty.buffer.UnpooledByteBufAllocator;
-import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
-import org.apache.tinkerpop.gremlin.driver.message.ResponseMessage;
-import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdge;
-import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * Serializer tests that cover non-lossy serialization/deserialization methods.
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public class GryoLiteMessageSerializerV1d0Test {
-    private static final Map<String, Object> config = new HashMap<String, Object>() {{
-        put(AbstractGryoMessageSerializerV1d0.TOKEN_SERIALIZE_RESULT_TO_STRING, true);
-    }};
-
-    private UUID requestId = UUID.fromString("6457272A-4018-4538-B9AE-08DD5DDC0AA1");
-    private ResponseMessage.Builder responseMessageBuilder = ResponseMessage.build(requestId);
-    private static ByteBufAllocator allocator = UnpooledByteBufAllocator.DEFAULT;
-
-    public MessageSerializer binarySerializer = new GryoLiteMessageSerializerV1d0();
-
-    @Test
-    public void shouldSerializeEdge() throws Exception {
-        final Graph g = TinkerGraph.open();
-        final Vertex v1 = g.addVertex();
-        final Vertex v2 = g.addVertex();
-        final Edge e = v1.addEdge("test", v2);
-        e.property("abc", 123);
-
-        final Iterable<Edge> iterable = IteratorUtils.list(g.edges());
-
-        final ResponseMessage response = convertBinary(iterable);
-        assertCommon(response);
-
-        final List<ReferenceEdge> edgeList = (List<ReferenceEdge>) response.getResult().getData();
-        assertEquals(1, edgeList.size());
-
-        final ReferenceEdge deserializedEdge = edgeList.get(0);
-        assertEquals(e.id(), deserializedEdge.id());
-        assertEquals("test", deserializedEdge.label());
-
-        assertEquals(0, IteratorUtils.count(deserializedEdge.properties()));
-        assertEquals(v1.id(), deserializedEdge.outVertex().id());
-        assertEquals("", deserializedEdge.outVertex().label());
-        assertEquals(v2.id(), deserializedEdge.inVertex().id());
-        assertEquals("", deserializedEdge.inVertex().label());
-    }
-
-    @Test
-    public void shouldSerializeVertexWithEmbeddedMap() throws Exception {
-        final Graph g = TinkerGraph.open();
-        final Vertex v = g.addVertex();
-        final Map<String, Object> map = new HashMap<>();
-        map.put("x", 500);
-        map.put("y", "some");
-
-        final ArrayList<Object> friends = new ArrayList<>();
-        friends.add("x");
-        friends.add(5);
-        friends.add(map);
-
-        v.property(VertexProperty.Cardinality.single, "friends", friends);
-
-        final List list = IteratorUtils.list(g.vertices());
-
-        final ResponseMessage response = convertBinary(list);
-        assertCommon(response);
-
-        final List<ReferenceVertex> vertexList = (List<ReferenceVertex>) response.getResult().getData();
-        assertEquals(1, vertexList.size());
-
-        final ReferenceVertex deserializedVertex = vertexList.get(0);
-        assertEquals(0L, deserializedVertex.id());
-        assertEquals("", deserializedVertex.label());
-
-        assertEquals(0, IteratorUtils.count(deserializedVertex.properties()));
-    }
-
-    @Test
-    public void shouldSerializeToMapWithElementForKey() throws Exception {
-        final TinkerGraph graph = TinkerFactory.createClassic();
-        final GraphTraversalSource g = graph.traversal();
-        final Map<Vertex, Integer> map = new HashMap<>();
-        map.put(g.V().has("name", "marko").next(), 1000);
-
-        final ResponseMessage response = convertBinary(map);
-        assertCommon(response);
-
-        final Map<Vertex, Integer> deserializedMap = (Map<Vertex, Integer>) response.getResult().getData();
-        assertEquals(1, deserializedMap.size());
-
-        final Vertex deserializedMarko = deserializedMap.keySet().iterator().next();
-        assertEquals(0, IteratorUtils.count(deserializedMarko.properties()));
-        assertEquals(1, deserializedMarko.id());
-        assertEquals("", deserializedMarko.label());
-
-        assertEquals(new Integer(1000), deserializedMap.values().iterator().next());
-    }
-
-    private void assertCommon(final ResponseMessage response) {
-        assertEquals(requestId, response.getRequestId());
-        assertEquals(ResponseStatusCode.SUCCESS, response.getStatus().getCode());
-    }
-
-    private ResponseMessage convertBinary(final Object toSerialize) throws SerializationException {
-        final ByteBuf bb = binarySerializer.serializeResponseAsBinary(responseMessageBuilder.result(toSerialize).create(), allocator);
-        return binarySerializer.deserializeResponse(bb);
-    }
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9c046638/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java
index 9472033..29ca9ea 100644
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java
@@ -37,6 +37,8 @@ import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoClassResolverV1d0;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
+import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdge;
+import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
@@ -57,6 +59,7 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 import java.util.function.Supplier;
@@ -514,8 +517,6 @@ public class GryoMessageSerializerV1d0Test {
 
     @Test
     public void shouldSerializeEdge() throws Exception {
-        assumeThat(name, not(containsString("V1d0Lite")));
-
         final Graph g = TinkerGraph.open();
         final Vertex v1 = g.addVertex();
         final Vertex v2 = g.addVertex();
@@ -527,25 +528,39 @@ public class GryoMessageSerializerV1d0Test {
         final ResponseMessage response = convertBinary(iterable);
         assertCommon(response);
 
-        final java.util.List<DetachedEdge> edgeList = (java.util.List<DetachedEdge>) response.getResult().getData();
-        assertEquals(1, edgeList.size());
-
-        final DetachedEdge deserializedEdge = edgeList.get(0);
-        assertEquals(e.id(), deserializedEdge.id());
-        assertEquals("test", deserializedEdge.label());
-
-        assertEquals(123, deserializedEdge.values("abc").next());
-        assertEquals(1, IteratorUtils.count(deserializedEdge.properties()));
-        assertEquals(v1.id(), deserializedEdge.outVertex().id());
-        assertEquals(Vertex.DEFAULT_LABEL, deserializedEdge.outVertex().label());
-        assertEquals(v2.id(), deserializedEdge.inVertex().id());
-        assertEquals(Vertex.DEFAULT_LABEL, deserializedEdge.inVertex().label());
+        if (name.contains("V1d0Lite")) {
+            final List<ReferenceEdge> edgeList = (List<ReferenceEdge>) response.getResult().getData();
+            assertEquals(1, edgeList.size());
+
+            final ReferenceEdge deserializedEdge = edgeList.get(0);
+            assertEquals(e.id(), deserializedEdge.id());
+            assertEquals("test", deserializedEdge.label());
+
+            assertEquals(0, IteratorUtils.count(deserializedEdge.properties()));
+            assertEquals(v1.id(), deserializedEdge.outVertex().id());
+            assertEquals("", deserializedEdge.outVertex().label());
+            assertEquals(v2.id(), deserializedEdge.inVertex().id());
+            assertEquals("", deserializedEdge.inVertex().label());
+
+        } else {
+            final java.util.List<DetachedEdge> edgeList = (java.util.List<DetachedEdge>) response.getResult().getData();
+            assertEquals(1, edgeList.size());
+
+            final DetachedEdge deserializedEdge = edgeList.get(0);
+            assertEquals(e.id(), deserializedEdge.id());
+            assertEquals("test", deserializedEdge.label());
+
+            assertEquals(123, deserializedEdge.values("abc").next());
+            assertEquals(1, IteratorUtils.count(deserializedEdge.properties()));
+            assertEquals(v1.id(), deserializedEdge.outVertex().id());
+            assertEquals(Vertex.DEFAULT_LABEL, deserializedEdge.outVertex().label());
+            assertEquals(v2.id(), deserializedEdge.inVertex().id());
+            assertEquals(Vertex.DEFAULT_LABEL, deserializedEdge.inVertex().label());
+        }
     }
 
     @Test
     public void shouldSerializeVertexWithEmbeddedMap() throws Exception {
-        assumeThat(name, not(containsString("V1d0Lite")));
-
         final Graph g = TinkerGraph.open();
         final Vertex v = g.addVertex();
         final Map<String, Object> map = new HashMap<>();
@@ -564,30 +579,39 @@ public class GryoMessageSerializerV1d0Test {
         final ResponseMessage response = convertBinary(list);
         assertCommon(response);
 
-        final java.util.List<DetachedVertex> vertexList = (java.util.List<DetachedVertex>) response.getResult().getData();
-        assertEquals(1, vertexList.size());
+        if (name.contains("V1d0Lite")) {
+            final List<ReferenceVertex> vertexList = (List<ReferenceVertex>) response.getResult().getData();
+            assertEquals(1, vertexList.size());
+
+            final ReferenceVertex deserializedVertex = vertexList.get(0);
+            assertEquals(0L, deserializedVertex.id());
+            assertEquals("", deserializedVertex.label());
 
-        final DetachedVertex deserializedVertex = vertexList.get(0);
-        assertEquals(0l, deserializedVertex.id());
-        assertEquals(Vertex.DEFAULT_LABEL, deserializedVertex.label());
+            assertEquals(0, IteratorUtils.count(deserializedVertex.properties()));
+        } else {
+            final java.util.List<DetachedVertex> vertexList = (java.util.List<DetachedVertex>) response.getResult().getData();
+            assertEquals(1, vertexList.size());
 
-        assertEquals(1, IteratorUtils.count(deserializedVertex.properties()));
+            final DetachedVertex deserializedVertex = vertexList.get(0);
+            assertEquals(0l, deserializedVertex.id());
+            assertEquals(Vertex.DEFAULT_LABEL, deserializedVertex.label());
 
-        final java.util.List<Object> deserializedInnerList = (java.util.List<Object>) deserializedVertex.values("friends").next();
-        assertEquals(3, deserializedInnerList.size());
-        assertEquals("x", deserializedInnerList.get(0));
-        assertEquals(5, deserializedInnerList.get(1));
+            assertEquals(1, IteratorUtils.count(deserializedVertex.properties()));
 
-        final Map<String, Object> deserializedInnerInnerMap = (Map<String, Object>) deserializedInnerList.get(2);
-        assertEquals(2, deserializedInnerInnerMap.size());
-        assertEquals(500, deserializedInnerInnerMap.get("x"));
-        assertEquals("some", deserializedInnerInnerMap.get("y"));
+            final java.util.List<Object> deserializedInnerList = (java.util.List<Object>) deserializedVertex.values("friends").next();
+            assertEquals(3, deserializedInnerList.size());
+            assertEquals("x", deserializedInnerList.get(0));
+            assertEquals(5, deserializedInnerList.get(1));
+
+            final Map<String, Object> deserializedInnerInnerMap = (Map<String, Object>) deserializedInnerList.get(2);
+            assertEquals(2, deserializedInnerInnerMap.size());
+            assertEquals(500, deserializedInnerInnerMap.get("x"));
+            assertEquals("some", deserializedInnerInnerMap.get("y"));
+        }
     }
 
     @Test
     public void shouldSerializeToMapWithElementForKey() throws Exception {
-        assumeThat(name, not(containsString("V1d0Lite")));
-
         final TinkerGraph graph = TinkerFactory.createClassic();
         final GraphTraversalSource g = graph.traversal();
         final Map<Vertex, Integer> map = new HashMap<>();
@@ -596,17 +620,29 @@ public class GryoMessageSerializerV1d0Test {
         final ResponseMessage response = convertBinary(map);
         assertCommon(response);
 
-        final Map<Vertex, Integer> deserializedMap = (Map<Vertex, Integer>) response.getResult().getData();
-        assertEquals(1, deserializedMap.size());
+        if (name.contains("V1d0Lite")) {
+            final Map<Vertex, Integer> deserializedMap = (Map<Vertex, Integer>) response.getResult().getData();
+            assertEquals(1, deserializedMap.size());
 
-        final Vertex deserializedMarko = deserializedMap.keySet().iterator().next();
-        assertEquals("marko", deserializedMarko.values("name").next().toString());
-        assertEquals(1, deserializedMarko.id());
-        assertEquals(Vertex.DEFAULT_LABEL, deserializedMarko.label());
-        assertEquals(29, deserializedMarko.values("age").next());
-        assertEquals(2, IteratorUtils.count(deserializedMarko.properties()));
+            final Vertex deserializedMarko = deserializedMap.keySet().iterator().next();
+            assertEquals(0, IteratorUtils.count(deserializedMarko.properties()));
+            assertEquals(1, deserializedMarko.id());
+            assertEquals("", deserializedMarko.label());
 
-        assertEquals(new Integer(1000), deserializedMap.values().iterator().next());
+            assertEquals(new Integer(1000), deserializedMap.values().iterator().next());
+        } else {
+            final Map<Vertex, Integer> deserializedMap = (Map<Vertex, Integer>) response.getResult().getData();
+            assertEquals(1, deserializedMap.size());
+
+            final Vertex deserializedMarko = deserializedMap.keySet().iterator().next();
+            assertEquals("marko", deserializedMarko.values("name").next().toString());
+            assertEquals(1, deserializedMarko.id());
+            assertEquals(Vertex.DEFAULT_LABEL, deserializedMarko.label());
+            assertEquals(29, deserializedMarko.values("age").next());
+            assertEquals(2, IteratorUtils.count(deserializedMarko.properties()));
+
+            assertEquals(new Integer(1000), deserializedMap.values().iterator().next());
+        }
     }
 
 


[29/50] [abbrv] tinkerpop git commit: TINKERPOP-1698 Refactored gryo serialization tests

Posted by sp...@apache.org.
TINKERPOP-1698 Refactored gryo serialization tests

Did a better job parameterizing tests for re-use.


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

Branch: refs/heads/TINKERPOP-1686
Commit: b9e5490b9248392eb57fb6f2e88f9bfddedcc531
Parents: cfcdd26
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 26 11:19:29 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 14:14:02 2017 -0400

----------------------------------------------------------------------
 .../ser/GryoBaseMessageSerializerTest.java      | 617 -------------------
 .../ser/GryoMessageSerializerV1d0Test.java      | 575 ++++++++++++++++-
 .../gremlin/structure/FeatureSupportTest.java   |   6 +-
 3 files changed, 571 insertions(+), 627 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b9e5490b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerTest.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerTest.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerTest.java
deleted file mode 100644
index fff95dd..0000000
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerTest.java
+++ /dev/null
@@ -1,617 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.driver.ser;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.ByteBufAllocator;
-import io.netty.buffer.UnpooledByteBufAllocator;
-import org.apache.commons.lang.exception.ExceptionUtils;
-import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
-import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
-import org.apache.tinkerpop.gremlin.driver.message.ResponseMessage;
-import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.io.AbstractIoRegistry;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoClassResolverV1d0;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.apache.tinkerpop.shaded.kryo.ClassResolver;
-import org.apache.tinkerpop.shaded.kryo.Kryo;
-import org.apache.tinkerpop.shaded.kryo.KryoException;
-import org.apache.tinkerpop.shaded.kryo.Registration;
-import org.apache.tinkerpop.shaded.kryo.Serializer;
-import org.apache.tinkerpop.shaded.kryo.io.Input;
-import org.apache.tinkerpop.shaded.kryo.io.Output;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
-import java.awt.*;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-import java.util.function.Supplier;
-
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-@RunWith(Parameterized.class)
-public class GryoBaseMessageSerializerTest {
-    @Parameterized.Parameters(name = "expect({0})")
-    public static Iterable<Object[]> data() {
-        final GryoMessageSerializerV1d0 v1d0Text = new GryoMessageSerializerV1d0();
-        v1d0Text.configure(config, null);
-
-        final GryoMessageSerializerV1d0 v1d0LiteText = new GryoMessageSerializerV1d0();
-        v1d0LiteText.configure(config, null);
-
-        final GryoMessageSerializerV3d0 v3d0Text = new GryoMessageSerializerV3d0();
-        v3d0Text.configure(config, null);
-
-        return Arrays.asList(new Object[][]{
-                {"V1d0", new GryoMessageSerializerV1d0(), v1d0Text},
-                {"V1d0Lite", new GryoLiteMessageSerializerV1d0(), v1d0LiteText },
-                {"V3d0", new GryoMessageSerializerV3d0(), v3d0Text}});
-    }
-
-    @Parameterized.Parameter(value = 0)
-    public String name;
-
-    @Parameterized.Parameter(value = 1)
-    public MessageSerializer binarySerializer;
-
-    @Parameterized.Parameter(value = 2)
-    public MessageSerializer textSerializer;
-
-    private static final Map<String, Object> config = new HashMap<String, Object>() {{
-        put(GryoMessageSerializerV1d0.TOKEN_SERIALIZE_RESULT_TO_STRING, true);
-    }};
-
-    private UUID requestId = UUID.fromString("6457272A-4018-4538-B9AE-08DD5DDC0AA1");
-    private ResponseMessage.Builder responseMessageBuilder = ResponseMessage.build(requestId);
-    private static ByteBufAllocator allocator = UnpooledByteBufAllocator.DEFAULT;
-
-    @Test
-    public void shouldConfigureIoRegistry() throws Exception {
-        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> config = new HashMap<String, Object>() {{
-            put(GryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES, Arrays.asList(ColorIoRegistry.class.getName()));
-        }};
-
-        serializer.configure(config, null);
-
-        final ResponseMessage toSerialize = ResponseMessage.build(requestId).result(Color.RED).create();
-        final ByteBuf bb = serializer.serializeResponseAsBinary(toSerialize, allocator);
-        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
-
-        assertCommon(deserialized);
-        assertEquals(Color.RED, deserialized.getResult().getData());
-    }
-
-    @Test
-    public void shouldConfigureIoRegistryInstance() throws Exception {
-        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> config = new HashMap<String, Object>() {{
-            put(GryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES, Arrays.asList(ColorIoRegistryInstance.class.getName()));
-        }};
-
-        serializer.configure(config, null);
-
-        final ResponseMessage toSerialize = ResponseMessage.build(requestId).result(Color.RED).create();
-        final ByteBuf bb = serializer.serializeResponseAsBinary(toSerialize, allocator);
-        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
-
-        assertCommon(deserialized);
-        assertEquals(Color.RED, deserialized.getResult().getData());
-    }
-
-    @Test
-    public void shouldConfigureIoRegistryGetInstance() throws Exception {
-        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> config = new HashMap<String, Object>() {{
-            put(GryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES, Arrays.asList(ColorIoRegistryGetInstance.class.getName()));
-        }};
-
-        serializer.configure(config, null);
-
-        final ResponseMessage toSerialize = ResponseMessage.build(requestId).result(Color.RED).create();
-        final ByteBuf bb = serializer.serializeResponseAsBinary(toSerialize, allocator);
-        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
-
-        assertCommon(deserialized);
-        assertEquals(Color.RED, deserialized.getResult().getData());
-    }
-
-    @Test
-    public void shouldConfigureCustomClassResolver() {
-        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> config = new HashMap<String, Object>() {{
-            put(GryoMessageSerializerV1d0.TOKEN_CLASS_RESOLVER_SUPPLIER, ErrorOnlyClassResolverSupplier.class.getName());
-        }};
-
-        serializer.configure(config, null);
-
-        try {
-            serializer.serializeResponseAsBinary(responseMessageBuilder.create(), allocator);
-            fail("Should fail because the ClassResolver used here always generates an error");
-        } catch (Exception ex) {
-            assertEquals("java.lang.RuntimeException: Registration is not allowed with this ClassResolver - it is not a good implementation", ex.getMessage());
-        }
-    }
-
-    @Test
-    public void shouldConfigureCustomClassResolverFromInstance() {
-        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> config = new HashMap<String, Object>() {{
-            put(GryoMessageSerializerV1d0.TOKEN_CLASS_RESOLVER_SUPPLIER, ErrorOnlyClassResolverSupplierAsInstance.class.getName());
-        }};
-
-        serializer.configure(config, null);
-
-        try {
-            serializer.serializeResponseAsBinary(responseMessageBuilder.create(), allocator);
-            fail("Should fail because the ClassResolver used here always generates an error");
-        } catch (Exception ex) {
-            assertEquals("java.lang.RuntimeException: Registration is not allowed with this ClassResolver - it is not a good implementation", ex.getMessage());
-        }
-    }
-
-    @Test
-    public void shouldConfigureCustomClassResolverFromGetInstance() {
-        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> config = new HashMap<String, Object>() {{
-            put(GryoMessageSerializerV1d0.TOKEN_CLASS_RESOLVER_SUPPLIER, ErrorOnlyClassResolverSupplierAsGetInstance.class.getName());
-        }};
-
-        serializer.configure(config, null);
-
-        try {
-            serializer.serializeResponseAsBinary(responseMessageBuilder.create(), allocator);
-            fail("Should fail because the ClassResolver used here always generates an error");
-        } catch (Exception ex) {
-            assertEquals("java.lang.RuntimeException: Registration is not allowed with this ClassResolver - it is not a good implementation", ex.getMessage());
-        }
-    }
-
-    @Test
-    public void shouldSerializeIterable() throws Exception {
-        final ArrayList<Integer> list = new ArrayList<>();
-        list.add(1);
-        list.add(100);
-
-        final ResponseMessage response = convertBinary(list);
-        assertCommon(response);
-
-        final java.util.List<Integer> deserializedFunList = (java.util.List<Integer>) response.getResult().getData();
-        assertEquals(2, deserializedFunList.size());
-        assertEquals(new Integer(1), deserializedFunList.get(0));
-        assertEquals(new Integer(100), deserializedFunList.get(1));
-    }
-
-    @Test
-    public void shouldSerializeIterableToString() throws Exception {
-        final ArrayList<Integer> list = new ArrayList<>();
-        list.add(1);
-        list.add(100);
-
-        final ResponseMessage response = convertText(list);
-        assertCommon(response);
-
-        final java.util.List deserializedFunList = (java.util.List) response.getResult().getData();
-        assertEquals(2, deserializedFunList.size());
-        assertEquals("1", deserializedFunList.get(0));
-        assertEquals("100", deserializedFunList.get(1));
-    }
-
-    @Test
-    public void shouldSerializeIterableToStringWithNull() throws Exception {
-        final ArrayList<Integer> list = new ArrayList<>();
-        list.add(1);
-        list.add(null);
-        list.add(100);
-
-        final ResponseMessage response = convertText(list);
-        assertCommon(response);
-
-        final java.util.List deserializedFunList = (java.util.List) response.getResult().getData();
-        assertEquals(3, deserializedFunList.size());
-        assertEquals("1", deserializedFunList.get(0).toString());
-        assertEquals("null", deserializedFunList.get(1).toString());
-        assertEquals("100", deserializedFunList.get(2).toString());
-    }
-
-    @Test
-    public void shouldSerializeIterableWithNull() throws Exception {
-        final ArrayList<Integer> list = new ArrayList<>();
-        list.add(1);
-        list.add(null);
-        list.add(100);
-
-        final ResponseMessage response = convertBinary(list);
-        assertCommon(response);
-
-        final java.util.List<Integer> deserializedFunList = (java.util.List<Integer>) response.getResult().getData();
-        assertEquals(3, deserializedFunList.size());
-        assertEquals(new Integer(1), deserializedFunList.get(0));
-        assertNull(deserializedFunList.get(1));
-        assertEquals(new Integer(100), deserializedFunList.get(2));
-    }
-
-    @Test
-    public void shouldSerializeMap() throws Exception {
-        final Map<String, Object> map = new HashMap<>();
-        final Map<String, String> innerMap = new HashMap<>();
-        innerMap.put("a", "b");
-
-        map.put("x", 1);
-        map.put("y", "some");
-        map.put("z", innerMap);
-
-        final ResponseMessage response = convertBinary(map);
-        assertCommon(response);
-
-        final Map<String, Object> deserializedMap = (Map<String, Object>) response.getResult().getData();
-        assertEquals(3, deserializedMap.size());
-        assertEquals(1, deserializedMap.get("x"));
-        assertEquals("some", deserializedMap.get("y"));
-
-        final Map<String, String> deserializedInnerMap = (Map<String, String>) deserializedMap.get("z");
-        assertEquals(1, deserializedInnerMap.size());
-        assertEquals("b", deserializedInnerMap.get("a"));
-    }
-
-    @Test
-    public void shouldSerializeMapEntry() throws Exception {
-        final Graph graph = TinkerGraph.open();
-        final Vertex v1 = graph.addVertex();
-        final Date d = new Date();
-
-        final Map<Object, Object> map = new HashMap<>();
-        map.put("x", 1);
-        map.put(v1, 100);
-        map.put(d, "test");
-
-        final ResponseMessage response = convertBinary(IteratorUtils.asList(map.entrySet()));
-        assertCommon(response);
-
-        final java.util.List<Map.Entry<Object, Object>> deserializedEntries = (java.util.List<Map.Entry<Object, Object>>) response.getResult().getData();
-        assertEquals(3, deserializedEntries.size());
-        deserializedEntries.forEach(e -> {
-            if (e.getKey().equals("x"))
-                assertEquals(1, e.getValue());
-            else if (e.getKey().equals(v1))
-                assertEquals(100, e.getValue());
-            else if (e.getKey().equals(d))
-                assertEquals("test", e.getValue());
-            else
-                fail("Map entries contains a key that is not part of what was serialized");
-        });
-    }
-
-    @Test
-    public void shouldSerializeTree() throws Exception {
-        final Graph g = TinkerFactory.createModern();
-        final Tree t = g.traversal().V().out().out().tree().by("name").next();
-
-        final ResponseMessage response = convertBinary(t);
-        assertCommon(response);
-
-        final Tree deserialized = (Tree) response.getResult().getData();
-        assertEquals(t, deserialized);
-
-        assertThat(deserialized.containsKey("marko"), is(true));
-        assertEquals(1, deserialized.size());
-
-        final Tree markoChildren = (Tree) deserialized.get("marko");
-        assertThat(markoChildren.containsKey("josh"), is(true));
-        assertEquals(1, markoChildren.size());
-
-        final Tree joshChildren = (Tree) markoChildren.get("josh");
-        assertThat(joshChildren.containsKey("lop"), is(true));
-        assertThat(joshChildren.containsKey("ripple"), is(true));
-        assertEquals(2, joshChildren.size());
-    }
-
-    @Test
-    public void shouldSerializeFullResponseMessage() throws Exception {
-        final UUID id = UUID.randomUUID();
-
-        final Map<String, Object> metaData = new HashMap<>();
-        metaData.put("test", "this");
-        metaData.put("one", 1);
-
-        final Map<String, Object> attributes = new HashMap<>();
-        attributes.put("test", "that");
-        attributes.put("two", 2);
-
-        final ResponseMessage response = ResponseMessage.build(id)
-                .responseMetaData(metaData)
-                .code(ResponseStatusCode.SUCCESS)
-                .result("some-result")
-                .statusAttributes(attributes)
-                .statusMessage("worked")
-                .create();
-
-        final ByteBuf bb = binarySerializer.serializeResponseAsBinary(response, allocator);
-        final ResponseMessage deserialized = binarySerializer.deserializeResponse(bb);
-
-        assertEquals(id, deserialized.getRequestId());
-        assertEquals("this", deserialized.getResult().getMeta().get("test"));
-        assertEquals(1, deserialized.getResult().getMeta().get("one"));
-        assertEquals("some-result", deserialized.getResult().getData());
-        assertEquals("that", deserialized.getStatus().getAttributes().get("test"));
-        assertEquals(2, deserialized.getStatus().getAttributes().get("two"));
-        assertEquals(ResponseStatusCode.SUCCESS.getValue(), deserialized.getStatus().getCode().getValue());
-        assertEquals("worked", deserialized.getStatus().getMessage());
-    }
-
-    @Test
-    public void shouldHaveTooSmallBufferToSerializeResponseMessage() throws Exception {
-        final UUID id = UUID.randomUUID();
-
-        final Map<String, Object> metaData = new HashMap<>();
-        metaData.put("test", "this");
-        metaData.put("one", 1);
-
-        final Map<String, Object> attributes = new HashMap<>();
-        attributes.put("test", "that");
-        attributes.put("two", 2);
-
-        final ResponseMessage response = ResponseMessage.build(id)
-                .responseMetaData(metaData)
-                .code(ResponseStatusCode.SUCCESS)
-                .result("some-result")
-                .statusAttributes(attributes)
-                .statusMessage("worked")
-                .create();
-
-        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
-            put("bufferSize", 1);
-        }};
-        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
-
-        try {
-            binarySerializerWithSmallBuffer.serializeResponseAsBinary(response, allocator);
-            fail("Should have a buffer size that is too small");
-        } catch (Exception ex) {
-            final Throwable root = ExceptionUtils.getRootCause(ex);
-            assertThat(root, instanceOf(KryoException.class));
-        }
-    }
-
-    @Test
-    public void shouldReturnAllBytesInResponse() throws Exception {
-        final UUID id = UUID.randomUUID();
-
-        final Map<String, Object> metaData = new HashMap<>();
-        metaData.put("test", "this");
-        metaData.put("one", 1);
-
-        final Map<String, Object> attributes = new HashMap<>();
-        attributes.put("test", "that");
-        attributes.put("two", 2);
-
-        final ResponseMessage response = ResponseMessage.build(id)
-                .responseMetaData(metaData)
-                .code(ResponseStatusCode.SUCCESS)
-                .result("some-result")
-                .statusAttributes(attributes)
-                .statusMessage("worked")
-                .create();
-
-        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
-            // set to bufferSize < total message size but still greater than any individual object requires
-            put("bufferSize", 50);
-        }};
-        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
-
-        final ByteBuf buf = binarySerializerWithSmallBuffer.serializeResponseAsBinary(response, allocator);
-        assertTrue(buf.isReadable());
-        assertEquals(82, buf.readableBytes());
-    }
-
-    @Test
-    public void shouldSerializeFullRequestMessage() throws Exception {
-        final UUID id = UUID.randomUUID();
-
-        final RequestMessage request = RequestMessage.build("try")
-                .overrideRequestId(id)
-                .processor("pro")
-                .addArg("test", "this")
-                .create();
-        final ByteBuf bb = binarySerializer.serializeRequestAsBinary(request, allocator);
-        final int mimeLen = bb.readByte();
-        bb.readBytes(new byte[mimeLen]);
-        final RequestMessage deserialized = binarySerializer.deserializeRequest(bb);
-
-        assertEquals(id, deserialized.getRequestId());
-        assertEquals("pro", deserialized.getProcessor());
-        assertEquals("try", deserialized.getOp());
-        assertEquals("this", deserialized.getArgs().get("test"));
-    }
-
-    @Test
-    public void shouldHaveTooSmallBufferToSerializeRequestMessage() throws Exception {
-        final UUID id = UUID.randomUUID();
-
-        final RequestMessage request = RequestMessage.build("try")
-                .overrideRequestId(id)
-                .processor("pro")
-                .addArg("test", "this")
-                .create();
-
-        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
-            put("bufferSize", 1);
-        }};
-        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
-
-        try {
-            binarySerializerWithSmallBuffer.serializeRequestAsBinary(request, allocator);
-            fail("Should have a buffer size that is too small");
-        } catch (Exception ex) {
-            final Throwable root = ExceptionUtils.getRootCause(ex);
-            assertThat(root, instanceOf(KryoException.class));
-        }
-    }
-
-    @Test
-    public void shouldReturnAllBytesInRequest() throws Exception {
-        final UUID id = UUID.randomUUID();
-
-        final RequestMessage request = RequestMessage.build("try")
-                .overrideRequestId(id)
-                .processor("pro")
-                .addArg("test", "this")
-                .create();
-
-        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
-        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
-            // set to bufferSize < total message size but still greater than any individual object requires
-            put("bufferSize", 50);
-        }};
-        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
-
-        ByteBuf buf = binarySerializerWithSmallBuffer.serializeRequestAsBinary(request, allocator);
-        assertTrue(buf.isReadable());
-        assertEquals(71, buf.readableBytes());
-    }
-
-    private void assertCommon(final ResponseMessage response) {
-        assertEquals(requestId, response.getRequestId());
-        assertEquals(ResponseStatusCode.SUCCESS, response.getStatus().getCode());
-    }
-
-    private ResponseMessage convertBinary(final Object toSerialize) throws SerializationException {
-        final ByteBuf bb = binarySerializer.serializeResponseAsBinary(responseMessageBuilder.result(toSerialize).create(), allocator);
-        return binarySerializer.deserializeResponse(bb);
-    }
-
-    private ResponseMessage convertText(final Object toSerialize) throws SerializationException {
-        final ByteBuf bb = textSerializer.serializeResponseAsBinary(responseMessageBuilder.result(toSerialize).create(), allocator);
-        return textSerializer.deserializeResponse(bb);
-    }
-
-    public static class ErrorOnlyClassResolverSupplierAsInstance implements Supplier<ClassResolver> {
-
-        private static final ErrorOnlyClassResolverSupplierAsInstance instance = new ErrorOnlyClassResolverSupplierAsInstance();
-
-        private ErrorOnlyClassResolverSupplierAsInstance() {}
-
-        public static ErrorOnlyClassResolverSupplierAsInstance instance() {
-            return instance;
-        }
-
-        @Override
-        public ClassResolver get() {
-            return new ErrorOnlyClassResolver();
-        }
-    }
-
-    public static class ErrorOnlyClassResolverSupplierAsGetInstance implements Supplier<ClassResolver> {
-
-        private static final ErrorOnlyClassResolverSupplierAsInstance instance = new ErrorOnlyClassResolverSupplierAsInstance();
-
-        private ErrorOnlyClassResolverSupplierAsGetInstance() {}
-
-        public static ErrorOnlyClassResolverSupplierAsInstance getInstance() {
-            return instance;
-        }
-
-        @Override
-        public ClassResolver get() {
-            return new ErrorOnlyClassResolver();
-        }
-    }
-
-    public static class ErrorOnlyClassResolverSupplier implements Supplier<ClassResolver> {
-        @Override
-        public ClassResolver get() {
-            return new ErrorOnlyClassResolver();
-        }
-    }
-
-    public static class ErrorOnlyClassResolver extends GryoClassResolverV1d0 {
-        @Override
-        public Registration getRegistration(Class clazz) {
-            throw new RuntimeException("Registration is not allowed with this ClassResolver - it is not a good implementation");
-        }
-    }
-
-    public static class ColorIoRegistry extends AbstractIoRegistry {
-        public ColorIoRegistry() {
-            register(GryoIo.class, Color.class, new ColorSerializer());
-        }
-    }
-
-    public static class ColorIoRegistryInstance extends AbstractIoRegistry {
-
-        private static final ColorIoRegistry instance = new ColorIoRegistry();
-
-        private ColorIoRegistryInstance() {
-            register(GryoIo.class, Color.class, new ColorSerializer());
-        }
-
-        public static ColorIoRegistry instance() {
-            return instance;
-        }
-    }
-
-    public static class ColorIoRegistryGetInstance extends AbstractIoRegistry {
-
-        private static final ColorIoRegistry instance = new ColorIoRegistry();
-
-        private ColorIoRegistryGetInstance() {
-            register(GryoIo.class, Color.class, new ColorSerializer());
-        }
-
-        public static ColorIoRegistry getInstance() {
-            return instance;
-        }
-    }
-
-    public static class ColorSerializer extends Serializer<Color> {
-        @Override
-        public void write(final Kryo kryo, final Output output, final Color color) {
-            output.write(color.equals(Color.RED) ? 1 : 0);
-        }
-
-        @Override
-        public Color read(final Kryo kryo, final Input input, final Class<Color> aClass) {
-            return input.read() == 1 ? Color.RED : Color.BLACK;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b9e5490b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java
index 36e17c0..9472033 100644
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java
@@ -21,36 +21,79 @@ package org.apache.tinkerpop.gremlin.driver.ser;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufAllocator;
 import io.netty.buffer.UnpooledByteBufAllocator;
+import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
+import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
 import org.apache.tinkerpop.gremlin.driver.message.ResponseMessage;
 import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.io.AbstractIoRegistry;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoClassResolverV1d0;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.apache.tinkerpop.shaded.kryo.ClassResolver;
+import org.apache.tinkerpop.shaded.kryo.Kryo;
+import org.apache.tinkerpop.shaded.kryo.KryoException;
+import org.apache.tinkerpop.shaded.kryo.Registration;
+import org.apache.tinkerpop.shaded.kryo.Serializer;
+import org.apache.tinkerpop.shaded.kryo.io.Input;
+import org.apache.tinkerpop.shaded.kryo.io.Output;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
 
+import java.awt.Color;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.UUID;
+import java.util.function.Supplier;
 
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsNot.not;
+import static org.hamcrest.core.StringContains.containsString;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeThat;
 
 /**
  * Serializer tests that cover non-lossy serialization/deserialization methods.
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
+@RunWith(Parameterized.class)
 public class GryoMessageSerializerV1d0Test {
-    private static final Map<String, Object> config = new HashMap<String, Object>() {{
+    @Parameterized.Parameters(name = "expect({0})")
+    public static Iterable<Object[]> data() {
+        return Arrays.asList(new Object[][]{
+                {"V1d0", (Supplier<?>) GryoMessageSerializerV1d0::new},
+                {"V1d0Lite", (Supplier<?>) GryoLiteMessageSerializerV1d0::new },
+                {"V3d0", (Supplier<?>) GryoMessageSerializerV3d0::new}});
+    }
+
+    @Parameterized.Parameter(value = 0)
+    public String name;
+
+    @Parameterized.Parameter(value = 1)
+    public Supplier<MessageSerializer> serializerSupplier;
+
+    private static final Map<String, Object> configForText = new HashMap<String, Object>() {{
         put(GryoMessageSerializerV1d0.TOKEN_SERIALIZE_RESULT_TO_STRING, true);
     }};
 
@@ -58,10 +101,421 @@ public class GryoMessageSerializerV1d0Test {
     private ResponseMessage.Builder responseMessageBuilder = ResponseMessage.build(requestId);
     private static ByteBufAllocator allocator = UnpooledByteBufAllocator.DEFAULT;
 
-    public MessageSerializer binarySerializer = new GryoMessageSerializerV1d0();
+    @Test
+    public void shouldConfigureIoRegistry() throws Exception {
+        final Map<String, Object> config = new HashMap<String, Object>() {{
+            put(GryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES, Collections.singletonList(ColorIoRegistry.class.getName()));
+        }};
+
+        final MessageSerializer serializer = serializerSupplier.get();
+        serializer.configure(config, null);
+
+        final ResponseMessage toSerialize = ResponseMessage.build(requestId).result(Color.RED).create();
+        final ByteBuf bb = serializer.serializeResponseAsBinary(toSerialize, allocator);
+        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
+
+        assertCommon(deserialized);
+        assertEquals(Color.RED, deserialized.getResult().getData());
+    }
+
+    @Test
+    public void shouldConfigureIoRegistryInstance() throws Exception {
+        final Map<String, Object> config = new HashMap<String, Object>() {{
+            put(GryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES, Collections.singletonList(ColorIoRegistryInstance.class.getName()));
+        }};
+
+        final MessageSerializer serializer = serializerSupplier.get();
+        serializer.configure(config, null);
+
+        final ResponseMessage toSerialize = ResponseMessage.build(requestId).result(Color.RED).create();
+        final ByteBuf bb = serializer.serializeResponseAsBinary(toSerialize, allocator);
+        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
+
+        assertCommon(deserialized);
+        assertEquals(Color.RED, deserialized.getResult().getData());
+    }
+
+    @Test
+    public void shouldConfigureIoRegistryGetInstance() throws Exception {
+        final Map<String, Object> config = new HashMap<String, Object>() {{
+            put(GryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES, Collections.singletonList(ColorIoRegistryGetInstance.class.getName()));
+        }};
+
+        final MessageSerializer serializer = serializerSupplier.get();
+        serializer.configure(config, null);
+
+        final ResponseMessage toSerialize = ResponseMessage.build(requestId).result(Color.RED).create();
+        final ByteBuf bb = serializer.serializeResponseAsBinary(toSerialize, allocator);
+        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
+
+        assertCommon(deserialized);
+        assertEquals(Color.RED, deserialized.getResult().getData());
+    }
+
+    @Test
+    public void shouldConfigureCustomClassResolver() {
+        final Map<String, Object> config = new HashMap<String, Object>() {{
+            put(GryoMessageSerializerV1d0.TOKEN_CLASS_RESOLVER_SUPPLIER, ErrorOnlyClassResolverSupplier.class.getName());
+        }};
+
+        final MessageSerializer serializer = serializerSupplier.get();
+        serializer.configure(config, null);
+
+        try {
+            serializer.serializeResponseAsBinary(responseMessageBuilder.create(), allocator);
+            fail("Should fail because the ClassResolver used here always generates an error");
+        } catch (Exception ex) {
+            assertEquals("java.lang.RuntimeException: Registration is not allowed with this ClassResolver - it is not a good implementation", ex.getMessage());
+        }
+    }
+
+    @Test
+    public void shouldConfigureCustomClassResolverFromInstance() {
+        final Map<String, Object> config = new HashMap<String, Object>() {{
+            put(GryoMessageSerializerV1d0.TOKEN_CLASS_RESOLVER_SUPPLIER, ErrorOnlyClassResolverSupplierAsInstance.class.getName());
+        }};
+
+        final MessageSerializer serializer = serializerSupplier.get();
+        serializer.configure(config, null);
+
+        try {
+            serializer.serializeResponseAsBinary(responseMessageBuilder.create(), allocator);
+            fail("Should fail because the ClassResolver used here always generates an error");
+        } catch (Exception ex) {
+            assertEquals("java.lang.RuntimeException: Registration is not allowed with this ClassResolver - it is not a good implementation", ex.getMessage());
+        }
+    }
+
+    @Test
+    public void shouldConfigureCustomClassResolverFromGetInstance() {
+        final Map<String, Object> config = new HashMap<String, Object>() {{
+            put(GryoMessageSerializerV1d0.TOKEN_CLASS_RESOLVER_SUPPLIER, ErrorOnlyClassResolverSupplierAsGetInstance.class.getName());
+        }};
+
+        final MessageSerializer serializer = serializerSupplier.get();
+        serializer.configure(config, null);
+
+        try {
+            serializer.serializeResponseAsBinary(responseMessageBuilder.create(), allocator);
+            fail("Should fail because the ClassResolver used here always generates an error");
+        } catch (Exception ex) {
+            assertEquals("java.lang.RuntimeException: Registration is not allowed with this ClassResolver - it is not a good implementation", ex.getMessage());
+        }
+    }
+
+    @Test
+    public void shouldSerializeIterable() throws Exception {
+        final ArrayList<Integer> list = new ArrayList<>();
+        list.add(1);
+        list.add(100);
+
+        final ResponseMessage response = convertBinary(list);
+        assertCommon(response);
+
+        final java.util.List<Integer> deserializedFunList = (java.util.List<Integer>) response.getResult().getData();
+        assertEquals(2, deserializedFunList.size());
+        assertEquals(new Integer(1), deserializedFunList.get(0));
+        assertEquals(new Integer(100), deserializedFunList.get(1));
+    }
+
+    @Test
+    public void shouldSerializeIterableToString() throws Exception {
+        final ArrayList<Integer> list = new ArrayList<>();
+        list.add(1);
+        list.add(100);
+
+        final ResponseMessage response = convertText(list);
+        assertCommon(response);
+
+        final java.util.List deserializedFunList = (java.util.List) response.getResult().getData();
+        assertEquals(2, deserializedFunList.size());
+        assertEquals("1", deserializedFunList.get(0));
+        assertEquals("100", deserializedFunList.get(1));
+    }
+
+    @Test
+    public void shouldSerializeIterableToStringWithNull() throws Exception {
+        final ArrayList<Integer> list = new ArrayList<>();
+        list.add(1);
+        list.add(null);
+        list.add(100);
+
+        final ResponseMessage response = convertText(list);
+        assertCommon(response);
+
+        final java.util.List deserializedFunList = (java.util.List) response.getResult().getData();
+        assertEquals(3, deserializedFunList.size());
+        assertEquals("1", deserializedFunList.get(0).toString());
+        assertEquals("null", deserializedFunList.get(1).toString());
+        assertEquals("100", deserializedFunList.get(2).toString());
+    }
+
+    @Test
+    public void shouldSerializeIterableWithNull() throws Exception {
+        final ArrayList<Integer> list = new ArrayList<>();
+        list.add(1);
+        list.add(null);
+        list.add(100);
+
+        final ResponseMessage response = convertBinary(list);
+        assertCommon(response);
+
+        final java.util.List<Integer> deserializedFunList = (java.util.List<Integer>) response.getResult().getData();
+        assertEquals(3, deserializedFunList.size());
+        assertEquals(new Integer(1), deserializedFunList.get(0));
+        assertNull(deserializedFunList.get(1));
+        assertEquals(new Integer(100), deserializedFunList.get(2));
+    }
+
+    @Test
+    public void shouldSerializeMap() throws Exception {
+        final Map<String, Object> map = new HashMap<>();
+        final Map<String, String> innerMap = new HashMap<>();
+        innerMap.put("a", "b");
+
+        map.put("x", 1);
+        map.put("y", "some");
+        map.put("z", innerMap);
+
+        final ResponseMessage response = convertBinary(map);
+        assertCommon(response);
+
+        final Map<String, Object> deserializedMap = (Map<String, Object>) response.getResult().getData();
+        assertEquals(3, deserializedMap.size());
+        assertEquals(1, deserializedMap.get("x"));
+        assertEquals("some", deserializedMap.get("y"));
+
+        final Map<String, String> deserializedInnerMap = (Map<String, String>) deserializedMap.get("z");
+        assertEquals(1, deserializedInnerMap.size());
+        assertEquals("b", deserializedInnerMap.get("a"));
+    }
+
+    @Test
+    public void shouldSerializeMapEntry() throws Exception {
+        final Graph graph = TinkerGraph.open();
+        final Vertex v1 = graph.addVertex();
+        final Date d = new Date();
+
+        final Map<Object, Object> map = new HashMap<>();
+        map.put("x", 1);
+        map.put(v1, 100);
+        map.put(d, "test");
+
+        final ResponseMessage response = convertBinary(IteratorUtils.asList(map.entrySet()));
+        assertCommon(response);
+
+        final java.util.List<Map.Entry<Object, Object>> deserializedEntries = (java.util.List<Map.Entry<Object, Object>>) response.getResult().getData();
+        assertEquals(3, deserializedEntries.size());
+        deserializedEntries.forEach(e -> {
+            if (e.getKey().equals("x"))
+                assertEquals(1, e.getValue());
+            else if (e.getKey().equals(v1))
+                assertEquals(100, e.getValue());
+            else if (e.getKey().equals(d))
+                assertEquals("test", e.getValue());
+            else
+                fail("Map entries contains a key that is not part of what was serialized");
+        });
+    }
+
+    @Test
+    public void shouldSerializeTree() throws Exception {
+        final Graph g = TinkerFactory.createModern();
+        final Tree t = g.traversal().V().out().out().tree().by("name").next();
+
+        final ResponseMessage response = convertBinary(t);
+        assertCommon(response);
+
+        final Tree deserialized = (Tree) response.getResult().getData();
+        assertEquals(t, deserialized);
+
+        assertThat(deserialized.containsKey("marko"), is(true));
+        assertEquals(1, deserialized.size());
+
+        final Tree markoChildren = (Tree) deserialized.get("marko");
+        assertThat(markoChildren.containsKey("josh"), is(true));
+        assertEquals(1, markoChildren.size());
+
+        final Tree joshChildren = (Tree) markoChildren.get("josh");
+        assertThat(joshChildren.containsKey("lop"), is(true));
+        assertThat(joshChildren.containsKey("ripple"), is(true));
+        assertEquals(2, joshChildren.size());
+    }
+
+    @Test
+    public void shouldSerializeFullResponseMessage() throws Exception {
+        final UUID id = UUID.randomUUID();
+
+        final Map<String, Object> metaData = new HashMap<>();
+        metaData.put("test", "this");
+        metaData.put("one", 1);
+
+        final Map<String, Object> attributes = new HashMap<>();
+        attributes.put("test", "that");
+        attributes.put("two", 2);
+
+        final ResponseMessage response = ResponseMessage.build(id)
+                .responseMetaData(metaData)
+                .code(ResponseStatusCode.SUCCESS)
+                .result("some-result")
+                .statusAttributes(attributes)
+                .statusMessage("worked")
+                .create();
+
+        final MessageSerializer serializer = serializerSupplier.get();
+        final ByteBuf bb = serializer.serializeResponseAsBinary(response, allocator);
+        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
+
+        assertEquals(id, deserialized.getRequestId());
+        assertEquals("this", deserialized.getResult().getMeta().get("test"));
+        assertEquals(1, deserialized.getResult().getMeta().get("one"));
+        assertEquals("some-result", deserialized.getResult().getData());
+        assertEquals("that", deserialized.getStatus().getAttributes().get("test"));
+        assertEquals(2, deserialized.getStatus().getAttributes().get("two"));
+        assertEquals(ResponseStatusCode.SUCCESS.getValue(), deserialized.getStatus().getCode().getValue());
+        assertEquals("worked", deserialized.getStatus().getMessage());
+    }
+
+    @Test
+    public void shouldHaveTooSmallBufferToSerializeResponseMessage() throws Exception {
+        final UUID id = UUID.randomUUID();
+
+        final Map<String, Object> metaData = new HashMap<>();
+        metaData.put("test", "this");
+        metaData.put("one", 1);
+
+        final Map<String, Object> attributes = new HashMap<>();
+        attributes.put("test", "that");
+        attributes.put("two", 2);
+
+        final ResponseMessage response = ResponseMessage.build(id)
+                .responseMetaData(metaData)
+                .code(ResponseStatusCode.SUCCESS)
+                .result("some-result")
+                .statusAttributes(attributes)
+                .statusMessage("worked")
+                .create();
+
+        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
+        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
+            put("bufferSize", 1);
+        }};
+        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
+
+        try {
+            binarySerializerWithSmallBuffer.serializeResponseAsBinary(response, allocator);
+            fail("Should have a buffer size that is too small");
+        } catch (Exception ex) {
+            final Throwable root = ExceptionUtils.getRootCause(ex);
+            assertThat(root, instanceOf(KryoException.class));
+        }
+    }
+
+    @Test
+    public void shouldReturnAllBytesInResponse() throws Exception {
+        final UUID id = UUID.randomUUID();
+
+        final Map<String, Object> metaData = new HashMap<>();
+        metaData.put("test", "this");
+        metaData.put("one", 1);
+
+        final Map<String, Object> attributes = new HashMap<>();
+        attributes.put("test", "that");
+        attributes.put("two", 2);
+
+        final ResponseMessage response = ResponseMessage.build(id)
+                .responseMetaData(metaData)
+                .code(ResponseStatusCode.SUCCESS)
+                .result("some-result")
+                .statusAttributes(attributes)
+                .statusMessage("worked")
+                .create();
+
+        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
+        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
+            // set to bufferSize < total message size but still greater than any individual object requires
+            put("bufferSize", 50);
+        }};
+        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
+
+        final ByteBuf buf = binarySerializerWithSmallBuffer.serializeResponseAsBinary(response, allocator);
+        assertTrue(buf.isReadable());
+        assertEquals(82, buf.readableBytes());
+    }
+
+    @Test
+    public void shouldSerializeFullRequestMessage() throws Exception {
+        final UUID id = UUID.randomUUID();
+
+        final RequestMessage request = RequestMessage.build("try")
+                .overrideRequestId(id)
+                .processor("pro")
+                .addArg("test", "this")
+                .create();
+
+        final MessageSerializer serializer = serializerSupplier.get();
+        final ByteBuf bb = serializer.serializeRequestAsBinary(request, allocator);
+        final int mimeLen = bb.readByte();
+        bb.readBytes(new byte[mimeLen]);
+        final RequestMessage deserialized = serializer.deserializeRequest(bb);
+
+        assertEquals(id, deserialized.getRequestId());
+        assertEquals("pro", deserialized.getProcessor());
+        assertEquals("try", deserialized.getOp());
+        assertEquals("this", deserialized.getArgs().get("test"));
+    }
+
+    @Test
+    public void shouldHaveTooSmallBufferToSerializeRequestMessage() throws Exception {
+        final UUID id = UUID.randomUUID();
+
+        final RequestMessage request = RequestMessage.build("try")
+                .overrideRequestId(id)
+                .processor("pro")
+                .addArg("test", "this")
+                .create();
+
+        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
+        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
+            put("bufferSize", 1);
+        }};
+        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
+
+        try {
+            binarySerializerWithSmallBuffer.serializeRequestAsBinary(request, allocator);
+            fail("Should have a buffer size that is too small");
+        } catch (Exception ex) {
+            final Throwable root = ExceptionUtils.getRootCause(ex);
+            assertThat(root, instanceOf(KryoException.class));
+        }
+    }
+
+    @Test
+    public void shouldReturnAllBytesInRequest() throws Exception {
+        final UUID id = UUID.randomUUID();
+
+        final RequestMessage request = RequestMessage.build("try")
+                .overrideRequestId(id)
+                .processor("pro")
+                .addArg("test", "this")
+                .create();
+
+        final MessageSerializer binarySerializerWithSmallBuffer = new GryoMessageSerializerV1d0();
+        final Map<String, Object> configWithSmallBuffer = new HashMap<String, Object>() {{
+            // set to bufferSize < total message size but still greater than any individual object requires
+            put("bufferSize", 50);
+        }};
+        binarySerializerWithSmallBuffer.configure(configWithSmallBuffer, null);
+
+        ByteBuf buf = binarySerializerWithSmallBuffer.serializeRequestAsBinary(request, allocator);
+        assertTrue(buf.isReadable());
+        assertEquals(71, buf.readableBytes());
+    }
 
     @Test
     public void shouldSerializeEdge() throws Exception {
+        assumeThat(name, not(containsString("V1d0Lite")));
+
         final Graph g = TinkerGraph.open();
         final Vertex v1 = g.addVertex();
         final Vertex v2 = g.addVertex();
@@ -73,7 +527,7 @@ public class GryoMessageSerializerV1d0Test {
         final ResponseMessage response = convertBinary(iterable);
         assertCommon(response);
 
-        final List<DetachedEdge> edgeList = (List<DetachedEdge>) response.getResult().getData();
+        final java.util.List<DetachedEdge> edgeList = (java.util.List<DetachedEdge>) response.getResult().getData();
         assertEquals(1, edgeList.size());
 
         final DetachedEdge deserializedEdge = edgeList.get(0);
@@ -90,6 +544,8 @@ public class GryoMessageSerializerV1d0Test {
 
     @Test
     public void shouldSerializeVertexWithEmbeddedMap() throws Exception {
+        assumeThat(name, not(containsString("V1d0Lite")));
+
         final Graph g = TinkerGraph.open();
         final Vertex v = g.addVertex();
         final Map<String, Object> map = new HashMap<>();
@@ -103,12 +559,12 @@ public class GryoMessageSerializerV1d0Test {
 
         v.property(VertexProperty.Cardinality.single, "friends", friends);
 
-        final List list = IteratorUtils.list(g.vertices());
+        final java.util.List list = IteratorUtils.list(g.vertices());
 
         final ResponseMessage response = convertBinary(list);
         assertCommon(response);
 
-        final List<DetachedVertex> vertexList = (List<DetachedVertex>) response.getResult().getData();
+        final java.util.List<DetachedVertex> vertexList = (java.util.List<DetachedVertex>) response.getResult().getData();
         assertEquals(1, vertexList.size());
 
         final DetachedVertex deserializedVertex = vertexList.get(0);
@@ -117,7 +573,7 @@ public class GryoMessageSerializerV1d0Test {
 
         assertEquals(1, IteratorUtils.count(deserializedVertex.properties()));
 
-        final List<Object> deserializedInnerList = (List<Object>) deserializedVertex.values("friends").next();
+        final java.util.List<Object> deserializedInnerList = (java.util.List<Object>) deserializedVertex.values("friends").next();
         assertEquals(3, deserializedInnerList.size());
         assertEquals("x", deserializedInnerList.get(0));
         assertEquals(5, deserializedInnerList.get(1));
@@ -130,6 +586,8 @@ public class GryoMessageSerializerV1d0Test {
 
     @Test
     public void shouldSerializeToMapWithElementForKey() throws Exception {
+        assumeThat(name, not(containsString("V1d0Lite")));
+
         final TinkerGraph graph = TinkerFactory.createClassic();
         final GraphTraversalSource g = graph.traversal();
         final Map<Vertex, Integer> map = new HashMap<>();
@@ -151,13 +609,112 @@ public class GryoMessageSerializerV1d0Test {
         assertEquals(new Integer(1000), deserializedMap.values().iterator().next());
     }
 
+
     private void assertCommon(final ResponseMessage response) {
         assertEquals(requestId, response.getRequestId());
         assertEquals(ResponseStatusCode.SUCCESS, response.getStatus().getCode());
     }
 
     private ResponseMessage convertBinary(final Object toSerialize) throws SerializationException {
-        final ByteBuf bb = binarySerializer.serializeResponseAsBinary(responseMessageBuilder.result(toSerialize).create(), allocator);
-        return binarySerializer.deserializeResponse(bb);
+        final MessageSerializer serializer = serializerSupplier.get();
+        final ByteBuf bb = serializer.serializeResponseAsBinary(responseMessageBuilder.result(toSerialize).create(), allocator);
+        return serializer.deserializeResponse(bb);
+    }
+
+    private ResponseMessage convertText(final Object toSerialize) throws SerializationException {
+        final MessageSerializer serializer = serializerSupplier.get();
+        serializer.configure(configForText, null);
+        final ByteBuf bb = serializer.serializeResponseAsBinary(responseMessageBuilder.result(toSerialize).create(), allocator);
+        return serializer.deserializeResponse(bb);
+    }
+
+    public static class ErrorOnlyClassResolverSupplierAsInstance implements Supplier<ClassResolver> {
+
+        private static final ErrorOnlyClassResolverSupplierAsInstance instance = new ErrorOnlyClassResolverSupplierAsInstance();
+
+        private ErrorOnlyClassResolverSupplierAsInstance() {}
+
+        public static ErrorOnlyClassResolverSupplierAsInstance instance() {
+            return instance;
+        }
+
+        @Override
+        public ClassResolver get() {
+            return new ErrorOnlyClassResolver();
+        }
+    }
+
+    public static class ErrorOnlyClassResolverSupplierAsGetInstance implements Supplier<ClassResolver> {
+
+        private static final ErrorOnlyClassResolverSupplierAsInstance instance = new ErrorOnlyClassResolverSupplierAsInstance();
+
+        private ErrorOnlyClassResolverSupplierAsGetInstance() {}
+
+        public static ErrorOnlyClassResolverSupplierAsInstance getInstance() {
+            return instance;
+        }
+
+        @Override
+        public ClassResolver get() {
+            return new ErrorOnlyClassResolver();
+        }
+    }
+
+    public static class ErrorOnlyClassResolverSupplier implements Supplier<ClassResolver> {
+        @Override
+        public ClassResolver get() {
+            return new ErrorOnlyClassResolver();
+        }
+    }
+
+    public static class ErrorOnlyClassResolver extends GryoClassResolverV1d0 {
+        @Override
+        public Registration getRegistration(Class clazz) {
+            throw new RuntimeException("Registration is not allowed with this ClassResolver - it is not a good implementation");
+        }
+    }
+
+    public static class ColorIoRegistry extends AbstractIoRegistry {
+        public ColorIoRegistry() {
+            register(GryoIo.class, Color.class, new ColorSerializer());
+        }
+    }
+
+    public static class ColorIoRegistryInstance extends AbstractIoRegistry {
+
+        private static final ColorIoRegistry instance = new ColorIoRegistry();
+
+        private ColorIoRegistryInstance() {
+            register(GryoIo.class, Color.class, new ColorSerializer());
+        }
+
+        public static ColorIoRegistry instance() {
+            return instance;
+        }
+    }
+
+    public static class ColorIoRegistryGetInstance extends AbstractIoRegistry {
+
+        private static final ColorIoRegistry instance = new ColorIoRegistry();
+
+        private ColorIoRegistryGetInstance() {
+            register(GryoIo.class, Color.class, new ColorSerializer());
+        }
+
+        public static ColorIoRegistry getInstance() {
+            return instance;
+        }
+    }
+
+    public static class ColorSerializer extends Serializer<Color> {
+        @Override
+        public void write(final Kryo kryo, final Output output, final Color color) {
+            output.write(color.equals(Color.RED) ? 1 : 0);
+        }
+
+        @Override
+        public Color read(final Kryo kryo, final Input input, final Class<Color> aClass) {
+            return input.read() == 1 ? Color.RED : Color.BLACK;
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b9e5490b/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 0c8cbdd..f664b1e 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
@@ -44,7 +44,11 @@ import static org.apache.tinkerpop.gremlin.structure.Graph.Features.GraphFeature
 import static org.apache.tinkerpop.gremlin.structure.Graph.Features.VariableFeatures.FEATURE_VARIABLES;
 import static org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexFeatures.FEATURE_USER_SUPPLIED_IDS;
 import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 import static org.junit.Assume.assumeFalse;
 import static org.junit.Assume.assumeThat;
 


[50/50] [abbrv] tinkerpop git commit: TINKERPOP-1686 Regenerated gryo files for metrics after gryo 3.0 work

Posted by sp...@apache.org.
TINKERPOP-1686 Regenerated gryo files for metrics after gryo 3.0 work


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

Branch: refs/heads/TINKERPOP-1686
Commit: dee27e33725337c9cddad33f6c3f8cd310203a3c
Parents: 19a573c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jul 11 08:44:26 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 11 08:44:26 2017 -0400

----------------------------------------------------------------------
 .../structure/io/gryo/_3_3_0/metrics-v3d0.kryo     | Bin 193 -> 184 bytes
 .../io/gryo/_3_3_0/traversalmetrics-v3d0.kryo      | Bin 455 -> 308 bytes
 2 files changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dee27e33/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo
index 39aa210..f65dd63 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dee27e33/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo
index b9d8ae8..5ec44fd 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo differ


[11/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1169'

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


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

Branch: refs/heads/TINKERPOP-1686
Commit: 8343072ffe97699c04f5b036de29faa3c8e9cee4
Parents: 69053b9 6a4fcaf
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jul 5 07:16:13 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jul 5 07:16:13 2017 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  2 +
 docs/src/upgrade/release-3.3.x.asciidoc         |  2 +
 .../traversal/util/TraversalScriptFunction.java | 71 --------------------
 .../traversal/util/TraversalScriptHelper.java   | 55 ---------------
 4 files changed, 4 insertions(+), 126 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8343072f/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --cc CHANGELOG.asciidoc
index 3a61c49,989a0c7..6f47550
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@@ -26,8 -26,8 +26,10 @@@ image::https://raw.githubusercontent.co
  TinkerPop 3.3.0 (Release Date: NOT OFFICIALLY RELEASED YET)
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
 +* Removed previously deprecated `TraversalSource.Builder` class.
 +* Removed previously deprecated `ConnectiveP`, `AndP`, `OrP` constructors.
+ * Removed previously deprecated `TraversalScriptFunction` class.
+ * Removed previously deprecated `TraversalScriptHelper` class.
  * Graphite and Ganglia are no longer packaged with the Gremlin Server distribution.
  * `TransactionException` is no longer a class of `AbstractTransaction` and it extends `RuntimeException`.
  * Included an ellipse on long property names that are truncated.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8343072f/docs/src/upgrade/release-3.3.x.asciidoc
----------------------------------------------------------------------
diff --cc docs/src/upgrade/release-3.3.x.asciidoc
index 04e5615,3ef6bf0..ececefa
--- a/docs/src/upgrade/release-3.3.x.asciidoc
+++ b/docs/src/upgrade/release-3.3.x.asciidoc
@@@ -202,10 -202,8 +202,12 @@@ The following deprecated classes, metho
  ** `org.apache.tinkerpop.gremlin.jsr223.SingleGremlinScriptEngineManager#getInstance()`
  ** `org.apache.tinkerpop.gremlin.jsr223.GremlinScriptEngineManager#addModule(GremlinModule)`
  ** `org.apache.tinkerpop.gremlin.jsr223.console.PluginAcceptor`
 +** `org.apache.tinkerpop.gremlin.process.traversal.TraversalSource.Builder`
 +** `org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP(P...)`
 +** `org.apache.tinkerpop.gremlin.process.traversal.util.AndP(P...)`
 +** `org.apache.tinkerpop.gremlin.process.traversal.util.OrP(P...)`
+ ** `org.apache.tinkerpop.gremlin.process.traversal.util.TraversalScriptFunction`
+ ** `org.apache.tinkerpop.gremlin.process.traversal.util.TraversalScriptHelper`
  ** `org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexPropertyFeatures#supportsAddProperty()`
  ** `org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexPropertyFeatures#FEATURE_ADD_PROPERTY`
  ** `org.apache.tinkerpop.gremlin.structure.Graph.OptIn#SUITE_GROOVY_PROCESS_STANDARD`


[22/50] [abbrv] tinkerpop git commit: Didn't account for a null value in the config

Posted by sp...@apache.org.
Didn't account for a null value in the config

When the warn message got added it didn't account for null configs. CTR


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

Branch: refs/heads/TINKERPOP-1686
Commit: 402678b1bb6bfb9f6c94dd1281969018d1b2637a
Parents: 77d6dfd
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jul 6 10:13:18 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Jul 6 10:17:49 2017 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/server/AbstractChannelizer.java       | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/402678b1/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
index 0a784d9..476cdd5 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
@@ -200,16 +200,17 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
                 }
 
                 final MessageSerializer serializer = (MessageSerializer) clazz.newInstance();
-                final Map<String, Graph> graphsDefinedAtStartup = new HashMap<String, Graph>();
+                final Map<String, Graph> graphsDefinedAtStartup = new HashMap<>();
                 for (String graphName : settings.graphs.keySet()) {
                     graphsDefinedAtStartup.put(graphName, graphManager.getGraph(graphName));
                 }
 
-                if (config.config.containsKey(AbstractGryoMessageSerializerV1d0.TOKEN_USE_MAPPER_FROM_GRAPH))
-                    logger.warn("{} utilizes the {} configuration setting which is deprecated - prefer use of {}", config.className, AbstractGryoMessageSerializerV1d0.TOKEN_USE_MAPPER_FROM_GRAPH, AbstractGryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES);
+                if (config.config != null) {
+                    if (config.config.containsKey(AbstractGryoMessageSerializerV1d0.TOKEN_USE_MAPPER_FROM_GRAPH))
+                        logger.warn("{} utilizes the {} configuration setting which is deprecated - prefer use of {}", config.className, AbstractGryoMessageSerializerV1d0.TOKEN_USE_MAPPER_FROM_GRAPH, AbstractGryoMessageSerializerV1d0.TOKEN_IO_REGISTRIES);
 
-                if (config.config != null)
                     serializer.configure(config.config, graphsDefinedAtStartup);
+                }
 
                 return Optional.ofNullable(serializer);
             } catch (ClassNotFoundException cnfe) {


[46/50] [abbrv] tinkerpop git commit: TINKERPOP-1686 No need for LinkedHashMap

Posted by sp...@apache.org.
TINKERPOP-1686 No need for LinkedHashMap

Order can be determined by the key which is the step number essentially. Had to regenerate the model for IO tests, but this ends up being a breaking change in gryo.


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

Branch: refs/heads/TINKERPOP-1686
Commit: 4ec69216c9ab23bf09eb9434d96ab6fb3ca14726
Parents: 4a5efab
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 19 16:33:03 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 11 08:04:15 2017 -0400

----------------------------------------------------------------------
 .../traversal/util/DefaultTraversalMetrics.java    |   8 +++++---
 .../tinkerpop/gremlin/structure/io/Model.java      |   6 +++---
 .../structure/io/gryo/_3_3_0/metrics-v1d0.kryo     | Bin 187 -> 189 bytes
 .../structure/io/gryo/_3_3_0/metrics-v3d0.kryo     | Bin 184 -> 189 bytes
 .../io/gryo/_3_3_0/traversalmetrics-v1d0.kryo      | Bin 306 -> 439 bytes
 .../io/gryo/_3_3_0/traversalmetrics-v3d0.kryo      | Bin 308 -> 439 bytes
 6 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4ec69216/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
index 9d4adaf..6053c9c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
@@ -33,7 +33,7 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
 
 /**
  * Default implementation for {@link TraversalMetrics} that aggregates {@link ImmutableMetrics} instances from a
@@ -62,7 +62,7 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
     /**
      * {@link ImmutableMetrics} indexed by their step position.
      */
-    private Map<Integer, ImmutableMetrics> positionIndexedMetrics = new LinkedHashMap<>();
+    private Map<Integer, ImmutableMetrics> positionIndexedMetrics = new HashMap<>();
 
     /**
      * Determines if final metrics have been computed
@@ -100,7 +100,9 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
 
     @Override
     public Collection<ImmutableMetrics> getMetrics() {
-        return this.positionIndexedMetrics.values();
+        return positionIndexedMetrics.entrySet().stream().sorted(Map.Entry.comparingByKey()).
+                collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
+                (oldValue, newValue) -> oldValue, LinkedHashMap::new)).values();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4ec69216/gremlin-tools/gremlin-io-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/Model.java
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/Model.java b/gremlin-tools/gremlin-io-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/Model.java
index 9b144fe..e10dc11 100644
--- a/gremlin-tools/gremlin-io-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/Model.java
+++ b/gremlin-tools/gremlin-io-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/Model.java
@@ -36,7 +36,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMetrics;
 import org.apache.tinkerpop.gremlin.structure.Column;
 import org.apache.tinkerpop.gremlin.structure.Direction;
-import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONCompatibility;
@@ -104,6 +103,7 @@ public class Model {
         final GraphTraversalSource g = graph.traversal();
 
         final Compatibility[] noTypeGraphSONPlusGryo3_2_3 = Compatibilities.with(GryoCompatibility.class).beforeRelease("3.2.4").join(Compatibilities.UNTYPED_GRAPHSON).matchToArray();
+        final Compatibility[] noTypeGraphSONPlusGryo3_3_0 = Compatibilities.with(GryoCompatibility.class).beforeRelease("3.3.0").join(Compatibilities.UNTYPED_GRAPHSON).matchToArray();
 
         // IMPORTANT - the "title" or name of the Entry needs to be unique
 
@@ -143,7 +143,7 @@ public class Model {
         final TraversalMetrics tm = createStaticTraversalMetrics();
         final MutableMetrics metrics = new MutableMetrics(tm.getMetrics("7.0.0()"));
         metrics.addNested(new MutableMetrics(tm.getMetrics("3.0.0()")));
-        addGraphProcessEntry(metrics, "Metrics", "", Compatibilities.UNTYPED_GRAPHSON.matchToArray());
+        addGraphProcessEntry(metrics, "Metrics", "", noTypeGraphSONPlusGryo3_3_0);
         addGraphProcessEntry(P.gt(0), "P", "", Compatibilities.UNTYPED_GRAPHSON.matchToArray());
         // A bug in the the Gryo serialization of ConjunctiveP prevented its proper serialization in versions prior to 3.3.0 and 3.2.4.
         addGraphProcessEntry(P.gt(0).and(P.lt(10)), "P and", "", noTypeGraphSONPlusGryo3_2_3);
@@ -151,7 +151,7 @@ public class Model {
         addGraphProcessEntry(P.gt(0).or(P.within(-1, -10, -100)), "P or", "", noTypeGraphSONPlusGryo3_2_3);
         addGraphProcessEntry(Scope.local, "Scope", "", Compatibilities.UNTYPED_GRAPHSON.matchToArray());
         addGraphProcessEntry(T.label, "T", "", Compatibilities.UNTYPED_GRAPHSON.matchToArray());
-        addGraphProcessEntry(createStaticTraversalMetrics(), "TraversalMetrics", "", Compatibilities.UNTYPED_GRAPHSON.matchToArray());
+        addGraphProcessEntry(createStaticTraversalMetrics(), "TraversalMetrics", "", noTypeGraphSONPlusGryo3_3_0);
         addGraphProcessEntry(g.V().hasLabel("person").asAdmin().nextTraverser(), "Traverser", "", Compatibilities.UNTYPED_GRAPHSON.matchToArray());
 
         final Map<String,Object> requestBindings = new HashMap<>();

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4ec69216/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v1d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v1d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v1d0.kryo
index c098e38..79629c9 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v1d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v1d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4ec69216/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo
index f65dd63..79629c9 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4ec69216/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo
index 2d02c43..4065705 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4ec69216/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo
index 5ec44fd..4065705 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo differ


[32/50] [abbrv] tinkerpop git commit: TINKERPOP-1698 Fixed up a bunch of tests with Gryo V3

Posted by sp...@apache.org.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
index 1fcb89e..044c672 100644
--- a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
+++ b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
@@ -32,6 +32,7 @@ scriptEngines: {
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-all.groovy]}}}}
 serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0], custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}}
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0], custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0], custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true}}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
index e6f6f8e..2444dc0 100644
--- a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
+++ b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
@@ -28,6 +28,7 @@ scriptEngines: {
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy]}}}}
 serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0], custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}}
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0], custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0], custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true}}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java
index f11c0cb..9a6c823 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java
@@ -50,6 +50,7 @@ import java.util.Map;
 import java.util.Optional;
 import java.util.concurrent.TimeUnit;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
+
 import static org.hamcrest.CoreMatchers.instanceOf;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -229,7 +230,7 @@ public class SerializationTest {
             assertNotNull(after);
             assertEquals(before.getMetrics().size(), after.getMetrics().size());
             assertEquals(before.getDuration(TimeUnit.MILLISECONDS), after.getDuration(TimeUnit.MILLISECONDS));
-            assertEquals(before.getMetrics(0).getCounts(), after.getMetrics(0).getCounts());
+            assertEquals(before.getMetrics(0).getCounts(), after.getMetrics().stream().findFirst().get().getCounts());
         }
         
         @Test

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoCustomTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoCustomTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoCustomTest.java
index 777c2ee..90934af 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoCustomTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoCustomTest.java
@@ -28,6 +28,7 @@ import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONVersion;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoVersion;
 import org.apache.tinkerpop.gremlin.structure.io.util.CustomId;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.apache.tinkerpop.shaded.jackson.databind.module.SimpleModule;
@@ -70,9 +71,12 @@ public class IoCustomTest extends AbstractGremlinTest {
                 {"graphson-v3", true,
                         (Function<Graph, GraphReader>) g -> g.io(IoCore.graphson()).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().addCustomModule(moduleV2d0).create()).create(),
                         (Function<Graph, GraphWriter>) g -> g.io(IoCore.graphson()).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().addCustomModule(moduleV2d0).create()).create()},
-                {"gryo", true,
-                        (Function<Graph, GraphReader>) g -> g.io(IoCore.gryo()).reader().mapper(g.io(IoCore.gryo()).mapper().addCustom(CustomId.class).create()).create(),
-                        (Function<Graph, GraphWriter>) g -> g.io(IoCore.gryo()).writer().mapper(g.io(IoCore.gryo()).mapper().addCustom(CustomId.class).create()).create()}
+                {"gryo-v1", true,
+                        (Function<Graph, GraphReader>) g -> g.io(IoCore.gryo()).reader().mapper(g.io(IoCore.gryo()).mapper().version(GryoVersion.V1_0).addCustom(CustomId.class).create()).create(),
+                        (Function<Graph, GraphWriter>) g -> g.io(IoCore.gryo()).writer().mapper(g.io(IoCore.gryo()).mapper().version(GryoVersion.V1_0).addCustom(CustomId.class).create()).create()},
+                {"gryo-v3", true,
+                        (Function<Graph, GraphReader>) g -> g.io(IoCore.gryo()).reader().mapper(g.io(IoCore.gryo()).mapper().version(GryoVersion.V3_0).addCustom(CustomId.class).create()).create(),
+                        (Function<Graph, GraphWriter>) g -> g.io(IoCore.gryo()).writer().mapper(g.io(IoCore.gryo()).mapper().version(GryoVersion.V3_0).addCustom(CustomId.class).create()).create()}
         });
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/gremlin-tools/gremlin-io-test/src/test/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoCompatibilityTest.java
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoCompatibilityTest.java b/gremlin-tools/gremlin-io-test/src/test/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoCompatibilityTest.java
index 431bded..626ae90 100644
--- a/gremlin-tools/gremlin-io-test/src/test/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoCompatibilityTest.java
+++ b/gremlin-tools/gremlin-io-test/src/test/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoCompatibilityTest.java
@@ -22,6 +22,7 @@ import org.apache.commons.io.output.ByteArrayOutputStream;
 import org.apache.tinkerpop.gremlin.structure.io.AbstractTypedCompatibilityTest;
 import org.apache.tinkerpop.gremlin.structure.io.Compatibility;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0;
 import org.apache.tinkerpop.shaded.kryo.Kryo;
 import org.apache.tinkerpop.shaded.kryo.io.Input;
 import org.apache.tinkerpop.shaded.kryo.io.Output;
@@ -37,10 +38,11 @@ import java.util.Arrays;
 public class GryoCompatibilityTest extends AbstractTypedCompatibilityTest {
 
     private static Kryo mapperV1 = GryoMapper.build().
+            version(GryoVersion.V1_0).
             addRegistry(TinkerIoRegistryV2d0.instance()).create().createMapper();
     private static Kryo mapperV3 = GryoMapper.build().
             version(GryoVersion.V3_0).
-            addRegistry(TinkerIoRegistryV2d0.instance()).create().createMapper();
+            addRegistry(TinkerIoRegistryV3d0.instance()).create().createMapper();
 
     @Parameterized.Parameters(name = "expect({0})")
     public static Iterable<Object[]> data() {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java
index 7a7f29b..501e1ef 100644
--- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java
+++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java
@@ -41,6 +41,7 @@ import org.apache.tinkerpop.gremlin.structure.io.IoRegistry;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoSerializersV1d0;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoVersion;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.TypeRegistration;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.SerializerShim;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.shaded.ShadedSerializerAdapter;
@@ -107,7 +108,7 @@ public class GryoRegistrator implements KryoRegistrator {
         final Set<Class<?>> shimmedClassesFromGryoMapper = new HashSet<>();
 
         // Apply GryoMapper's default registrations
-        for (TypeRegistration<?> tr : GryoMapper.build().create().getTypeRegistrations()) {
+        for (TypeRegistration<?> tr : GryoMapper.build().version(GryoVersion.V1_0).create().getTypeRegistrations()) {
             // Is this class blacklisted?  Skip it. (takes precedence over serializerOverrides)
             if (blacklist.contains(tr.getTargetClass())) {
                 log.debug("Not registering serializer for {} (blacklisted)", tr.getTargetClass());

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/jsr223/TinkerGraphGremlinPlugin.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/jsr223/TinkerGraphGremlinPlugin.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/jsr223/TinkerGraphGremlinPlugin.java
index b7b15d9..f71a1b2 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/jsr223/TinkerGraphGremlinPlugin.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/jsr223/TinkerGraphGremlinPlugin.java
@@ -36,6 +36,7 @@ import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraphVariables;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerHelper;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerProperty;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertex;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertexProperty;
@@ -55,6 +56,7 @@ public final class TinkerGraphGremlinPlugin extends AbstractGremlinPlugin {
                     TinkerHelper.class,
                     TinkerIoRegistryV1d0.class,
                     TinkerIoRegistryV2d0.class,
+                    TinkerIoRegistryV3d0.class,
                     TinkerProperty.class,
                     TinkerVertex.class,
                     TinkerVertexProperty.class,

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphGryoSerializerV2d0Test.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphGryoSerializerV2d0Test.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphGryoSerializerV2d0Test.java
index 7d2a5e3..7551591 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphGryoSerializerV2d0Test.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphGryoSerializerV2d0Test.java
@@ -38,7 +38,7 @@ import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 /**
- * Unit tests for {@link TinkerIoRegistry.TinkerGraphGryoSerializer}
+ * Unit tests for {@link TinkerIoRegistryV2d0.TinkerGraphGryoSerializer}.
  */
 @RunWith(MockitoJUnitRunner.class)
 public class TinkerGraphGryoSerializerV2d0Test {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphGryoSerializerV3d0Test.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphGryoSerializerV3d0Test.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphGryoSerializerV3d0Test.java
new file mode 100644
index 0000000..2b18c3b
--- /dev/null
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphGryoSerializerV3d0Test.java
@@ -0,0 +1,80 @@
+/*
+ * 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.tinkergraph.structure;
+
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper;
+import org.apache.tinkerpop.shaded.kryo.Kryo;
+import org.apache.tinkerpop.shaded.kryo.Registration;
+import org.apache.tinkerpop.shaded.kryo.io.Input;
+import org.apache.tinkerpop.shaded.kryo.io.Output;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import java.util.Arrays;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Mockito.atLeastOnce;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * Unit tests for {@link TinkerIoRegistryV3d0.TinkerGraphGryoSerializer}.
+ */
+@RunWith(MockitoJUnitRunner.class)
+public class TinkerGraphGryoSerializerV3d0Test {
+
+    @Mock
+    private Kryo kryo;
+    @Mock
+    private Registration registration;
+    @Mock
+    private Output output;
+    @Mock
+    private Input input;
+
+    private TinkerGraph graph = TinkerGraph.open();
+    private TinkerIoRegistryV3d0.TinkerGraphGryoSerializer serializer = new TinkerIoRegistryV3d0.TinkerGraphGryoSerializer();
+
+    @Before
+    public void setUp() throws Exception {
+        when(kryo.getRegistration((Class) any())).thenReturn(registration);
+        when(input.readBytes(anyInt())).thenReturn(Arrays.copyOf(GryoMapper.HEADER, 100));
+    }
+
+    @Test
+    public void shouldVerifyKryoUsedForWrite() throws Exception {
+        serializer.write(kryo, output, graph);
+        verify(kryo, atLeastOnce()).getRegistration((Class) any());
+    }
+
+    @Test
+    public void shouldVerifyKryoUsedForRead() throws Exception {
+        // Not possible to mock an entire deserialization so just verify the same kryo instances are being used
+        try {
+            serializer.read(kryo, input, TinkerGraph.class);
+        } catch (RuntimeException ex) {
+            verify(kryo, atLeastOnce()).readObject(any(), any());
+            verify(kryo, atLeastOnce()).readClassAndObject(any());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfcdd26e/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
index d90ff56..4137fb0 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
@@ -39,6 +39,7 @@ import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoClassResolverV1d0;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoVersion;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoWriter;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper;
@@ -544,7 +545,7 @@ public class TinkerGraphTest {
         final ArrayList<Color> colorList = new ArrayList<>(Arrays.asList(Color.RED, Color.GREEN));
 
         final Supplier<ClassResolver> classResolver = new CustomClassResolverSupplier();
-        final GryoMapper mapper = GryoMapper.build().addRegistry(TinkerIoRegistryV1d0.instance()).classResolver(classResolver).create();
+        final GryoMapper mapper = GryoMapper.build().version(GryoVersion.V3_0).addRegistry(TinkerIoRegistryV3d0.instance()).classResolver(classResolver).create();
         final Kryo kryo = mapper.createMapper();
         try (final ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
             final Output out = new Output(stream);
@@ -572,7 +573,7 @@ public class TinkerGraphTest {
         final ArrayList<Color> colorList = new ArrayList<>(Arrays.asList(Color.RED, Color.GREEN));
 
         final Supplier<ClassResolver> classResolver = new CustomClassResolverSupplier();
-        final GryoMapper mapper = GryoMapper.build().addRegistry(TinkerIoRegistryV1d0.instance()).classResolver(classResolver).create();
+        final GryoMapper mapper = GryoMapper.build().version(GryoVersion.V3_0).addRegistry(TinkerIoRegistryV3d0.instance()).classResolver(classResolver).create();
         final Kryo kryo = mapper.createMapper();
         try (final ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
             final Output out = new Output(stream);


[28/50] [abbrv] tinkerpop git commit: TINKERPOP-1698 Metrics serializer for gryo 3.0 and abstract ClassResolver

Posted by sp...@apache.org.
TINKERPOP-1698 Metrics serializer for gryo 3.0 and abstract ClassResolver


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

Branch: refs/heads/TINKERPOP-1686
Commit: dc9a87b3927901d67c4547c9f16b5f5bd39b1a33
Parents: 87ca1e3
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Sat Jun 24 09:55:20 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 14:13:37 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   2 +
 .../tinkerpop/gremlin/jsr223/CoreImports.java   |   6 +-
 .../io/gryo/AbstractGryoClassResolver.java      | 188 +++++++++++++++
 .../structure/io/gryo/GryoClassResolver.java    | 227 -------------------
 .../io/gryo/GryoClassResolverV1d0.java          |  79 +++++++
 .../io/gryo/GryoClassResolverV3d0.java          |  85 +++++++
 .../gremlin/structure/io/gryo/GryoMapper.java   |   8 +-
 .../structure/io/gryo/GryoSerializersV1d0.java  |   1 -
 .../structure/io/gryo/GryoSerializersV3d0.java  |  70 ++++++
 .../gremlin/structure/io/gryo/GryoVersion.java  |  24 +-
 .../structure/io/gryo/GryoMapperTest.java       |   2 +-
 .../ser/GryoBaseMessageSerializerV1d0Test.java  |   4 +-
 gremlin-tools/gremlin-io-test/pom.xml           |   2 +-
 .../structure/io/gryo/_3_3_0/metrics-v3d0.kryo  | Bin 187 -> 184 bytes
 .../io/gryo/_3_3_0/traversalmetrics-v3d0.kryo   | Bin 294 -> 308 bytes
 .../tinkergraph/structure/TinkerGraphTest.java  |   4 +-
 16 files changed, 456 insertions(+), 246 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index bfdd43d..2fe7094 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,8 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.3.0 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* `GryoVersion` now includes a default `ClassResolver` to supply to the `GryoMapper`.
+* `GryoClassResolver` renamed to `GryoClassResolverV1d0` which has an abstract class that for providers to extend in `AbstractGryoClassResolver`.
 * Removed previously deprecated `TraversalSource.Builder` class.
 * Removed previously deprecated `ConnectiveP`, `AndP`, `OrP` constructors.
 * Removed previously deprecated `TraversalScriptFunction` class.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java
index 1296cfe..7f82834 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java
@@ -112,7 +112,8 @@ import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONVersion;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.LegacyGraphSONReader;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoClassResolver;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoClassResolverV1d0;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoClassResolverV3d0;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoReader;
@@ -192,7 +193,8 @@ public final class CoreImports {
         CLASS_IMPORTS.add(GraphSONVersion.class);
         CLASS_IMPORTS.add(GraphSONWriter.class);
         CLASS_IMPORTS.add(LegacyGraphSONReader.class);
-        CLASS_IMPORTS.add(GryoClassResolver.class);
+        CLASS_IMPORTS.add(GryoClassResolverV1d0.class);
+        CLASS_IMPORTS.add(GryoClassResolverV3d0.class);
         CLASS_IMPORTS.add(GryoIo.class);
         CLASS_IMPORTS.add(GryoMapper.class);
         CLASS_IMPORTS.add(GryoReader.class);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/AbstractGryoClassResolver.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/AbstractGryoClassResolver.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/AbstractGryoClassResolver.java
new file mode 100644
index 0000000..4f400ab
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/AbstractGryoClassResolver.java
@@ -0,0 +1,188 @@
+/*
+ * 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.ClassResolver;
+import org.apache.tinkerpop.shaded.kryo.Kryo;
+import org.apache.tinkerpop.shaded.kryo.KryoException;
+import org.apache.tinkerpop.shaded.kryo.Registration;
+import org.apache.tinkerpop.shaded.kryo.io.Input;
+import org.apache.tinkerpop.shaded.kryo.io.Output;
+import org.apache.tinkerpop.shaded.kryo.util.IdentityObjectIntMap;
+import org.apache.tinkerpop.shaded.kryo.util.IntMap;
+import org.apache.tinkerpop.shaded.kryo.util.ObjectMap;
+
+import static org.apache.tinkerpop.shaded.kryo.util.Util.getWrapperClass;
+
+/**
+ * This mapper implementation of the {@code ClassResolver} helps ensure that all Vertex and Edge concrete classes
+ * get properly serialized and deserialized by stripping them of their concrete class name so that they are treated
+ * generically. See the {@link #getRegistration(Class)} method for the core of this logic.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public abstract class AbstractGryoClassResolver implements ClassResolver {
+    static public final byte NAME = -1;
+
+    protected Kryo kryo;
+
+    protected final IntMap<Registration> idToRegistration = new IntMap<>();
+    protected final ObjectMap<Class, Registration> classToRegistration = new ObjectMap<>();
+
+    protected IdentityObjectIntMap<Class> classToNameId;
+    protected IntMap<Class> nameIdToClass;
+    protected ObjectMap<String, Class> nameToClass;
+    protected int nextNameId;
+
+    private int memoizedClassId = -1;
+    private Registration memoizedClassIdValue;
+    private Class memoizedClass;
+    private Registration memoizedClassValue;
+
+    @Override
+    public void setKryo(Kryo kryo) {
+        this.kryo = kryo;
+    }
+
+    @Override
+    public Registration register(final Registration registration) {
+        if (null == registration) throw new IllegalArgumentException("Registration cannot be null.");
+        if (registration.getId() != NAME) idToRegistration.put(registration.getId(), registration);
+
+        classToRegistration.put(registration.getType(), registration);
+        if (registration.getType().isPrimitive())
+            classToRegistration.put(getWrapperClass(registration.getType()), registration);
+        return registration;
+    }
+
+    @Override
+    public Registration registerImplicit(final Class type) {
+        return register(new Registration(type, kryo.getDefaultSerializer(type), NAME));
+    }
+
+    /**
+     * Called from {@link #getRegistration(Class)} to determine the actual type.
+     */
+    public abstract Class coerceType(final Class clazz);
+
+    @Override
+    public Registration getRegistration(final Class clazz) {
+        final Class type = coerceType(clazz);
+
+        if (type == memoizedClass) return memoizedClassValue;
+        final Registration registration = classToRegistration.get(type);
+        if (registration != null) {
+            memoizedClass = type;
+            memoizedClassValue = registration;
+        }
+
+        return registration;
+    }
+
+    @Override
+    public Registration getRegistration(final int classID) {
+        return idToRegistration.get(classID);
+    }
+
+    @Override
+    public Registration writeClass(final Output output, final Class type) {
+        if (null == type) {
+            output.writeVarInt(Kryo.NULL, true);
+            return null;
+        }
+
+        final Registration registration = kryo.getRegistration(type);
+        if (registration.getId() == NAME)
+            writeName(output, type);
+        else
+            output.writeVarInt(registration.getId() + 2, true);
+
+        return registration;
+    }
+
+    protected void writeName(final Output output, final Class type) {
+        output.writeVarInt(NAME + 2, true);
+        if (classToNameId != null) {
+            final int nameId = classToNameId.get(type, -1);
+            if (nameId != -1) {
+                output.writeVarInt(nameId, true);
+                return;
+            }
+        }
+        // Only write the class name the first time encountered in object graph.
+        final int nameId = nextNameId++;
+        if (classToNameId == null) classToNameId = new IdentityObjectIntMap<>();
+        classToNameId.put(type, nameId);
+        output.writeVarInt(nameId, true);
+        output.writeString(type.getName());
+    }
+
+    @Override
+    public Registration readClass(final Input input) {
+        final int classID = input.readVarInt(true);
+        switch (classID) {
+            case Kryo.NULL:
+                return null;
+            case NAME + 2: // Offset for NAME and NULL.
+                return readName(input);
+        }
+
+        if (classID == memoizedClassId) return memoizedClassIdValue;
+        final Registration registration = idToRegistration.get(classID - 2);
+        if (registration == null) throw new KryoException("Encountered unregistered class ID: " + (classID - 2));
+        memoizedClassId = classID;
+        memoizedClassIdValue = registration;
+        return registration;
+    }
+
+    protected Registration readName(final Input input) {
+        final int nameId = input.readVarInt(true);
+        if (nameIdToClass == null) nameIdToClass = new IntMap<>();
+        Class type = nameIdToClass.get(nameId);
+        if (type == null) {
+            // Only read the class name the first time encountered in object graph.
+            final String className = input.readString();
+            type = getTypeByName(className);
+            if (type == null) {
+                try {
+                    type = Class.forName(className, false, kryo.getClassLoader());
+                } catch (ClassNotFoundException ex) {
+                    throw new KryoException("Unable to find class: " + className, ex);
+                }
+                if (nameToClass == null) nameToClass = new ObjectMap<>();
+                nameToClass.put(className, type);
+            }
+            nameIdToClass.put(nameId, type);
+        }
+        return kryo.getRegistration(type);
+    }
+
+    protected Class<?> getTypeByName(final String className) {
+        return nameToClass != null ? nameToClass.get(className) : null;
+    }
+
+    @Override
+    public void reset() {
+        if (!kryo.isRegistrationRequired()) {
+            if (classToNameId != null) classToNameId.clear();
+            if (nameIdToClass != null) nameIdToClass.clear();
+            nextNameId = 0;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolver.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolver.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolver.java
deleted file mode 100644
index dceda40..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolver.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.structure.io.gryo;
-
-import org.apache.tinkerpop.gremlin.process.traversal.P;
-import org.apache.tinkerpop.gremlin.process.traversal.Path;
-import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP;
-import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedPath;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedProperty;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty;
-import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdge;
-import org.apache.tinkerpop.gremlin.structure.util.reference.ReferencePath;
-import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceProperty;
-import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex;
-import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertexProperty;
-import org.apache.tinkerpop.gremlin.util.function.Lambda;
-import org.apache.tinkerpop.shaded.kryo.ClassResolver;
-import org.apache.tinkerpop.shaded.kryo.Kryo;
-import org.apache.tinkerpop.shaded.kryo.KryoException;
-import org.apache.tinkerpop.shaded.kryo.Registration;
-import org.apache.tinkerpop.shaded.kryo.io.Input;
-import org.apache.tinkerpop.shaded.kryo.io.Output;
-import org.apache.tinkerpop.shaded.kryo.util.IdentityObjectIntMap;
-import org.apache.tinkerpop.shaded.kryo.util.IntMap;
-import org.apache.tinkerpop.shaded.kryo.util.ObjectMap;
-
-import java.net.InetAddress;
-import java.nio.ByteBuffer;
-
-import static org.apache.tinkerpop.shaded.kryo.util.Util.getWrapperClass;
-
-/**
- * This mapper implementation of the {@code ClassResolver} helps ensure that all Vertex and Edge concrete classes
- * get properly serialized and deserialized by stripping them of their concrete class name so that they are treated
- * generically. See the {@link #getRegistration(Class)} method for the core of this logic.
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public class GryoClassResolver implements ClassResolver {
-    static public final byte NAME = -1;
-
-    protected Kryo kryo;
-
-    protected final IntMap<Registration> idToRegistration = new IntMap<>();
-    protected final ObjectMap<Class, Registration> classToRegistration = new ObjectMap<>();
-
-    protected IdentityObjectIntMap<Class> classToNameId;
-    protected IntMap<Class> nameIdToClass;
-    protected ObjectMap<String, Class> nameToClass;
-    protected int nextNameId;
-
-    private int memoizedClassId = -1;
-    private Registration memoizedClassIdValue;
-    private Class memoizedClass;
-    private Registration memoizedClassValue;
-
-    @Override
-    public void setKryo(Kryo kryo) {
-        this.kryo = kryo;
-    }
-
-    @Override
-    public Registration register(final Registration registration) {
-        if (null == registration) throw new IllegalArgumentException("Registration cannot be null.");
-        if (registration.getId() != NAME) idToRegistration.put(registration.getId(), registration);
-
-        classToRegistration.put(registration.getType(), registration);
-        if (registration.getType().isPrimitive())
-            classToRegistration.put(getWrapperClass(registration.getType()), registration);
-        return registration;
-    }
-
-    @Override
-    public Registration registerImplicit(final Class type) {
-        return register(new Registration(type, kryo.getDefaultSerializer(type), NAME));
-    }
-
-    @Override
-    public Registration getRegistration(final Class clazz) {
-        // force all instances of Vertex, Edge, VertexProperty, etc. to their respective interface
-        final Class type;
-        if (!ReferenceVertex.class.isAssignableFrom(clazz) && !DetachedVertex.class.isAssignableFrom(clazz) && Vertex.class.isAssignableFrom(clazz))
-            type = Vertex.class;
-        else if (!ReferenceEdge.class.isAssignableFrom(clazz) && !DetachedEdge.class.isAssignableFrom(clazz) && Edge.class.isAssignableFrom(clazz))
-            type = Edge.class;
-        else if (!ReferenceVertexProperty.class.isAssignableFrom(clazz) && !DetachedVertexProperty.class.isAssignableFrom(clazz) && VertexProperty.class.isAssignableFrom(clazz))
-            type = VertexProperty.class;
-        else if (!ReferenceProperty.class.isAssignableFrom(clazz) && !DetachedProperty.class.isAssignableFrom(clazz) && !DetachedVertexProperty.class.isAssignableFrom(clazz) && Property.class.isAssignableFrom(clazz))
-            type = Property.class;
-        else if (!ReferencePath.class.isAssignableFrom(clazz) && !DetachedPath.class.isAssignableFrom(clazz) && Path.class.isAssignableFrom(clazz))
-            type = Path.class;
-        else if (Lambda.class.isAssignableFrom(clazz))
-            type = Lambda.class;
-        else if (ByteBuffer.class.isAssignableFrom(clazz))
-            type = ByteBuffer.class;
-        else if (Class.class.isAssignableFrom(clazz))
-            type = Class.class;
-        else if (InetAddress.class.isAssignableFrom(clazz))
-            type = InetAddress.class;
-        else if (ConnectiveP.class.isAssignableFrom(clazz))
-            type = P.class;
-        else
-            type = clazz;
-
-        if (type == memoizedClass) return memoizedClassValue;
-        final Registration registration = classToRegistration.get(type);
-        if (registration != null) {
-            memoizedClass = type;
-            memoizedClassValue = registration;
-        }
-
-        return registration;
-    }
-
-    @Override
-    public Registration getRegistration(final int classID) {
-        return idToRegistration.get(classID);
-    }
-
-    @Override
-    public Registration writeClass(final Output output, final Class type) {
-        if (null == type) {
-            output.writeVarInt(Kryo.NULL, true);
-            return null;
-        }
-
-        final Registration registration = kryo.getRegistration(type);
-        if (registration.getId() == NAME)
-            writeName(output, type);
-        else
-            output.writeVarInt(registration.getId() + 2, true);
-
-        return registration;
-    }
-
-    protected void writeName(final Output output, final Class type) {
-        output.writeVarInt(NAME + 2, true);
-        if (classToNameId != null) {
-            final int nameId = classToNameId.get(type, -1);
-            if (nameId != -1) {
-                output.writeVarInt(nameId, true);
-                return;
-            }
-        }
-        // Only write the class name the first time encountered in object graph.
-        final int nameId = nextNameId++;
-        if (classToNameId == null) classToNameId = new IdentityObjectIntMap<>();
-        classToNameId.put(type, nameId);
-        output.writeVarInt(nameId, true);
-        output.writeString(type.getName());
-    }
-
-    @Override
-    public Registration readClass(final Input input) {
-        final int classID = input.readVarInt(true);
-        switch (classID) {
-            case Kryo.NULL:
-                return null;
-            case NAME + 2: // Offset for NAME and NULL.
-                return readName(input);
-        }
-
-        if (classID == memoizedClassId) return memoizedClassIdValue;
-        final Registration registration = idToRegistration.get(classID - 2);
-        if (registration == null) throw new KryoException("Encountered unregistered class ID: " + (classID - 2));
-        memoizedClassId = classID;
-        memoizedClassIdValue = registration;
-        return registration;
-    }
-
-    protected Registration readName(final Input input) {
-        final int nameId = input.readVarInt(true);
-        if (nameIdToClass == null) nameIdToClass = new IntMap<>();
-        Class type = nameIdToClass.get(nameId);
-        if (type == null) {
-            // Only read the class name the first time encountered in object graph.
-            final String className = input.readString();
-            type = getTypeByName(className);
-            if (type == null) {
-                try {
-                    type = Class.forName(className, false, kryo.getClassLoader());
-                } catch (ClassNotFoundException ex) {
-                    throw new KryoException("Unable to find class: " + className, ex);
-                }
-                if (nameToClass == null) nameToClass = new ObjectMap<>();
-                nameToClass.put(className, type);
-            }
-            nameIdToClass.put(nameId, type);
-        }
-        return kryo.getRegistration(type);
-    }
-
-    protected Class<?> getTypeByName(final String className) {
-        return nameToClass != null ? nameToClass.get(className) : null;
-    }
-
-    @Override
-    public void reset() {
-        if (!kryo.isRegistrationRequired()) {
-            if (classToNameId != null) classToNameId.clear();
-            if (nameIdToClass != null) nameIdToClass.clear();
-            nextNameId = 0;
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV1d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV1d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV1d0.java
new file mode 100644
index 0000000..12a9bfb
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV1d0.java
@@ -0,0 +1,79 @@
+/*
+ * 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.gremlin.process.traversal.P;
+import org.apache.tinkerpop.gremlin.process.traversal.Path;
+import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedPath;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedProperty;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty;
+import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdge;
+import org.apache.tinkerpop.gremlin.structure.util.reference.ReferencePath;
+import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceProperty;
+import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex;
+import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertexProperty;
+import org.apache.tinkerpop.gremlin.util.function.Lambda;
+
+import java.net.InetAddress;
+import java.nio.ByteBuffer;
+
+/**
+ * {@link AbstractGryoClassResolver} for Gryo 1.0.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class GryoClassResolverV1d0 extends AbstractGryoClassResolver {
+
+    @Override
+    public Class coerceType(final Class clazz) {
+        // force all instances of Vertex, Edge, VertexProperty, etc. to their respective interface
+        final Class type;
+        if (!ReferenceVertex.class.isAssignableFrom(clazz) && !DetachedVertex.class.isAssignableFrom(clazz) && Vertex.class.isAssignableFrom(clazz))
+            type = Vertex.class;
+        else if (!ReferenceEdge.class.isAssignableFrom(clazz) && !DetachedEdge.class.isAssignableFrom(clazz) && Edge.class.isAssignableFrom(clazz))
+            type = Edge.class;
+        else if (!ReferenceVertexProperty.class.isAssignableFrom(clazz) && !DetachedVertexProperty.class.isAssignableFrom(clazz) && VertexProperty.class.isAssignableFrom(clazz))
+            type = VertexProperty.class;
+        else if (!ReferenceProperty.class.isAssignableFrom(clazz) && !DetachedProperty.class.isAssignableFrom(clazz) && !DetachedVertexProperty.class.isAssignableFrom(clazz) && Property.class.isAssignableFrom(clazz))
+            type = Property.class;
+        else if (!ReferencePath.class.isAssignableFrom(clazz) && !DetachedPath.class.isAssignableFrom(clazz) && Path.class.isAssignableFrom(clazz))
+            type = Path.class;
+        else if (Lambda.class.isAssignableFrom(clazz))
+            type = Lambda.class;
+        else if (ByteBuffer.class.isAssignableFrom(clazz))
+            type = ByteBuffer.class;
+        else if (Class.class.isAssignableFrom(clazz))
+            type = Class.class;
+        else if (InetAddress.class.isAssignableFrom(clazz))
+            type = InetAddress.class;
+        else if (ConnectiveP.class.isAssignableFrom(clazz))
+            type = P.class;
+        else
+            type = clazz;
+
+        return type;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV3d0.java
new file mode 100644
index 0000000..9b0f726
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoClassResolverV3d0.java
@@ -0,0 +1,85 @@
+/*
+ * 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.gremlin.process.traversal.P;
+import org.apache.tinkerpop.gremlin.process.traversal.Path;
+import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP;
+import org.apache.tinkerpop.gremlin.process.traversal.util.Metrics;
+import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMetrics;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedPath;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedProperty;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty;
+import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdge;
+import org.apache.tinkerpop.gremlin.structure.util.reference.ReferencePath;
+import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceProperty;
+import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex;
+import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertexProperty;
+import org.apache.tinkerpop.gremlin.util.function.Lambda;
+
+import java.net.InetAddress;
+import java.nio.ByteBuffer;
+
+/**
+ * {@link AbstractGryoClassResolver} for Gryo 3.0.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class GryoClassResolverV3d0 extends AbstractGryoClassResolver {
+
+    @Override
+    public Class coerceType(final Class clazz) {
+        // force all instances of Vertex, Edge, VertexProperty, etc. to their respective interface
+        final Class type;
+        if (!ReferenceVertex.class.isAssignableFrom(clazz) && !DetachedVertex.class.isAssignableFrom(clazz) && Vertex.class.isAssignableFrom(clazz))
+            type = Vertex.class;
+        else if (!ReferenceEdge.class.isAssignableFrom(clazz) && !DetachedEdge.class.isAssignableFrom(clazz) && Edge.class.isAssignableFrom(clazz))
+            type = Edge.class;
+        else if (!ReferenceVertexProperty.class.isAssignableFrom(clazz) && !DetachedVertexProperty.class.isAssignableFrom(clazz) && VertexProperty.class.isAssignableFrom(clazz))
+            type = VertexProperty.class;
+        else if (!ReferenceProperty.class.isAssignableFrom(clazz) && !DetachedProperty.class.isAssignableFrom(clazz) && !DetachedVertexProperty.class.isAssignableFrom(clazz) && Property.class.isAssignableFrom(clazz))
+            type = Property.class;
+        else if (!ReferencePath.class.isAssignableFrom(clazz) && !DetachedPath.class.isAssignableFrom(clazz) && Path.class.isAssignableFrom(clazz))
+            type = Path.class;
+        else if (Lambda.class.isAssignableFrom(clazz))
+            type = Lambda.class;
+        else if (ByteBuffer.class.isAssignableFrom(clazz))
+            type = ByteBuffer.class;
+        else if (Class.class.isAssignableFrom(clazz))
+            type = Class.class;
+        else if (InetAddress.class.isAssignableFrom(clazz))
+            type = InetAddress.class;
+        else if (ConnectiveP.class.isAssignableFrom(clazz))
+            type = P.class;
+        else if (Metrics.class.isAssignableFrom(clazz))
+            type = Metrics.class;
+        else if (TraversalMetrics.class.isAssignableFrom(clazz))
+            type = TraversalMetrics.class;
+        else
+            type = clazz;
+
+        return type;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/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 48b670c..2db34b4 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
@@ -88,7 +88,7 @@ public final class GryoMapper implements Mapper<Kryo> {
 
         this.registrationRequired = builder.registrationRequired;
         this.referenceTracking = builder.referenceTracking;
-        this.classResolver = builder.classResolver;
+        this.classResolver = null == builder.classResolver ? version.getClassResolverMaker() : builder.classResolver;
     }
 
     @Override
@@ -155,7 +155,7 @@ public final class GryoMapper implements Mapper<Kryo> {
 
         private boolean registrationRequired = true;
         private boolean referenceTracking = true;
-        private Supplier<ClassResolver> classResolver = GryoClassResolver::new;
+        private Supplier<ClassResolver> classResolver;
 
         private Builder() {
         }
@@ -182,8 +182,8 @@ public final class GryoMapper implements Mapper<Kryo> {
 
         /**
          * Provides a custom Kryo {@code ClassResolver} to be supplied to a {@code Kryo} instance.  If this value is
-         * not supplied then it will default to the {@link GryoClassResolver}. To ensure compatibility with Gryo it
-         * is highly recommended that objects passed to this method extend that class.
+         * not supplied then it will default to the {@code ClassResolver} of the provided {@link GryoVersion}. To
+         * ensure compatibility with Gryo it is highly recommended that objects passed to this method extend that class.
          * <p/>
          * If the {@code ClassResolver} implementation share state, then the {@link Supplier} should typically create
          * new instances when requested, as the {@link Supplier} will be called for each {@link Kryo} instance created.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV1d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV1d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV1d0.java
index 2851baa..ca7c241 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV1d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV1d0.java
@@ -41,7 +41,6 @@ import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedProperty;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty;
 import org.apache.tinkerpop.gremlin.util.function.Lambda;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 
 import java.util.ArrayList;
 import java.util.Collection;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
index eb940ff..580bc86 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
@@ -25,11 +25,16 @@ import org.apache.tinkerpop.gremlin.process.traversal.Path;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.util.AndP;
 import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP;
+import org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalMetrics;
+import org.apache.tinkerpop.gremlin.process.traversal.util.Metrics;
+import org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics;
 import org.apache.tinkerpop.gremlin.process.traversal.util.OrP;
+import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMetrics;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Property;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.InputShim;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShim;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.OutputShim;
@@ -45,7 +50,10 @@ import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 /**
  * This class holds serializers for graph-based objects such as vertices, edges, properties, and paths. These objects
@@ -377,4 +385,66 @@ public final class GryoSerializersV3d0 {
             return new DefaultRemoteTraverser<>(o, input.readLong());
         }
     }
+
+    public final static class TraversalMetricsSerializer implements SerializerShim<TraversalMetrics> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final TraversalMetrics object) {
+            output.writeDouble(object.getDuration(TimeUnit.NANOSECONDS) / 1000000d);
+            final Collection<? extends Metrics> metrics = object.getMetrics();
+            output.writeInt(metrics.size());
+            metrics.forEach(m -> kryo.writeObject(output, m));
+        }
+
+        @Override
+        public <I extends InputShim> TraversalMetrics read(final KryoShim<I, ?> kryo, final I input, final Class<TraversalMetrics> clazz) {
+            final double duration = input.readDouble();
+            final int size = input.readInt();
+
+            final List<MutableMetrics> orderedMetrics = new ArrayList<>();
+            for (int ix = 0; ix < size; ix++) {
+                orderedMetrics.add(kryo.readObject(input, MutableMetrics.class));
+            }
+
+            return new DefaultTraversalMetrics(Math.round(duration * 1000000), orderedMetrics);
+        }
+    }
+
+    public final static class MetricsSerializer implements SerializerShim<Metrics> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Metrics object) {
+            output.writeString(object.getId());
+            output.writeString(object.getName());
+            output.writeDouble(object.getDuration(TimeUnit.NANOSECONDS) / 1000000d);
+            kryo.writeObject(output, object.getCounts());
+            kryo.writeObject(output, object.getAnnotations());
+
+            // kryo might have a problem with LinkedHashMap value collections. can't recreate it independently but
+            // it gets fixed with standard collections for some reason.
+            final List<Metrics> nested = new ArrayList<>(object.getNested());
+            kryo.writeObject(output, nested);
+        }
+
+        @Override
+        public <I extends InputShim> Metrics read(final KryoShim<I, ?> kryo, final I input, final Class<Metrics> clazz) {
+            final MutableMetrics m = new MutableMetrics(input.readString(), input.readString());
+
+            m.setDuration(Math.round(input.readDouble() * 1000000), TimeUnit.NANOSECONDS);
+
+            final Map<String,Long> counts = (Map<String,Long>) kryo.readObject(input, HashMap.class);
+            for (Map.Entry<String, Long> count : counts.entrySet()) {
+                m.setCount(count.getKey(), count.getValue());
+            }
+
+            final Map<String,Object> annotations = (Map<String,Object>) kryo.readObject(input, HashMap.class);
+            for (Map.Entry<String, Object> count : annotations.entrySet()) {
+                m.setAnnotation(count.getKey(), count.getValue());
+            }
+
+            final List<MutableMetrics> nesteds = (List<MutableMetrics>) kryo.readObject(input, ArrayList.class);
+            for (MutableMetrics nested : nesteds) {
+                m.addNested(nested);
+            }
+            return m;
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
index c0ed3e5..e06f5b3 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
@@ -77,8 +77,10 @@ import org.apache.tinkerpop.gremlin.process.traversal.traverser.ProjectedTravers
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
 import org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalMetrics;
 import org.apache.tinkerpop.gremlin.process.traversal.util.ImmutableMetrics;
+import org.apache.tinkerpop.gremlin.process.traversal.util.Metrics;
 import org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalExplanation;
+import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMetrics;
 import org.apache.tinkerpop.gremlin.structure.Column;
 import org.apache.tinkerpop.gremlin.structure.Direction;
 import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -103,6 +105,7 @@ import org.apache.tinkerpop.gremlin.util.function.FunctionUtils;
 import org.apache.tinkerpop.gremlin.util.function.HashSetSupplier;
 import org.apache.tinkerpop.gremlin.util.function.Lambda;
 import org.apache.tinkerpop.gremlin.util.function.MultiComparator;
+import org.apache.tinkerpop.shaded.kryo.ClassResolver;
 import org.apache.tinkerpop.shaded.kryo.KryoSerializable;
 import org.apache.tinkerpop.shaded.kryo.serializers.JavaSerializer;
 import org.javatuples.Pair;
@@ -153,11 +156,12 @@ import java.util.function.Supplier;
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public enum GryoVersion {
-    V1_0("1.0", initV1d0Registrations()),
-    V3_0("3.0", initV3d0Registrations());
+    V1_0("1.0", initV1d0Registrations(), GryoClassResolverV1d0::new),
+    V3_0("3.0", initV3d0Registrations(), GryoClassResolverV3d0::new);
 
     private final String versionNumber;
     private final List<TypeRegistration<?>> registrations;
+    private final Supplier<ClassResolver> classResolverMaker;
 
     /**
      * Creates a new {@link GryoVersion}.
@@ -165,8 +169,9 @@ public enum GryoVersion {
      * @param versionNumber the user facing string representation of the version which should follow an {@code x.y}
      *                      pattern
      * @param registrations the list of registrations for this version
+     * @param classResolverMaker providers the default {@code ClassResolver} for a particular version of Gryo
      */
-    GryoVersion(final String versionNumber, final List<TypeRegistration<?>> registrations) {
+    GryoVersion(final String versionNumber, final List<TypeRegistration<?>> registrations, final Supplier<ClassResolver> classResolverMaker) {
         // Validate the default registrations
         // For justification of these default registration rules, see TinkerPopKryoRegistrator
         for (TypeRegistration<?> tr : registrations) {
@@ -184,6 +189,7 @@ public enum GryoVersion {
 
         this.versionNumber = versionNumber;
         this.registrations = registrations;
+        this.classResolverMaker = classResolverMaker;
     }
 
     public List<TypeRegistration<?>> cloneRegistrations() {
@@ -194,6 +200,10 @@ public enum GryoVersion {
         return Collections.unmodifiableList(registrations);
     }
 
+    public Supplier<ClassResolver> getClassResolverMaker() {
+        return classResolverMaker;
+    }
+
     public String getVersion() {
         return versionNumber;
     }
@@ -326,9 +336,11 @@ public enum GryoVersion {
             add(GryoTypeReg.of(Tree.class, 61));
             add(GryoTypeReg.of(HashSet.class, 62));
             add(GryoTypeReg.of(BulkSet.class, 64));
-            add(GryoTypeReg.of(MutableMetrics.class, 69));
-            add(GryoTypeReg.of(ImmutableMetrics.class, 115));
-            add(GryoTypeReg.of(DefaultTraversalMetrics.class, 70));
+            add(GryoTypeReg.of(Metrics.class, 69, new GryoSerializersV3d0.MetricsSerializer()));
+            add(GryoTypeReg.of(TraversalMetrics.class, 70, new GryoSerializersV3d0.TraversalMetricsSerializer()));
+            //add(GryoTypeReg.of(MutableMetrics.class, 69, ));
+            //add(GryoTypeReg.of(ImmutableMetrics.class, 115));
+            //add(GryoTypeReg.of(DefaultTraversalMetrics.class, 70, new GryoSerializersV3d0.TraversalSerializer()));
             add(GryoTypeReg.of(MapMemory.class, 73));
             add(GryoTypeReg.of(MapReduce.NullObject.class, 74));
             add(GryoTypeReg.of(AtomicLong.class, 79));

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/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 1dc9b48..12e99b3 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
@@ -397,7 +397,7 @@ public class GryoMapperTest {
      * TinkerPop which then removes the requirement for providers to expose serializers on the client side for user
      * consumption.
      */
-    public static class CustomClassResolver extends GryoClassResolver {
+    public static class CustomClassResolver extends GryoClassResolverV1d0 {
         private IoXIoRegistry.IoXToVertexSerializer ioXToVertexSerializer = new IoXIoRegistry.IoXToVertexSerializer();
         private IoYIoRegistry.IoYToHashMapSerializer ioYToHashMapSerializer = new IoYIoRegistry.IoYToHashMapSerializer();
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerV1d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerV1d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerV1d0Test.java
index 1929dbf..92627eb 100644
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerV1d0Test.java
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoBaseMessageSerializerV1d0Test.java
@@ -30,7 +30,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.io.AbstractIoRegistry;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoClassResolver;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoClassResolverV1d0;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
@@ -560,7 +560,7 @@ public class GryoBaseMessageSerializerV1d0Test {
         }
     }
 
-    public static class ErrorOnlyClassResolver extends GryoClassResolver {
+    public static class ErrorOnlyClassResolver extends GryoClassResolverV1d0 {
         @Override
         public Registration getRegistration(Class clazz) {
             throw new RuntimeException("Registration is not allowed with this ClassResolver - it is not a good implementation");

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/gremlin-tools/gremlin-io-test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/pom.xml b/gremlin-tools/gremlin-io-test/pom.xml
index 60a56dc..afdc79b 100644
--- a/gremlin-tools/gremlin-io-test/pom.xml
+++ b/gremlin-tools/gremlin-io-test/pom.xml
@@ -168,7 +168,7 @@ writeSupportedV1Objects = { writer, mapper ->
 }
 
 mapper = GraphSONMapper.build().
-                        addRegistry(TinkerIoRegistry.instance()).
+                        addRegistry(TinkerIoRegistryV1d0.instance()).
                         addCustomModule(new AbstractGraphSONMessageSerializerV1d0.GremlinServerModule()).
                         version(GraphSONVersion.V1_0).create().createMapper()
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo
index c098e38..f65dd63 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo
index 1aee9e9..5ec44fd 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc9a87b3/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
index ca11e17..d90ff56 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
@@ -37,7 +37,7 @@ import org.apache.tinkerpop.gremlin.structure.io.Mapper;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONReader;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.TypeInfo;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoClassResolver;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoClassResolverV1d0;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoWriter;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
@@ -655,7 +655,7 @@ public class TinkerGraphTest {
         }
     }
 
-    public static class CustomClassResolver extends GryoClassResolver {
+    public static class CustomClassResolver extends GryoClassResolverV1d0 {
         private ColorToTinkerGraphSerializer colorToGraphSerializer = new ColorToTinkerGraphSerializer();
 
         public Registration getRegistration(final Class clazz) {


[08/50] [abbrv] tinkerpop git commit: Merge branch 'tp32'

Posted by sp...@apache.org.
Merge branch 'tp32'


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

Branch: refs/heads/TINKERPOP-1686
Commit: 4a3eb6d56105c873de7f68008855ae42de6bb990
Parents: e37e2f9 e12cc7c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jul 5 08:11:03 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Jul 5 08:11:03 2017 -0400

----------------------------------------------------------------------
 docs/src/tutorials/getting-started/index.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4a3eb6d5/docs/src/tutorials/getting-started/index.asciidoc
----------------------------------------------------------------------


[49/50] [abbrv] tinkerpop git commit: TINKERPOP-1686 Updated Gryo serialization tests for metrics

Posted by sp...@apache.org.
TINKERPOP-1686 Updated Gryo serialization tests for metrics


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

Branch: refs/heads/TINKERPOP-1686
Commit: 19a573c3c5dcf53bd51b539800a3bc923fda73c9
Parents: d136455
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jun 28 08:27:19 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 11 08:04:55 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                 |   2 +-
 .../gremlin/structure/io/gryo/GryoVersion.java     |   9 +++++++--
 .../structure/io/gryo/_3_3_0/metrics-v1d0.kryo     | Bin 189 -> 193 bytes
 .../structure/io/gryo/_3_3_0/metrics-v3d0.kryo     | Bin 189 -> 193 bytes
 .../io/gryo/_3_3_0/traversalmetrics-v1d0.kryo      | Bin 439 -> 455 bytes
 .../io/gryo/_3_3_0/traversalmetrics-v3d0.kryo      | Bin 439 -> 455 bytes
 6 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/19a573c3/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 07d85fc..bee946a 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,7 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.3.0 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-* `TraversalMetrics` and `Metrics` Gryo formats changed given internal changes to the implementations.
+* `TraversalMetrics` and `Metrics` Gryo 1.0 formats changed given internal changes to their implementations.
 * Made `TraversalMetrics` safe to write to from multiple threads.
 * Established the Gryo 3.0 format.
 * `GryoVersion` now includes a default `ClassResolver` to supply to the `GryoMapper`.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/19a573c3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
index aca1638..54ea131 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
@@ -149,6 +149,7 @@ import java.util.TimeZone;
 import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.Supplier;
 
@@ -250,6 +251,8 @@ public enum GryoVersion {
             add(GryoTypeReg.of(KryoSerializable.class, 36));
             add(GryoTypeReg.of(LinkedHashMap.class, 47));
             add(GryoTypeReg.of(LinkedHashSet.class, 71));
+            add(GryoTypeReg.of(ConcurrentHashMap.class, 170));
+            add(GryoTypeReg.of(ConcurrentHashMap.Entry.class, 171));               // ***LAST ID***
             add(GryoTypeReg.of(LinkedList.class, 116));
             add(GryoTypeReg.of(Types.LINKED_HASH_MAP_ENTRY_CLASS, 15));
             add(GryoTypeReg.of(Locale.class, 22));
@@ -379,7 +382,7 @@ public enum GryoVersion {
             tryAddDynamicType(this, "org.apache.tinkerpop.gremlin.driver.message.RequestMessage",
                     "org.apache.tinkerpop.gremlin.driver.ser.RequestMessageGryoSerializer", 167);
             tryAddDynamicType(this, "org.apache.tinkerpop.gremlin.driver.message.ResponseMessage",
-                    "org.apache.tinkerpop.gremlin.driver.ser.ResponseMessageGryoSerializer", 169);  // ***LAST ID***
+                    "org.apache.tinkerpop.gremlin.driver.ser.ResponseMessageGryoSerializer", 169);
         }};
     }
 
@@ -426,6 +429,8 @@ public enum GryoVersion {
             add(GryoTypeReg.of(LinkedHashMap.class, 47));
             add(GryoTypeReg.of(LinkedHashSet.class, 71));
             add(GryoTypeReg.of(LinkedList.class, 116));
+            add(GryoTypeReg.of(ConcurrentHashMap.class, 168));
+            add(GryoTypeReg.of(ConcurrentHashMap.Entry.class, 169));           // ***LAST ID***
             add(GryoTypeReg.of(Types.LINKED_HASH_MAP_ENTRY_CLASS, 15));
             add(GryoTypeReg.of(Locale.class, 22));
             add(GryoTypeReg.of(StringBuffer.class, 43));
@@ -544,7 +549,7 @@ public enum GryoVersion {
             add(GryoTypeReg.of(LambdaRestrictionStrategy.class, 158));
             add(GryoTypeReg.of(ReadOnlyStrategy.class, 159));
             add(GryoTypeReg.of(MatchStep.CountMatchAlgorithm.class, 160));
-            add(GryoTypeReg.of(MatchStep.GreedyMatchAlgorithm.class, 167)); // ***LAST ID***
+            add(GryoTypeReg.of(MatchStep.GreedyMatchAlgorithm.class, 167));
         }};
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/19a573c3/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v1d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v1d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v1d0.kryo
index 79629c9..f660f85 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v1d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v1d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/19a573c3/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo
index 79629c9..39aa210 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/metrics-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/19a573c3/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo
index 4065705..5eeb07d 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v1d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/19a573c3/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo
index 4065705..b9d8ae8 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traversalmetrics-v3d0.kryo differ


[27/50] [abbrv] tinkerpop git commit: TINKERPOP-1698 Gryo 3.0 WIP

Posted by sp...@apache.org.
TINKERPOP-1698 Gryo 3.0 WIP


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

Branch: refs/heads/TINKERPOP-1686
Commit: 87ca1e35ad233efc9a4b51967373094f0161c44e
Parents: c3cfaea
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jun 22 19:01:05 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 14:12:46 2017 -0400

----------------------------------------------------------------------
 .../structure/io/gryo/GryoSerializers.java      | 285 --------------
 .../structure/io/gryo/GryoSerializersV1d0.java  | 285 ++++++++++++++
 .../structure/io/gryo/GryoSerializersV3d0.java  | 380 +++++++++++++++++++
 .../gremlin/structure/io/gryo/GryoVersion.java  |  63 +--
 .../structure/util/detached/DetachedVertex.java |   1 +
 .../util/detached/DetachedVertexProperty.java   |   9 +
 .../driver/ser/GryoMessageSerializerV1d0.java   |   5 +-
 .../driver/ser/GryoMessageSerializerV3d0.java   |  56 +++
 .../tinkerpop/gremlin/driver/ser/SerTokens.java |   1 +
 gremlin-server/conf/gremlin-server.yaml         |   1 +
 .../structure/io/gryo/_3_3_0/edge-v3d0.kryo     | Bin 57 -> 41 bytes
 .../structure/io/gryo/_3_3_0/property-v3d0.kryo |   2 +-
 .../io/gryo/_3_3_0/standardresult-v3d0.kryo     | Bin 230 -> 235 bytes
 .../io/gryo/_3_3_0/traverser-v3d0.kryo          | Bin 211 -> 216 bytes
 .../structure/io/gryo/_3_3_0/tree-v3d0.kryo     | Bin 284 -> 293 bytes
 .../structure/io/gryo/_3_3_0/vertex-v3d0.kryo   | Bin 202 -> 207 bytes
 .../io/gryo/_3_3_0/vertexproperty-v3d0.kryo     | Bin 18 -> 26 bytes
 .../structure/io/gryo/GryoRegistrator.java      |  30 +-
 18 files changed, 788 insertions(+), 330 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java
deleted file mode 100644
index dd88a56..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.structure.io.gryo;
-
-import org.apache.tinkerpop.gremlin.process.remote.traversal.DefaultRemoteTraverser;
-import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
-import org.apache.tinkerpop.gremlin.process.traversal.P;
-import org.apache.tinkerpop.gremlin.process.traversal.Path;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
-import org.apache.tinkerpop.gremlin.process.traversal.util.AndP;
-import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP;
-import org.apache.tinkerpop.gremlin.process.traversal.util.OrP;
-import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.InputShim;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShim;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.OutputShim;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.SerializerShim;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedPath;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedProperty;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty;
-import org.apache.tinkerpop.gremlin.util.function.Lambda;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Class used to serialize graph-based objects such as vertices, edges, properties, and paths. These objects are
- * "detached" using {@link DetachedFactory} before serialization. These serializers present a generalized way to
- * serialize the implementations of core interfaces.
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class GryoSerializers {
-
-    /**
-     * Serializes any {@link Edge} implementation encountered to a {@link DetachedEdge}.
-     */
-    public final static class EdgeSerializer implements SerializerShim<Edge> {
-        @Override
-        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Edge edge) {
-            kryo.writeClassAndObject(output, DetachedFactory.detach(edge, true));
-        }
-
-        @Override
-        public <I extends InputShim> Edge read(final KryoShim<I, ?> kryo, final I input, final Class<Edge> edgeClass) {
-            final Object o = kryo.readClassAndObject(input);
-            return (Edge) o;
-        }
-    }
-
-    /**
-     * Serializes any {@link Vertex} implementation encountered to an {@link DetachedVertex}.
-     */
-    public final static class VertexSerializer implements SerializerShim<Vertex> {
-        @Override
-        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Vertex vertex) {
-            kryo.writeClassAndObject(output, DetachedFactory.detach(vertex, true));
-        }
-
-        @Override
-        public <I extends InputShim> Vertex read(final KryoShim<I, ?> kryo, final I input, final Class<Vertex> vertexClass) {
-            return (Vertex) kryo.readClassAndObject(input);
-        }
-    }
-
-    /**
-     * Serializes any {@link Property} implementation encountered to an {@link DetachedProperty}.
-     */
-    public final static class PropertySerializer implements SerializerShim<Property> {
-        @Override
-        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Property property) {
-            kryo.writeClassAndObject(output, property instanceof VertexProperty ? DetachedFactory.detach((VertexProperty) property, true) : DetachedFactory.detach(property));
-        }
-
-        @Override
-        public <I extends InputShim> Property read(final KryoShim<I, ?> kryo, final I input, final Class<Property> propertyClass) {
-            return (Property) kryo.readClassAndObject(input);
-        }
-    }
-
-    /**
-     * Serializes any {@link VertexProperty} implementation encountered to an {@link DetachedVertexProperty}.
-     */
-    public final static class VertexPropertySerializer implements SerializerShim<VertexProperty> {
-        @Override
-        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final VertexProperty vertexProperty) {
-            kryo.writeClassAndObject(output, DetachedFactory.detach(vertexProperty, true));
-        }
-
-        @Override
-        public <I extends InputShim> VertexProperty read(final KryoShim<I, ?> kryo, final I input, final Class<VertexProperty> vertexPropertyClass) {
-            return (VertexProperty) kryo.readClassAndObject(input);
-        }
-    }
-
-    /**
-     * Serializes any {@link Path} implementation encountered to an {@link DetachedPath}.
-     */
-    public final static class PathSerializer implements SerializerShim<Path> {
-        @Override
-        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Path path) {
-            kryo.writeClassAndObject(output, DetachedFactory.detach(path, false));
-        }
-
-        @Override
-        public <I extends InputShim> Path read(final KryoShim<I, ?> kryo, final I input, final Class<Path> pathClass) {
-            return (Path) kryo.readClassAndObject(input);
-        }
-    }
-
-    public final static class BytecodeSerializer implements SerializerShim<Bytecode> {
-        @Override
-        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Bytecode bytecode) {
-            writeInstructions(kryo, output, bytecode.getSourceInstructions());
-            writeInstructions(kryo, output, bytecode.getStepInstructions());
-        }
-
-        @Override
-        public <I extends InputShim> Bytecode read(final KryoShim<I, ?> kryo, final I input, final Class<Bytecode> clazz) {
-            final Bytecode bytecode = new Bytecode();
-            final int sourceInstructionCount = input.readInt();
-            for (int ix = 0; ix < sourceInstructionCount; ix++) {
-                final String operator = input.readString();
-                final Object[] args = operator.equals(TraversalSource.Symbols.withoutStrategies) ?
-                        kryo.readObject(input, Class[].class) :
-                        kryo.readObject(input, Object[].class);
-                bytecode.addSource(operator, args);
-            }
-
-            final int stepInstructionCount = input.readInt();
-            for (int ix = 0; ix < stepInstructionCount; ix++) {
-                final String operator = input.readString();
-                final Object[] args = kryo.readObject(input, Object[].class);
-                bytecode.addStep(operator, args);
-            }
-
-            return bytecode;
-        }
-
-        private static <O extends OutputShim> void writeInstructions(final KryoShim<?, O> kryo, final O output,
-                                                                     final List<Bytecode.Instruction> instructions) {
-            output.writeInt(instructions.size());
-            for (Bytecode.Instruction inst : instructions) {
-                output.writeString(inst.getOperator());
-                kryo.writeObject(output, inst.getArguments());
-            }
-        }
-    }
-
-    public final static class PSerializer implements SerializerShim<P> {
-        @Override
-        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final P p) {
-            output.writeString(p instanceof ConnectiveP ?
-                    (p instanceof AndP ? "and" : "or") :
-                    p.getBiPredicate().toString());
-            if (p instanceof ConnectiveP || p.getValue() instanceof Collection) {
-                output.writeByte((byte) 0);
-                final Collection<?> coll = p instanceof ConnectiveP ?
-                        ((ConnectiveP<?>) p).getPredicates() : (Collection) p.getValue();
-                output.writeInt(coll.size());
-                coll.forEach(v -> kryo.writeClassAndObject(output, v));
-            } else {
-                output.writeByte((byte) 1);
-                kryo.writeClassAndObject(output, p.getValue());
-            }
-        }
-
-        @Override
-        public <I extends InputShim> P read(final KryoShim<I, ?> kryo, final I input, final Class<P> clazz) {
-            final String predicate = input.readString();
-            final boolean isCollection = input.readByte() == (byte) 0;
-            final Object value;
-            if (isCollection) {
-                value = new ArrayList();
-                final int size = input.readInt();
-                for (int ix = 0; ix < size; ix++) {
-                    ((List) value).add(kryo.readClassAndObject(input));
-                }
-            } else {
-                value = kryo.readClassAndObject(input);
-            }
-
-            try {
-                if (predicate.equals("and") || predicate.equals("or"))
-                    return predicate.equals("and") ? new AndP((List<P>) value) : new OrP((List<P>) value);
-                else if (value instanceof Collection) {
-                    if (predicate.equals("between"))
-                        return P.between(((List) value).get(0), ((List) value).get(1));
-                    else if (predicate.equals("inside"))
-                        return P.inside(((List) value).get(0), ((List) value).get(1));
-                    else if (predicate.equals("outside"))
-                        return P.outside(((List) value).get(0), ((List) value).get(1));
-                    else if (predicate.equals("within"))
-                        return P.within((Collection) value);
-                    else if (predicate.equals("without"))
-                        return P.without((Collection) value);
-                    else
-                        return (P) P.class.getMethod(predicate, Collection.class).invoke(null, (Collection) value);
-                } else
-                    return (P) P.class.getMethod(predicate, Object.class).invoke(null, value);
-            } catch (final Exception e) {
-                throw new IllegalStateException(e.getMessage(), e);
-            }
-        }
-    }
-
-    public final static class LambdaSerializer implements SerializerShim<Lambda> {
-        @Override
-        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Lambda lambda) {
-            output.writeString(lambda.getLambdaScript());
-            output.writeString(lambda.getLambdaLanguage());
-            output.writeInt(lambda.getLambdaArguments());
-        }
-
-        @Override
-        public <I extends InputShim> Lambda read(final KryoShim<I, ?> kryo, final I input, final Class<Lambda> clazz) {
-            final String script = input.readString();
-            final String language = input.readString();
-            final int arguments = input.readInt();
-            //
-            if (-1 == arguments || arguments > 2)
-                return new Lambda.UnknownArgLambda(script, language, arguments);
-            else if (0 == arguments)
-                return new Lambda.ZeroArgLambda<>(script, language);
-            else if (1 == arguments)
-                return new Lambda.OneArgLambda<>(script, language);
-            else
-                return new Lambda.TwoArgLambda<>(script, language);
-        }
-    }
-
-    public final static class BindingSerializer implements SerializerShim<Bytecode.Binding> {
-        @Override
-        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Bytecode.Binding binding) {
-            output.writeString(binding.variable());
-            kryo.writeClassAndObject(output, binding.value());
-        }
-
-        @Override
-        public <I extends InputShim> Bytecode.Binding read(final KryoShim<I, ?> kryo, final I input, final Class<Bytecode.Binding> clazz) {
-            final String var = input.readString();
-            final Object val = kryo.readClassAndObject(input);
-            return new Bytecode.Binding(var, val);
-        }
-    }
-
-    public final static class DefaultRemoteTraverserSerializer implements SerializerShim<DefaultRemoteTraverser> {
-        @Override
-        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final DefaultRemoteTraverser remoteTraverser) {
-            kryo.writeClassAndObject(output, remoteTraverser.get());
-            output.writeLong(remoteTraverser.bulk());
-        }
-
-        @Override
-        public <I extends InputShim> DefaultRemoteTraverser read(final KryoShim<I, ?> kryo, final I input, final Class<DefaultRemoteTraverser> remoteTraverserClass) {
-            final Object o = kryo.readClassAndObject(input);
-            return new DefaultRemoteTraverser<>(o, input.readLong());
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV1d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV1d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV1d0.java
new file mode 100644
index 0000000..2851baa
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV1d0.java
@@ -0,0 +1,285 @@
+/*
+ * 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.gremlin.process.remote.traversal.DefaultRemoteTraverser;
+import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
+import org.apache.tinkerpop.gremlin.process.traversal.P;
+import org.apache.tinkerpop.gremlin.process.traversal.Path;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.util.AndP;
+import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP;
+import org.apache.tinkerpop.gremlin.process.traversal.util.OrP;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.InputShim;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShim;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.OutputShim;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.SerializerShim;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedPath;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedProperty;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty;
+import org.apache.tinkerpop.gremlin.util.function.Lambda;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * This class holds serializers for graph-based objects such as vertices, edges, properties, and paths. These objects
+ * are "detached" using {@link DetachedFactory} before serialization. These serializers present a generalized way to
+ * serialize the implementations of core interfaces. These are serializers for Gryo 1.0.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class GryoSerializersV1d0 {
+
+    /**
+     * Serializes any {@link Edge} implementation encountered to a {@link DetachedEdge}.
+     */
+    public final static class EdgeSerializer implements SerializerShim<Edge> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Edge edge) {
+            kryo.writeClassAndObject(output, DetachedFactory.detach(edge, true));
+        }
+
+        @Override
+        public <I extends InputShim> Edge read(final KryoShim<I, ?> kryo, final I input, final Class<Edge> edgeClass) {
+            final Object o = kryo.readClassAndObject(input);
+            return (Edge) o;
+        }
+    }
+
+    /**
+     * Serializes any {@link Vertex} implementation encountered to an {@link DetachedVertex}.
+     */
+    public final static class VertexSerializer implements SerializerShim<Vertex> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Vertex vertex) {
+            kryo.writeClassAndObject(output, DetachedFactory.detach(vertex, true));
+        }
+
+        @Override
+        public <I extends InputShim> Vertex read(final KryoShim<I, ?> kryo, final I input, final Class<Vertex> vertexClass) {
+            return (Vertex) kryo.readClassAndObject(input);
+        }
+    }
+
+    /**
+     * Serializes any {@link Property} implementation encountered to an {@link DetachedProperty}.
+     */
+    public final static class PropertySerializer implements SerializerShim<Property> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Property property) {
+            kryo.writeClassAndObject(output, property instanceof VertexProperty ? DetachedFactory.detach((VertexProperty) property, true) : DetachedFactory.detach(property));
+        }
+
+        @Override
+        public <I extends InputShim> Property read(final KryoShim<I, ?> kryo, final I input, final Class<Property> propertyClass) {
+            return (Property) kryo.readClassAndObject(input);
+        }
+    }
+
+    /**
+     * Serializes any {@link VertexProperty} implementation encountered to an {@link DetachedVertexProperty}.
+     */
+    public final static class VertexPropertySerializer implements SerializerShim<VertexProperty> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final VertexProperty vertexProperty) {
+            kryo.writeClassAndObject(output, DetachedFactory.detach(vertexProperty, true));
+        }
+
+        @Override
+        public <I extends InputShim> VertexProperty read(final KryoShim<I, ?> kryo, final I input, final Class<VertexProperty> vertexPropertyClass) {
+            return (VertexProperty) kryo.readClassAndObject(input);
+        }
+    }
+
+    /**
+     * Serializes any {@link Path} implementation encountered to an {@link DetachedPath}.
+     */
+    public final static class PathSerializer implements SerializerShim<Path> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Path path) {
+            kryo.writeClassAndObject(output, DetachedFactory.detach(path, false));
+        }
+
+        @Override
+        public <I extends InputShim> Path read(final KryoShim<I, ?> kryo, final I input, final Class<Path> pathClass) {
+            return (Path) kryo.readClassAndObject(input);
+        }
+    }
+
+    public final static class BytecodeSerializer implements SerializerShim<Bytecode> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Bytecode bytecode) {
+            writeInstructions(kryo, output, bytecode.getSourceInstructions());
+            writeInstructions(kryo, output, bytecode.getStepInstructions());
+        }
+
+        @Override
+        public <I extends InputShim> Bytecode read(final KryoShim<I, ?> kryo, final I input, final Class<Bytecode> clazz) {
+            final Bytecode bytecode = new Bytecode();
+            final int sourceInstructionCount = input.readInt();
+            for (int ix = 0; ix < sourceInstructionCount; ix++) {
+                final String operator = input.readString();
+                final Object[] args = operator.equals(TraversalSource.Symbols.withoutStrategies) ?
+                        kryo.readObject(input, Class[].class) :
+                        kryo.readObject(input, Object[].class);
+                bytecode.addSource(operator, args);
+            }
+
+            final int stepInstructionCount = input.readInt();
+            for (int ix = 0; ix < stepInstructionCount; ix++) {
+                final String operator = input.readString();
+                final Object[] args = kryo.readObject(input, Object[].class);
+                bytecode.addStep(operator, args);
+            }
+
+            return bytecode;
+        }
+
+        private static <O extends OutputShim> void writeInstructions(final KryoShim<?, O> kryo, final O output,
+                                                                     final List<Bytecode.Instruction> instructions) {
+            output.writeInt(instructions.size());
+            for (Bytecode.Instruction inst : instructions) {
+                output.writeString(inst.getOperator());
+                kryo.writeObject(output, inst.getArguments());
+            }
+        }
+    }
+
+    public final static class PSerializer implements SerializerShim<P> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final P p) {
+            output.writeString(p instanceof ConnectiveP ?
+                    (p instanceof AndP ? "and" : "or") :
+                    p.getBiPredicate().toString());
+            if (p instanceof ConnectiveP || p.getValue() instanceof Collection) {
+                output.writeByte((byte) 0);
+                final Collection<?> coll = p instanceof ConnectiveP ?
+                        ((ConnectiveP<?>) p).getPredicates() : (Collection) p.getValue();
+                output.writeInt(coll.size());
+                coll.forEach(v -> kryo.writeClassAndObject(output, v));
+            } else {
+                output.writeByte((byte) 1);
+                kryo.writeClassAndObject(output, p.getValue());
+            }
+        }
+
+        @Override
+        public <I extends InputShim> P read(final KryoShim<I, ?> kryo, final I input, final Class<P> clazz) {
+            final String predicate = input.readString();
+            final boolean isCollection = input.readByte() == (byte) 0;
+            final Object value;
+            if (isCollection) {
+                value = new ArrayList();
+                final int size = input.readInt();
+                for (int ix = 0; ix < size; ix++) {
+                    ((List) value).add(kryo.readClassAndObject(input));
+                }
+            } else {
+                value = kryo.readClassAndObject(input);
+            }
+
+            try {
+                if (predicate.equals("and") || predicate.equals("or"))
+                    return predicate.equals("and") ? new AndP((List<P>) value) : new OrP((List<P>) value);
+                else if (value instanceof Collection) {
+                    if (predicate.equals("between"))
+                        return P.between(((List) value).get(0), ((List) value).get(1));
+                    else if (predicate.equals("inside"))
+                        return P.inside(((List) value).get(0), ((List) value).get(1));
+                    else if (predicate.equals("outside"))
+                        return P.outside(((List) value).get(0), ((List) value).get(1));
+                    else if (predicate.equals("within"))
+                        return P.within((Collection) value);
+                    else if (predicate.equals("without"))
+                        return P.without((Collection) value);
+                    else
+                        return (P) P.class.getMethod(predicate, Collection.class).invoke(null, (Collection) value);
+                } else
+                    return (P) P.class.getMethod(predicate, Object.class).invoke(null, value);
+            } catch (final Exception e) {
+                throw new IllegalStateException(e.getMessage(), e);
+            }
+        }
+    }
+
+    public final static class LambdaSerializer implements SerializerShim<Lambda> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Lambda lambda) {
+            output.writeString(lambda.getLambdaScript());
+            output.writeString(lambda.getLambdaLanguage());
+            output.writeInt(lambda.getLambdaArguments());
+        }
+
+        @Override
+        public <I extends InputShim> Lambda read(final KryoShim<I, ?> kryo, final I input, final Class<Lambda> clazz) {
+            final String script = input.readString();
+            final String language = input.readString();
+            final int arguments = input.readInt();
+            //
+            if (-1 == arguments || arguments > 2)
+                return new Lambda.UnknownArgLambda(script, language, arguments);
+            else if (0 == arguments)
+                return new Lambda.ZeroArgLambda<>(script, language);
+            else if (1 == arguments)
+                return new Lambda.OneArgLambda<>(script, language);
+            else
+                return new Lambda.TwoArgLambda<>(script, language);
+        }
+    }
+
+    public final static class BindingSerializer implements SerializerShim<Bytecode.Binding> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Bytecode.Binding binding) {
+            output.writeString(binding.variable());
+            kryo.writeClassAndObject(output, binding.value());
+        }
+
+        @Override
+        public <I extends InputShim> Bytecode.Binding read(final KryoShim<I, ?> kryo, final I input, final Class<Bytecode.Binding> clazz) {
+            final String var = input.readString();
+            final Object val = kryo.readClassAndObject(input);
+            return new Bytecode.Binding(var, val);
+        }
+    }
+
+    public final static class DefaultRemoteTraverserSerializer implements SerializerShim<DefaultRemoteTraverser> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final DefaultRemoteTraverser remoteTraverser) {
+            kryo.writeClassAndObject(output, remoteTraverser.get());
+            output.writeLong(remoteTraverser.bulk());
+        }
+
+        @Override
+        public <I extends InputShim> DefaultRemoteTraverser read(final KryoShim<I, ?> kryo, final I input, final Class<DefaultRemoteTraverser> remoteTraverserClass) {
+            final Object o = kryo.readClassAndObject(input);
+            return new DefaultRemoteTraverser<>(o, input.readLong());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
new file mode 100644
index 0000000..eb940ff
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
@@ -0,0 +1,380 @@
+/*
+ * 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.gremlin.process.remote.traversal.DefaultRemoteTraverser;
+import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
+import org.apache.tinkerpop.gremlin.process.traversal.P;
+import org.apache.tinkerpop.gremlin.process.traversal.Path;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.util.AndP;
+import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP;
+import org.apache.tinkerpop.gremlin.process.traversal.util.OrP;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.InputShim;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShim;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.OutputShim;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.SerializerShim;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedPath;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedProperty;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty;
+import org.apache.tinkerpop.gremlin.util.function.Lambda;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * This class holds serializers for graph-based objects such as vertices, edges, properties, and paths. These objects
+ * are "detached" using {@link DetachedFactory} before serialization. These serializers present a generalized way to
+ * serialize the implementations of core interfaces. These serializers are versioned and not compatible with Gryo 1.0.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class GryoSerializersV3d0 {
+
+    /**
+     * Serializes any {@link Edge} implementation encountered to a {@link DetachedEdge}.
+     */
+    public final static class EdgeSerializer implements SerializerShim<Edge> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Edge edge) {
+            kryo.writeClassAndObject(output, edge.id());
+            output.writeString(edge.label());
+            kryo.writeClassAndObject(output, edge.inVertex().id());
+            output.writeString(edge.inVertex().label());
+            kryo.writeClassAndObject(output, edge.outVertex().id());
+            output.writeString(edge.outVertex().label());
+
+            final List<Property> properties = IteratorUtils.asList(edge.properties());
+            output.writeInt(properties.size());
+            properties.forEach(p -> {
+                output.writeString(p.key());
+                kryo.writeClassAndObject(output, p.value());
+            });
+        }
+
+        @Override
+        public <I extends InputShim> Edge read(final KryoShim<I, ?> kryo, final I input, final Class<Edge> edgeClass) {
+            final DetachedEdge.Builder builder = DetachedEdge.build();
+            builder.setId(kryo.readClassAndObject(input));
+            builder.setLabel(input.readString());
+
+            final DetachedVertex.Builder inV = DetachedVertex.build();
+            inV.setId(kryo.readClassAndObject(input));
+            inV.setLabel(input.readString());
+            builder.setInV(inV.create());
+
+            final DetachedVertex.Builder outV = DetachedVertex.build();
+            outV.setId(kryo.readClassAndObject(input));
+            outV.setLabel(input.readString());
+            builder.setOutV(outV.create());
+
+            final int numberOfProperties = input.readInt();
+            for (int ix = 0; ix < numberOfProperties; ix ++) {
+                builder.addProperty(new DetachedProperty<>(input.readString(), kryo.readClassAndObject(input)));
+            }
+
+            return builder.create();
+        }
+    }
+
+    /**
+     * Serializes any {@link Vertex} implementation encountered to an {@link DetachedVertex}.
+     */
+    public final static class VertexSerializer implements SerializerShim<Vertex> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Vertex vertex) {
+            kryo.writeClassAndObject(output, vertex.id());
+            output.writeString(vertex.label());
+
+            final List<VertexProperty> properties = IteratorUtils.asList(vertex.properties());
+            output.writeInt(properties.size());
+            properties.forEach(vp -> {
+                kryo.writeClassAndObject(output, vp.id());
+                output.writeString(vp.label());
+                kryo.writeClassAndObject(output, vp.value());
+
+                final List<Property> metaProperties = IteratorUtils.asList(vp.properties());
+                output.writeInt(metaProperties.size());
+                metaProperties.forEach(p -> {
+                    output.writeString(p.key());
+                    kryo.writeClassAndObject(output, p.value());
+                });
+            });
+        }
+
+        @Override
+        public <I extends InputShim> Vertex read(final KryoShim<I, ?> kryo, final I input, final Class<Vertex> vertexClass) {
+            final DetachedVertex.Builder builder = DetachedVertex.build();
+            builder.setId(kryo.readClassAndObject(input));
+            builder.setLabel(input.readString());
+
+            final int numberOfProperties = input.readInt();
+            for (int ix = 0; ix < numberOfProperties; ix ++) {
+                final DetachedVertexProperty.Builder vpBuilder = DetachedVertexProperty.build();
+                vpBuilder.setId(kryo.readClassAndObject(input));
+                vpBuilder.setLabel(input.readString());
+                vpBuilder.setValue(kryo.readClassAndObject(input));
+
+                final int numberOfMetaProperties = input.readInt();
+                for (int iy = 0; iy < numberOfMetaProperties; iy ++) {
+                    vpBuilder.addProperty(new DetachedProperty<>(input.readString(), kryo.readClassAndObject(input)));
+                }
+
+                builder.addProperty(vpBuilder.create());
+            }
+
+            return builder.create();
+        }
+    }
+
+    /**
+     * Serializes any {@link Property} implementation encountered to an {@link DetachedProperty}.
+     */
+    public final static class PropertySerializer implements SerializerShim<Property> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Property property) {
+            output.writeString(property.key());
+            kryo.writeClassAndObject(output, property.value());
+            kryo.writeClassAndObject(output, property.element().id());
+            output.writeString(property.element().label());
+        }
+
+        @Override
+        public <I extends InputShim> Property read(final KryoShim<I, ?> kryo, final I input, final Class<Property> propertyClass) {
+            return new DetachedProperty<>(input.readString(), kryo.readClassAndObject(input),
+                    DetachedVertex.build().setId(kryo.readClassAndObject(input)).setLabel(input.readString()).create());
+        }
+    }
+
+    /**
+     * Serializes any {@link VertexProperty} implementation encountered to an {@link DetachedVertexProperty}.
+     */
+    public final static class VertexPropertySerializer implements SerializerShim<VertexProperty> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final VertexProperty vertexProperty) {
+            kryo.writeClassAndObject(output, vertexProperty.id());
+            output.writeString(vertexProperty.label());
+            kryo.writeClassAndObject(output, vertexProperty.value());
+            kryo.writeClassAndObject(output, vertexProperty.element().id());
+            output.writeString(vertexProperty.element().label());
+
+            final List<Property> metaProperties = IteratorUtils.asList(vertexProperty.properties());
+            output.writeInt(metaProperties.size());
+            metaProperties.forEach(p -> {
+                output.writeString(p.key());
+                kryo.writeClassAndObject(output, p.value());
+            });
+        }
+
+        @Override
+        public <I extends InputShim> VertexProperty read(final KryoShim<I, ?> kryo, final I input, final Class<VertexProperty> vertexPropertyClass) {
+           final DetachedVertexProperty.Builder vpBuilder = DetachedVertexProperty.build();
+            vpBuilder.setId(kryo.readClassAndObject(input));
+            vpBuilder.setLabel(input.readString());
+            vpBuilder.setValue(kryo.readClassAndObject(input));
+
+            final DetachedVertex.Builder host = DetachedVertex.build();
+            host.setId(kryo.readClassAndObject(input));
+            host.setLabel(input.readString());
+            vpBuilder.setV(host.create());
+
+            final int numberOfMetaProperties = input.readInt();
+            for (int iy = 0; iy < numberOfMetaProperties; iy ++) {
+                vpBuilder.addProperty(new DetachedProperty<>(input.readString(), kryo.readClassAndObject(input)));
+            }
+
+            return vpBuilder.create();
+        }
+    }
+
+    /**
+     * Serializes any {@link Path} implementation encountered to an {@link DetachedPath}.
+     */
+    public final static class PathSerializer implements SerializerShim<Path> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Path path) {
+            kryo.writeClassAndObject(output, DetachedFactory.detach(path, false));
+        }
+
+        @Override
+        public <I extends InputShim> Path read(final KryoShim<I, ?> kryo, final I input, final Class<Path> pathClass) {
+            return (Path) kryo.readClassAndObject(input);
+        }
+    }
+
+    public final static class BytecodeSerializer implements SerializerShim<Bytecode> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Bytecode bytecode) {
+            writeInstructions(kryo, output, bytecode.getSourceInstructions());
+            writeInstructions(kryo, output, bytecode.getStepInstructions());
+        }
+
+        @Override
+        public <I extends InputShim> Bytecode read(final KryoShim<I, ?> kryo, final I input, final Class<Bytecode> clazz) {
+            final Bytecode bytecode = new Bytecode();
+            final int sourceInstructionCount = input.readInt();
+            for (int ix = 0; ix < sourceInstructionCount; ix++) {
+                final String operator = input.readString();
+                final Object[] args = operator.equals(TraversalSource.Symbols.withoutStrategies) ?
+                        kryo.readObject(input, Class[].class) :
+                        kryo.readObject(input, Object[].class);
+                bytecode.addSource(operator, args);
+            }
+
+            final int stepInstructionCount = input.readInt();
+            for (int ix = 0; ix < stepInstructionCount; ix++) {
+                final String operator = input.readString();
+                final Object[] args = kryo.readObject(input, Object[].class);
+                bytecode.addStep(operator, args);
+            }
+
+            return bytecode;
+        }
+
+        private static <O extends OutputShim> void writeInstructions(final KryoShim<?, O> kryo, final O output,
+                                                                     final List<Bytecode.Instruction> instructions) {
+            output.writeInt(instructions.size());
+            for (Bytecode.Instruction inst : instructions) {
+                output.writeString(inst.getOperator());
+                kryo.writeObject(output, inst.getArguments());
+            }
+        }
+    }
+
+    public final static class PSerializer implements SerializerShim<P> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final P p) {
+            output.writeString(p instanceof ConnectiveP ?
+                    (p instanceof AndP ? "and" : "or") :
+                    p.getBiPredicate().toString());
+            if (p instanceof ConnectiveP || p.getValue() instanceof Collection) {
+                output.writeByte((byte) 0);
+                final Collection<?> coll = p instanceof ConnectiveP ?
+                        ((ConnectiveP<?>) p).getPredicates() : (Collection) p.getValue();
+                output.writeInt(coll.size());
+                coll.forEach(v -> kryo.writeClassAndObject(output, v));
+            } else {
+                output.writeByte((byte) 1);
+                kryo.writeClassAndObject(output, p.getValue());
+            }
+        }
+
+        @Override
+        public <I extends InputShim> P read(final KryoShim<I, ?> kryo, final I input, final Class<P> clazz) {
+            final String predicate = input.readString();
+            final boolean isCollection = input.readByte() == (byte) 0;
+            final Object value;
+            if (isCollection) {
+                value = new ArrayList();
+                final int size = input.readInt();
+                for (int ix = 0; ix < size; ix++) {
+                    ((List) value).add(kryo.readClassAndObject(input));
+                }
+            } else {
+                value = kryo.readClassAndObject(input);
+            }
+
+            try {
+                if (predicate.equals("and") || predicate.equals("or"))
+                    return predicate.equals("and") ? new AndP((List<P>) value) : new OrP((List<P>) value);
+                else if (value instanceof Collection) {
+                    if (predicate.equals("between"))
+                        return P.between(((List) value).get(0), ((List) value).get(1));
+                    else if (predicate.equals("inside"))
+                        return P.inside(((List) value).get(0), ((List) value).get(1));
+                    else if (predicate.equals("outside"))
+                        return P.outside(((List) value).get(0), ((List) value).get(1));
+                    else if (predicate.equals("within"))
+                        return P.within((Collection) value);
+                    else if (predicate.equals("without"))
+                        return P.without((Collection) value);
+                    else
+                        return (P) P.class.getMethod(predicate, Collection.class).invoke(null, (Collection) value);
+                } else
+                    return (P) P.class.getMethod(predicate, Object.class).invoke(null, value);
+            } catch (final Exception e) {
+                throw new IllegalStateException(e.getMessage(), e);
+            }
+        }
+    }
+
+    public final static class LambdaSerializer implements SerializerShim<Lambda> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Lambda lambda) {
+            output.writeString(lambda.getLambdaScript());
+            output.writeString(lambda.getLambdaLanguage());
+            output.writeInt(lambda.getLambdaArguments());
+        }
+
+        @Override
+        public <I extends InputShim> Lambda read(final KryoShim<I, ?> kryo, final I input, final Class<Lambda> clazz) {
+            final String script = input.readString();
+            final String language = input.readString();
+            final int arguments = input.readInt();
+            //
+            if (-1 == arguments || arguments > 2)
+                return new Lambda.UnknownArgLambda(script, language, arguments);
+            else if (0 == arguments)
+                return new Lambda.ZeroArgLambda<>(script, language);
+            else if (1 == arguments)
+                return new Lambda.OneArgLambda<>(script, language);
+            else
+                return new Lambda.TwoArgLambda<>(script, language);
+        }
+    }
+
+    public final static class BindingSerializer implements SerializerShim<Bytecode.Binding> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Bytecode.Binding binding) {
+            output.writeString(binding.variable());
+            kryo.writeClassAndObject(output, binding.value());
+        }
+
+        @Override
+        public <I extends InputShim> Bytecode.Binding read(final KryoShim<I, ?> kryo, final I input, final Class<Bytecode.Binding> clazz) {
+            final String var = input.readString();
+            final Object val = kryo.readClassAndObject(input);
+            return new Bytecode.Binding(var, val);
+        }
+    }
+
+    public final static class DefaultRemoteTraverserSerializer implements SerializerShim<DefaultRemoteTraverser> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final DefaultRemoteTraverser remoteTraverser) {
+            kryo.writeClassAndObject(output, remoteTraverser.get());
+            output.writeLong(remoteTraverser.bulk());
+        }
+
+        @Override
+        public <I extends InputShim> DefaultRemoteTraverser read(final KryoShim<I, ?> kryo, final I input, final Class<DefaultRemoteTraverser> remoteTraverserClass) {
+            final Object o = kryo.readClassAndObject(input);
+            return new DefaultRemoteTraverser<>(o, input.readLong());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
index b524cbc..c0ed3e5 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
@@ -147,6 +147,7 @@ import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicLong;
+import java.util.function.Supplier;
 
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
@@ -158,6 +159,13 @@ public enum GryoVersion {
     private final String versionNumber;
     private final List<TypeRegistration<?>> registrations;
 
+    /**
+     * Creates a new {@link GryoVersion}.
+     *
+     * @param versionNumber the user facing string representation of the version which should follow an {@code x.y}
+     *                      pattern
+     * @param registrations the list of registrations for this version
+     */
     GryoVersion(final String versionNumber, final List<TypeRegistration<?>> registrations) {
         // Validate the default registrations
         // For justification of these default registration rules, see TinkerPopKryoRegistrator
@@ -173,6 +181,7 @@ public enum GryoVersion {
                 throw new IllegalStateException(msg);
             }
         }
+
         this.versionNumber = versionNumber;
         this.registrations = registrations;
     }
@@ -234,8 +243,8 @@ public enum GryoVersion {
             add(GryoTypeReg.of(LinkedList.class, 116));
             add(GryoTypeReg.of(Types.LINKED_HASH_MAP_ENTRY_CLASS, 15));
             add(GryoTypeReg.of(Locale.class, 22));
-            add(GryoTypeReg.of(StringBuffer.class, 43));
-            add(GryoTypeReg.of(StringBuilder.class, 44));
+//            add(GryoTypeReg.of(StringBuffer.class, 43));
+//            add(GryoTypeReg.of(StringBuilder.class, 44));
             add(GryoTypeReg.of(T.class, 48));
             add(GryoTypeReg.of(TimeZone.class, 42));
             add(GryoTypeReg.of(TreeMap.class, 45));
@@ -249,19 +258,19 @@ public enum GryoVersion {
             add(GryoTypeReg.of(InetAddress.class, 162, new UtilSerializers.InetAddressSerializer()));
             add(GryoTypeReg.of(ByteBuffer.class, 163, new UtilSerializers.ByteBufferSerializer()));
 
-            add(GryoTypeReg.of(ReferenceEdge.class, 81));
-            add(GryoTypeReg.of(ReferenceVertexProperty.class, 82));
-            add(GryoTypeReg.of(ReferenceProperty.class, 83));
-            add(GryoTypeReg.of(ReferenceVertex.class, 84));
-            add(GryoTypeReg.of(ReferencePath.class, 85));
+//            add(GryoTypeReg.of(ReferenceEdge.class, 81));
+//            add(GryoTypeReg.of(ReferenceVertexProperty.class, 82));
+//            add(GryoTypeReg.of(ReferenceProperty.class, 83));
+//            add(GryoTypeReg.of(ReferenceVertex.class, 84));
+//            add(GryoTypeReg.of(ReferencePath.class, 85));
 
             add(GryoTypeReg.of(StarGraph.class, 86, new StarGraphSerializer(Direction.BOTH, new GraphFilter())));
 
-            add(GryoTypeReg.of(Edge.class, 65, new GryoSerializers.EdgeSerializer()));
-            add(GryoTypeReg.of(Vertex.class, 66, new GryoSerializers.VertexSerializer()));
-            add(GryoTypeReg.of(Property.class, 67, new GryoSerializers.PropertySerializer()));
-            add(GryoTypeReg.of(VertexProperty.class, 68, new GryoSerializers.VertexPropertySerializer()));
-            add(GryoTypeReg.of(Path.class, 59, new GryoSerializers.PathSerializer()));
+            add(GryoTypeReg.of(Edge.class, 65, new GryoSerializersV3d0.EdgeSerializer()));
+            add(GryoTypeReg.of(Vertex.class, 66, new GryoSerializersV3d0.VertexSerializer()));
+            add(GryoTypeReg.of(Property.class, 67, new GryoSerializersV3d0.PropertySerializer()));
+            add(GryoTypeReg.of(VertexProperty.class, 68, new GryoSerializersV3d0.VertexPropertySerializer()));
+            add(GryoTypeReg.of(Path.class, 59, new GryoSerializersV3d0.PathSerializer()));
             // skip 55
             add(GryoTypeReg.of(B_O_Traverser.class, 75));
             add(GryoTypeReg.of(O_Traverser.class, 76));
@@ -272,12 +281,12 @@ public enum GryoVersion {
             add(GryoTypeReg.of(LP_O_OB_S_SE_SL_Traverser.class, 90));
             add(GryoTypeReg.of(LP_O_OB_P_S_SE_SL_Traverser.class, 91));
             add(GryoTypeReg.of(ProjectedTraverser.class, 168));
-            add(GryoTypeReg.of(DefaultRemoteTraverser.class, 123, new GryoSerializers.DefaultRemoteTraverserSerializer()));
+            add(GryoTypeReg.of(DefaultRemoteTraverser.class, 123, new GryoSerializersV3d0.DefaultRemoteTraverserSerializer()));
 
-            add(GryoTypeReg.of(Bytecode.class, 122, new GryoSerializers.BytecodeSerializer()));
-            add(GryoTypeReg.of(P.class, 124, new GryoSerializers.PSerializer()));
-            add(GryoTypeReg.of(Lambda.class, 125, new GryoSerializers.LambdaSerializer()));
-            add(GryoTypeReg.of(Bytecode.Binding.class, 126, new GryoSerializers.BindingSerializer()));
+            add(GryoTypeReg.of(Bytecode.class, 122, new GryoSerializersV3d0.BytecodeSerializer()));
+            add(GryoTypeReg.of(P.class, 124, new GryoSerializersV3d0.PSerializer()));
+            add(GryoTypeReg.of(Lambda.class, 125, new GryoSerializersV3d0.LambdaSerializer()));
+            add(GryoTypeReg.of(Bytecode.Binding.class, 126, new GryoSerializersV3d0.BindingSerializer()));
             add(GryoTypeReg.of(Order.class, 127));
             add(GryoTypeReg.of(Scope.class, 128));
             add(GryoTypeReg.of(VertexProperty.Cardinality.class, 131));
@@ -430,11 +439,11 @@ public enum GryoVersion {
 
             add(GryoTypeReg.of(StarGraph.class, 86, new StarGraphSerializer(Direction.BOTH, new GraphFilter())));
 
-            add(GryoTypeReg.of(Edge.class, 65, new GryoSerializers.EdgeSerializer()));
-            add(GryoTypeReg.of(Vertex.class, 66, new GryoSerializers.VertexSerializer()));
-            add(GryoTypeReg.of(Property.class, 67, new GryoSerializers.PropertySerializer()));
-            add(GryoTypeReg.of(VertexProperty.class, 68, new GryoSerializers.VertexPropertySerializer()));
-            add(GryoTypeReg.of(Path.class, 59, new GryoSerializers.PathSerializer()));
+            add(GryoTypeReg.of(Edge.class, 65, new GryoSerializersV1d0.EdgeSerializer()));
+            add(GryoTypeReg.of(Vertex.class, 66, new GryoSerializersV1d0.VertexSerializer()));
+            add(GryoTypeReg.of(Property.class, 67, new GryoSerializersV1d0.PropertySerializer()));
+            add(GryoTypeReg.of(VertexProperty.class, 68, new GryoSerializersV1d0.VertexPropertySerializer()));
+            add(GryoTypeReg.of(Path.class, 59, new GryoSerializersV1d0.PathSerializer()));
             // skip 55
             add(GryoTypeReg.of(B_O_Traverser.class, 75));
             add(GryoTypeReg.of(O_Traverser.class, 76));
@@ -445,12 +454,12 @@ public enum GryoVersion {
             add(GryoTypeReg.of(LP_O_OB_S_SE_SL_Traverser.class, 90));
             add(GryoTypeReg.of(LP_O_OB_P_S_SE_SL_Traverser.class, 91));
             add(GryoTypeReg.of(ProjectedTraverser.class, 164));
-            add(GryoTypeReg.of(DefaultRemoteTraverser.class, 123, new GryoSerializers.DefaultRemoteTraverserSerializer()));
+            add(GryoTypeReg.of(DefaultRemoteTraverser.class, 123, new GryoSerializersV1d0.DefaultRemoteTraverserSerializer()));
 
-            add(GryoTypeReg.of(Bytecode.class, 122, new GryoSerializers.BytecodeSerializer()));
-            add(GryoTypeReg.of(P.class, 124, new GryoSerializers.PSerializer()));
-            add(GryoTypeReg.of(Lambda.class, 125, new GryoSerializers.LambdaSerializer()));
-            add(GryoTypeReg.of(Bytecode.Binding.class, 126, new GryoSerializers.BindingSerializer()));
+            add(GryoTypeReg.of(Bytecode.class, 122, new GryoSerializersV1d0.BytecodeSerializer()));
+            add(GryoTypeReg.of(P.class, 124, new GryoSerializersV1d0.PSerializer()));
+            add(GryoTypeReg.of(Lambda.class, 125, new GryoSerializersV1d0.LambdaSerializer()));
+            add(GryoTypeReg.of(Bytecode.Binding.class, 126, new GryoSerializersV1d0.BindingSerializer()));
             add(GryoTypeReg.of(Order.class, 127));
             add(GryoTypeReg.of(Scope.class, 128));
             add(GryoTypeReg.of(VertexProperty.Cardinality.class, 131));

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
index 3f0b670..25bdbae 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertex.java
@@ -169,6 +169,7 @@ public class DetachedVertex extends DetachedElement<Vertex> implements Vertex {
 
         public Builder addProperty(final DetachedVertexProperty vp) {
             v.internalAddProperty(vp);
+            vp.internalSetVertex(v);
             return this;
         }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java
index 256fa7d..d9b917c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexProperty.java
@@ -132,6 +132,10 @@ public class DetachedVertexProperty<V> extends DetachedElement<VertexProperty<V>
         this.properties.put(p.key(), Collections.singletonList(p));
     }
 
+    public void internalSetVertex(final DetachedVertex vertex) {
+        this.vertex = vertex;
+    }
+
     /**
      * Provides a way to construct an immutable {@link DetachedEdge}.
      */
@@ -146,6 +150,11 @@ public class DetachedVertexProperty<V> extends DetachedElement<VertexProperty<V>
             this.vp = e;
         }
 
+        public Builder setV(final DetachedVertex v) {
+            vp.internalSetVertex(v);
+            return this;
+        }
+
         public Builder addProperty(final Property p) {
             vp.internalAddProperty(p);
             return this;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0.java
index 9b9f1f3..99a2e54 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.driver.ser;
 
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoVersion;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
 
 /**
@@ -39,7 +40,7 @@ public final class GryoMessageSerializerV1d0 extends AbstractGryoMessageSerializ
      * Creates an instance with a standard {@link GryoMapper} instance.
      */
     public GryoMessageSerializerV1d0() {
-        super(GryoMapper.build().create());
+        super(GryoMapper.build().version(GryoVersion.V1_0).create());
     }
 
     /**
@@ -47,7 +48,7 @@ public final class GryoMessageSerializerV1d0 extends AbstractGryoMessageSerializ
      * builder will be overridden by {@link #configure} if it is called.
      */
     public GryoMessageSerializerV1d0(final GryoMapper.Builder kryo) {
-        super(kryo.create());
+        super(kryo.version(GryoVersion.V1_0).create());
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV3d0.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV3d0.java
new file mode 100644
index 0000000..85b79a9
--- /dev/null
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV3d0.java
@@ -0,0 +1,56 @@
+/*
+ * 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.driver.ser;
+
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoVersion;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
+
+/**
+ * The standard Gryo serializer that uses "detached" graph elements during serialization. Detached elements such as
+ * {@link DetachedVertex} include the label and the properties associated with it which could be more costly for
+ * network serialization purposes.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public final class GryoMessageSerializerV3d0 extends AbstractGryoMessageSerializerV3d0 {
+
+    private static final String MIME_TYPE = SerTokens.MIME_GRYO_V3D0;
+    private static final String MIME_TYPE_STRINGD = SerTokens.MIME_GRYO_V3D0 + "-stringd";
+
+    /**
+     * Creates an instance with a standard {@link GryoMapper} instance.
+     */
+    public GryoMessageSerializerV3d0() {
+        super(GryoMapper.build().version(GryoVersion.V3_0).create());
+    }
+
+    /**
+     * Creates an instance with a standard {@link GryoMapper} instance. Note that the instance created by the supplied
+     * builder will be overridden by {@link #configure} if it is called.
+     */
+    public GryoMessageSerializerV3d0(final GryoMapper.Builder kryo) {
+        super(kryo.version(GryoVersion.V3_0).create());
+    }
+
+    @Override
+    public String[] mimeTypesSupported() {
+        return new String[]{serializeToString ? MIME_TYPE_STRINGD : MIME_TYPE};
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/SerTokens.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/SerTokens.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/SerTokens.java
index f342a57..f0ab1e8 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/SerTokens.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/SerTokens.java
@@ -41,5 +41,6 @@ public final  class SerTokens {
     public static final String MIME_GRAPHSON_V2D0 = "application/vnd.gremlin-v2.0+json";
     public static final String MIME_GRAPHSON_V3D0 = "application/vnd.gremlin-v3.0+json";
     public static final String MIME_GRYO_V1D0 = "application/vnd.gremlin-v1.0+gryo";
+    public static final String MIME_GRYO_V3D0 = "application/vnd.gremlin-v3.0+gryo";
     public static final String MIME_GRYO_LITE_V1D0 = "application/vnd.gremlin-v1.0+gryo-lite";
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-server/conf/gremlin-server.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server.yaml b/gremlin-server/conf/gremlin-server.yaml
index f86fec4..7961217 100644
--- a/gremlin-server/conf/gremlin-server.yaml
+++ b/gremlin-server/conf/gremlin-server.yaml
@@ -29,6 +29,7 @@ scriptEngines: {
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy]}}}}
 serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}             # application/vnd.gremlin-v3.0+gryo
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/edge-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/edge-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/edge-v3d0.kryo
index d2a2492..b58bff1 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/edge-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/edge-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/property-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/property-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/property-v3d0.kryo
index 133ac6f..a7d9c27 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/property-v3d0.kryo
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/property-v3d0.kryo
@@ -1 +1 @@
-sinc��
\ No newline at end of file
+sinc��develop�
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/standardresult-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/standardresult-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/standardresult-v3d0.kryo
index d59d6c1..b1a2558 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/standardresult-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/standardresult-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traverser-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traverser-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traverser-v3d0.kryo
index cc019f0..9ec67de 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traverser-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/traverser-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/tree-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/tree-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/tree-v3d0.kryo
index 682529f..94d1357 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/tree-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/tree-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertex-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertex-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertex-v3d0.kryo
index c58ac46..eb46417 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertex-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertex-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertexproperty-v3d0.kryo
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertexproperty-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertexproperty-v3d0.kryo
index 3b74daa..3139408 100644
Binary files a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertexproperty-v3d0.kryo and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_0/vertexproperty-v3d0.kryo differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/87ca1e35/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java
index 14212dc..7a7f29b 100644
--- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java
+++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java
@@ -40,7 +40,7 @@ import org.apache.tinkerpop.gremlin.spark.structure.io.gryo.kryoshim.unshaded.Un
 import org.apache.tinkerpop.gremlin.structure.io.IoRegistry;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoSerializers;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoSerializersV1d0;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.TypeRegistration;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.SerializerShim;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.shaded.ShadedSerializerAdapter;
@@ -210,23 +210,23 @@ public class GryoRegistrator implements KryoRegistrator {
         m.put(VertexWritable.class, new UnshadedSerializerAdapter<>(new VertexWritableSerializer()));
         m.put(ObjectWritable.class, new UnshadedSerializerAdapter<>(new ObjectWritableSerializer<>()));
         //
-        m.put(HadoopVertex.class, new UnshadedSerializerAdapter<>(new GryoSerializers.VertexSerializer()));
-        m.put(HadoopVertexProperty.class, new UnshadedSerializerAdapter<>(new GryoSerializers.VertexPropertySerializer()));
-        m.put(HadoopProperty.class, new UnshadedSerializerAdapter<>(new GryoSerializers.PropertySerializer()));
-        m.put(HadoopEdge.class, new UnshadedSerializerAdapter<>(new GryoSerializers.EdgeSerializer()));
+        m.put(HadoopVertex.class, new UnshadedSerializerAdapter<>(new GryoSerializersV1d0.VertexSerializer()));
+        m.put(HadoopVertexProperty.class, new UnshadedSerializerAdapter<>(new GryoSerializersV1d0.VertexPropertySerializer()));
+        m.put(HadoopProperty.class, new UnshadedSerializerAdapter<>(new GryoSerializersV1d0.PropertySerializer()));
+        m.put(HadoopEdge.class, new UnshadedSerializerAdapter<>(new GryoSerializersV1d0.EdgeSerializer()));
         //
-        m.put(ComputerGraph.ComputerVertex.class, new UnshadedSerializerAdapter<>(new GryoSerializers.VertexSerializer()));
-        m.put(ComputerGraph.ComputerVertexProperty.class, new UnshadedSerializerAdapter<>(new GryoSerializers.VertexPropertySerializer()));
-        m.put(ComputerGraph.ComputerProperty.class, new UnshadedSerializerAdapter<>(new GryoSerializers.PropertySerializer()));
-        m.put(ComputerGraph.ComputerEdge.class, new UnshadedSerializerAdapter<>(new GryoSerializers.EdgeSerializer()));
+        m.put(ComputerGraph.ComputerVertex.class, new UnshadedSerializerAdapter<>(new GryoSerializersV1d0.VertexSerializer()));
+        m.put(ComputerGraph.ComputerVertexProperty.class, new UnshadedSerializerAdapter<>(new GryoSerializersV1d0.VertexPropertySerializer()));
+        m.put(ComputerGraph.ComputerProperty.class, new UnshadedSerializerAdapter<>(new GryoSerializersV1d0.PropertySerializer()));
+        m.put(ComputerGraph.ComputerEdge.class, new UnshadedSerializerAdapter<>(new GryoSerializersV1d0.EdgeSerializer()));
         //
-        m.put(StarGraph.StarEdge.class, new UnshadedSerializerAdapter<>(new GryoSerializers.EdgeSerializer()));
-        m.put(StarGraph.StarVertex.class, new UnshadedSerializerAdapter<>(new GryoSerializers.VertexSerializer()));
-        m.put(StarGraph.StarProperty.class, new UnshadedSerializerAdapter<>(new GryoSerializers.PropertySerializer()));
-        m.put(StarGraph.StarVertexProperty.class, new UnshadedSerializerAdapter<>(new GryoSerializers.VertexPropertySerializer()));
+        m.put(StarGraph.StarEdge.class, new UnshadedSerializerAdapter<>(new GryoSerializersV1d0.EdgeSerializer()));
+        m.put(StarGraph.StarVertex.class, new UnshadedSerializerAdapter<>(new GryoSerializersV1d0.VertexSerializer()));
+        m.put(StarGraph.StarProperty.class, new UnshadedSerializerAdapter<>(new GryoSerializersV1d0.PropertySerializer()));
+        m.put(StarGraph.StarVertexProperty.class, new UnshadedSerializerAdapter<>(new GryoSerializersV1d0.VertexPropertySerializer()));
         //
-        m.put(MutablePath.class, new UnshadedSerializerAdapter<>(new GryoSerializers.PathSerializer()));
-        m.put(ImmutablePath.class, new UnshadedSerializerAdapter<>(new GryoSerializers.PathSerializer()));
+        m.put(MutablePath.class, new UnshadedSerializerAdapter<>(new GryoSerializersV1d0.PathSerializer()));
+        m.put(ImmutablePath.class, new UnshadedSerializerAdapter<>(new GryoSerializersV1d0.PathSerializer()));
         //
         m.put(CompactBuffer[].class, null);
         // TODO: VoidSerializer is a default serializer and thus, may not be needed (if it is, you can't use FieldSerializer)


[04/50] [abbrv] tinkerpop git commit: Updated old, dead codehaus link CTR

Posted by sp...@apache.org.
Updated old, dead codehaus link CTR


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

Branch: refs/heads/TINKERPOP-1686
Commit: faa7611197fcc412008c81977d0b268156e3a3af
Parents: beb9a84
Author: Robert Dale <ro...@gmail.com>
Authored: Tue Jul 4 08:49:26 2017 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Tue Jul 4 08:49:26 2017 -0400

----------------------------------------------------------------------
 .../gremlin/console/jsr223/UtilitiesGremlinPluginScript.groovy   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/faa76111/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/jsr223/UtilitiesGremlinPluginScript.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/jsr223/UtilitiesGremlinPluginScript.groovy b/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/jsr223/UtilitiesGremlinPluginScript.groovy
index 5f5e3c6..bfa6690 100644
--- a/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/jsr223/UtilitiesGremlinPluginScript.groovy
+++ b/gremlin-console/src/main/resources/org/apache/tinkerpop/gremlin/console/jsr223/UtilitiesGremlinPluginScript.groovy
@@ -34,7 +34,7 @@ describeGraph = { Class<? extends org.apache.tinkerpop.gremlin.structure.Graph>
     def testsOptedOut = optOuts != null && optOuts.size() > 0 ? optOuts.collect { "> " + it.test() + "#" + it.method() + "${lf}\t\"" + it.reason() + "\"" }.join(lf) : "> none";
 
     // not the use of {lf} here rather than triple quoted string is that groovy 2.4.0 seems to have trouble
-    // parsing that into groovysh - note the bug report here: https://jira.codehaus.org/browse/GROOVY-7290
+    // parsing that into groovysh - note the bug report here: https://issues.apache.org/jira/browse/GROOVY-7290
     return "${lf}" +
 "IMPLEMENTATION - ${c.getCanonicalName()} ${lf}" +
 "TINKERPOP TEST SUITE ${lf}" +
@@ -49,4 +49,4 @@ describeGraph = { Class<? extends org.apache.tinkerpop.gremlin.structure.Graph>
 "the implementation itself.  Compliant implementations will faithfully and ${lf}" +
 "honestly supply these Annotations to provide the most accurate depiction of ${lf}" +
 "their support."
-}
\ No newline at end of file
+}


[23/50] [abbrv] tinkerpop git commit: Merge branch 'tp32'

Posted by sp...@apache.org.
Merge branch 'tp32'

Conflicts:
	gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java


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

Branch: refs/heads/TINKERPOP-1686
Commit: 22e2d9d9037fdfc0218a0e6e4d81bdf250fa7160
Parents: 3477dc7 402678b
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jul 6 10:18:25 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Jul 6 10:18:25 2017 -0400

----------------------------------------------------------------------

----------------------------------------------------------------------



[06/50] [abbrv] tinkerpop git commit: Minor tutorial fix

Posted by sp...@apache.org.
Minor tutorial fix


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

Branch: refs/heads/TINKERPOP-1686
Commit: 28ab372bc49194866d6899a92744159d10843400
Parents: 8460854
Author: Mihails Volkovs <mi...@gmail.com>
Authored: Tue Jul 4 17:37:09 2017 +0300
Committer: Mihails Volkovs <mi...@gmail.com>
Committed: Wed Jul 5 14:28:06 2017 +0300

----------------------------------------------------------------------
 docs/src/tutorials/getting-started/index.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28ab372b/docs/src/tutorials/getting-started/index.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/tutorials/getting-started/index.asciidoc b/docs/src/tutorials/getting-started/index.asciidoc
index 7af5364..f5d9f86 100644
--- a/docs/src/tutorials/getting-started/index.asciidoc
+++ b/docs/src/tutorials/getting-started/index.asciidoc
@@ -535,7 +535,7 @@ containing a Gremlin script to be processed with results returned.
 $ curl -L -O https://www.apache.org/dist/tinkerpop/x.y.z/apache-tinkerpop-gremlin-server-x.y.z-bin.zip
 $ unzip apache-tinkerpop-gremlin-server-x.y.z-bin.zip
 $ cd apache-tinkerpop-gremlin-server-x.y.z
-$ bin/gremlin-server.sh conf/gremlin-server-modern.yaml
+$ bin/gremlin-server.sh conf/gremlin-server-rest-modern.yaml
 [INFO] GremlinServer -
          \,,,/
          (o o)


[24/50] [abbrv] tinkerpop git commit: Bump to mockito newer version of mockito 1.10.19 CTR

Posted by sp...@apache.org.
Bump to mockito newer version of mockito 1.10.19 CTR


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

Branch: refs/heads/TINKERPOP-1686
Commit: 4eafc3e05164fd3c681131ae339ebcae61b1c90b
Parents: 22e2d9d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Sun Jul 9 10:20:34 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun Jul 9 10:20:34 2017 -0400

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4eafc3e0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 11e7e1d..c60254a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -673,7 +673,7 @@ limitations under the License.
             <dependency>
                 <groupId>org.mockito</groupId>
                 <artifactId>mockito-core</artifactId>
-                <version>1.9.5</version>
+                <version>1.10.19</version>
                 <exclusions>
                     <exclusion>
                         <groupId>org.hamcrest</groupId>


[31/50] [abbrv] tinkerpop git commit: TINKERPOP-1698 Include traversal index in deserialization

Posted by sp...@apache.org.
TINKERPOP-1698 Include traversal index in deserialization

Seems like it is needed for giraph for some reason.


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

Branch: refs/heads/TINKERPOP-1686
Commit: 0a7f7f6e4d5291743918df13ac6a4958fe4fa961
Parents: 0501d42
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jun 27 07:42:07 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 14:14:02 2017 -0400

----------------------------------------------------------------------
 .../process/traversal/util/DefaultTraversalMetrics.java      | 7 ++++++-
 .../gremlin/process/traversal/step/map/ProfileTest.java      | 8 ++++----
 2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0a7f7f6e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
index 584456a..3c543f6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
@@ -34,6 +34,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * @author Bob Briody (http://bobbriody.com)
@@ -63,7 +64,11 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
     public DefaultTraversalMetrics(final long totalStepDurationNs, final List<MutableMetrics> metricsMap) {
         this.totalStepDuration = totalStepDurationNs;
         this.computedMetrics = new LinkedHashMap<>(this.metrics.size());
-        metricsMap.forEach(metric -> this.computedMetrics.put(metric.getId(), metric.getImmutableClone()));
+        final AtomicInteger counter = new AtomicInteger(0);
+        metricsMap.forEach(metric -> {
+            this.computedMetrics.put(metric.getId(), metric.getImmutableClone());
+            this.indexToLabelMap.put(counter.getAndIncrement(), metric.getId());
+        });
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0a7f7f6e/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ProfileTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ProfileTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ProfileTest.java
index 06afc1f..2dc0e3b 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ProfileTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ProfileTest.java
@@ -153,7 +153,7 @@ public abstract class ProfileTest extends AbstractGremlinProcessTest {
         validate_g_V_out_out_profile_grateful(traversalMetrics);
     }
 
-    private void validate_g_V_out_out_profile_grateful(TraversalMetrics traversalMetrics) {
+    private void validate_g_V_out_out_profile_grateful(final TraversalMetrics traversalMetrics) {
         traversalMetrics.toString(); // ensure no exceptions are thrown
 
         Metrics metrics = traversalMetrics.getMetrics(0);
@@ -206,7 +206,7 @@ public abstract class ProfileTest extends AbstractGremlinProcessTest {
         validate_g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profile(traversalMetrics);
     }
 
-    private void validate_g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profile(TraversalMetrics traversalMetrics) {
+    private void validate_g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profile(final TraversalMetrics traversalMetrics) {
         traversalMetrics.toString(); // ensure no exceptions are thrown
 
         // Grab the second (sideEffect{sleep}) step and check the times.
@@ -253,7 +253,7 @@ public abstract class ProfileTest extends AbstractGremlinProcessTest {
                         !traversal.asAdmin().getStrategies().toList().contains(ComputerVerificationStrategy.instance()));
     }
 
-    private void validate_g_V_repeat_both_modern_profile(TraversalMetrics traversalMetrics, boolean withRepeatUnrollStrategy) {
+    private void validate_g_V_repeat_both_modern_profile(final TraversalMetrics traversalMetrics, boolean withRepeatUnrollStrategy) {
         traversalMetrics.toString(); // ensure no exceptions are thrown
 
         Metrics metrics = traversalMetrics.getMetrics(0);
@@ -286,7 +286,7 @@ public abstract class ProfileTest extends AbstractGremlinProcessTest {
 
     /////////////
 
-    private void validate_g_V_whereXinXcreatedX_count_isX1XX_name_profile(Traversal traversal, TraversalMetrics traversalMetrics) {
+    private void validate_g_V_whereXinXcreatedX_count_isX1XX_name_profile(final Traversal traversal, TraversalMetrics traversalMetrics) {
         traversalMetrics.toString(); // ensure no exceptions are thrown
 
         assertEquals("There should be 3 top-level metrics.", 3, traversalMetrics.getMetrics().size());


[43/50] [abbrv] tinkerpop git commit: TINKERPOP-1686 Minor tweaks to finalize MutableMetrics

Posted by sp...@apache.org.
TINKERPOP-1686 Minor tweaks to finalize MutableMetrics

MutableMetrics attached to DefaultTraversalMetrics should not keep getting stuff written to them after the DefaultTraversalMetrics have been finalized.


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

Branch: refs/heads/TINKERPOP-1686
Commit: f5ffa0d8237668613dade85c19b51bf285e6d72e
Parents: a8ce816
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jun 7 13:42:56 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 11 08:00:57 2017 -0400

----------------------------------------------------------------------
 .../traversal/util/DefaultTraversalMetrics.java |  7 +++-
 .../process/traversal/util/MutableMetrics.java  | 41 ++++++++++++++++----
 2 files changed, 38 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f5ffa0d8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
index df24932..291c7ea 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
@@ -103,6 +103,9 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
         return this.computedMetrics.values();
     }
 
+    /**
+     * The metrics have been computed and can no longer be modified.
+     */
     public boolean isFinalized() {
         return finalized;
     }
@@ -131,7 +134,7 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
      * metrics such that their values can no longer be modified.
      */
     public synchronized void setMetrics(final Traversal.Admin traversal, final boolean onGraphComputer) {
-        if (finalized) throw new IllegalStateException("Metrics have been finalized");
+        if (finalized) throw new IllegalStateException("Metrics have been finalized and cannot be modified");
         finalized = true;
         addTopLevelMetrics(traversal, onGraphComputer);
         handleNestedTraversals(traversal, null, onGraphComputer);
@@ -280,7 +283,7 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
             if (null != metrics) { // this happens when a particular branch never received a .next() call (the metrics were never initialized)
                 if (!onGraphComputer) {
                     // subtract upstream duration.
-                    long durBeforeAdjustment = metrics.getDuration(TimeUnit.NANOSECONDS);
+                    final long durBeforeAdjustment = metrics.getDuration(TimeUnit.NANOSECONDS);
                     // adjust duration
                     metrics.setDuration(metrics.getDuration(TimeUnit.NANOSECONDS) - prevDur, TimeUnit.NANOSECONDS);
                     prevDur = durBeforeAdjustment;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f5ffa0d8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/MutableMetrics.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/MutableMetrics.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/MutableMetrics.java
index 47decf1..34fa370 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/MutableMetrics.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/MutableMetrics.java
@@ -18,6 +18,8 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.util;
 
+import org.apache.tinkerpop.gremlin.process.traversal.step.Profiling;
+
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
@@ -33,6 +35,11 @@ public class MutableMetrics extends ImmutableMetrics implements Cloneable {
 
     private long tempTime = -1L;
 
+    /**
+     * Determines if metrics have been finalized, meaning that no more may be collected.
+     */
+    private volatile boolean finalized = false;
+
     protected MutableMetrics() {
         // necessary for gryo serialization
     }
@@ -55,10 +62,12 @@ public class MutableMetrics extends ImmutableMetrics implements Cloneable {
     }
 
     public void addNested(final MutableMetrics metrics) {
+        if (finalized) throw new IllegalStateException("Metrics have been finalized and cannot be modified");
         this.nested.put(metrics.getId(), metrics);
     }
 
     public void start() {
+        if (finalized) throw new IllegalStateException("Metrics have been finalized and cannot be modified");
         if (-1 != this.tempTime) {
             throw new IllegalStateException("Internal Error: Concurrent Metrics start. Stop timer before starting timer.");
         }
@@ -66,6 +75,7 @@ public class MutableMetrics extends ImmutableMetrics implements Cloneable {
     }
 
     public void stop() {
+        if (finalized) throw new IllegalStateException("Metrics have been finalized and cannot be modified");
         if (-1 == this.tempTime)
             throw new IllegalStateException("Internal Error: Metrics has not been started. Start timer before stopping timer");
         this.durationNs = this.durationNs + (System.nanoTime() - this.tempTime);
@@ -73,6 +83,7 @@ public class MutableMetrics extends ImmutableMetrics implements Cloneable {
     }
 
     public void incrementCount(final String key, final long incr) {
+        if (finalized) throw new IllegalStateException("Metrics have been finalized and cannot be modified");
         AtomicLong count = this.counts.get(key);
         if (count == null) {
             count = new AtomicLong();
@@ -82,14 +93,17 @@ public class MutableMetrics extends ImmutableMetrics implements Cloneable {
     }
 
     public void setDuration(final long dur, final TimeUnit unit) {
+        if (finalized) throw new IllegalStateException("Metrics have been finalized and cannot be modified");
         this.durationNs = TimeUnit.NANOSECONDS.convert(dur, unit);
     }
 
     public void setCount(final String key, final long val) {
+        if (finalized) throw new IllegalStateException("Metrics have been finalized and cannot be modified");
         this.counts.put(key, new AtomicLong(val));
     }
 
     public void aggregate(final MutableMetrics other) {
+        if (finalized) throw new IllegalStateException("Metrics have been finalized and cannot be modified");
         this.durationNs += other.durationNs;
         for (Map.Entry<String, AtomicLong> otherCount : other.counts.entrySet()) {
             AtomicLong thisCount = this.counts.get(otherCount.getKey());
@@ -114,12 +128,11 @@ public class MutableMetrics extends ImmutableMetrics implements Cloneable {
                     }
                 } else {
                     // Numbers are summed
-                    Number existingNum = (Number) existingVal;
-                    Number otherNum = (Number) p.getValue();
+                    final Number existingNum = (Number) existingVal;
+                    final Number otherNum = (Number) p.getValue();
                     Number newVal;
                     if (existingNum instanceof Double || existingNum instanceof Float) {
-                        newVal =
-                                existingNum.doubleValue() + otherNum.doubleValue();
+                        newVal = existingNum.doubleValue() + otherNum.doubleValue();
                     } else {
                         newVal = existingNum.longValue() + otherNum.longValue();
                     }
@@ -145,11 +158,9 @@ public class MutableMetrics extends ImmutableMetrics implements Cloneable {
     /**
      * Set an annotation value. Support exists for Strings and Numbers only. During a merge, Strings are concatenated
      * into a "," (comma) separated list of distinct values (duplicates are ignored), and Numbers are summed.
-     *
-     * @param key
-     * @param value
      */
     public void setAnnotation(final String key, final Object value) {
+        if (finalized) throw new IllegalStateException("Metrics have been finalized and cannot be modified");
         if (!(value instanceof String) && !(value instanceof Number)) {
             throw new IllegalArgumentException("Metrics annotations only support String and Number values.");
         }
@@ -161,7 +172,21 @@ public class MutableMetrics extends ImmutableMetrics implements Cloneable {
         return (MutableMetrics) nested.get(metricsId);
     }
 
-    public ImmutableMetrics getImmutableClone() {
+    /**
+     * Once these metrics are used in computing the final metrics to report through {@link TraversalMetrics} they
+     * should no longer be modified and are thus finalized.
+     */
+    public boolean isFinalized() {
+        return finalized;
+    }
+
+    /**
+     * Gets a copy of the metrics that is immutable. Once this clone is made, the {@link MutableMetrics} can no
+     * longer be modified themselves. This prevents custom steps that implement {@link Profiling} from adding to
+     * the metrics after the traversal is complete.
+     */
+    public synchronized ImmutableMetrics getImmutableClone() {
+        finalized = true;
         final ImmutableMetrics clone = new ImmutableMetrics();
         copyMembers(clone);
         this.nested.values().forEach(nested -> clone.nested.put(nested.id, ((MutableMetrics) nested).getImmutableClone()));


[07/50] [abbrv] tinkerpop git commit: Merge branch 'tp31' into tp32

Posted by sp...@apache.org.
Merge branch 'tp31' into tp32


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

Branch: refs/heads/TINKERPOP-1686
Commit: e12cc7c80a2f816ab49f966e4895a79c0f27e59f
Parents: faa7611 28ab372
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jul 5 08:10:41 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Jul 5 08:10:41 2017 -0400

----------------------------------------------------------------------
 docs/src/tutorials/getting-started/index.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e12cc7c8/docs/src/tutorials/getting-started/index.asciidoc
----------------------------------------------------------------------


[02/50] [abbrv] tinkerpop git commit: Merge branch 'tp31' into tp32

Posted by sp...@apache.org.
Merge branch 'tp31' into tp32


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

Branch: refs/heads/TINKERPOP-1686
Commit: beb9a84c58ce1d07dd95cfd57fe27f8b95b80cc4
Parents: c8cc0e5 8460854
Author: Robert Dale <ro...@gmail.com>
Authored: Tue Jul 4 08:45:35 2017 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Tue Jul 4 08:45:35 2017 -0400

----------------------------------------------------------------------
 docs/src/reference/gremlin-applications.asciidoc             | 8 ++++----
 docs/src/reference/intro.asciidoc                            | 2 +-
 .../groovy/plugin/UtilitiesGremlinPluginScript.groovy        | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/beb9a84c/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --cc docs/src/reference/gremlin-applications.asciidoc
index 0d93194,af9ae48..a936d3a
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@@ -102,9 -102,9 +102,9 @@@ more information on the `:plugin use` c
  These plugins can only be deactivated.
  
  The Gremlin Console is loaded and ready for commands. Recall that the console hosts the Gremlin-Groovy language.
- Please review link:http://groovy.codehaus.org/[Groovy] for help on Groovy-related constructs. In short, Groovy is a
+ Please review link:http://www.groovy-lang.org/[Groovy] for help on Groovy-related constructs. In short, Groovy is a
  superset of Java. What works in Java, works in Groovy. However, Groovy provides many shorthands to make it easier
 -to interact with the Java API.  Moreoever, Gremlin provides many neat shorthands to make it easier to express paths
 +to interact with the Java API.  Moreover, Gremlin provides many neat shorthands to make it easier to express paths
  through a property graph.
  
  [gremlin-groovy]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/beb9a84c/docs/src/reference/intro.asciidoc
----------------------------------------------------------------------


[18/50] [abbrv] tinkerpop git commit: Added some missing deprecation entries to upgrade docs in 3.3.0 CTR

Posted by sp...@apache.org.
Added some missing deprecation entries to upgrade docs in 3.3.0 CTR


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

Branch: refs/heads/TINKERPOP-1686
Commit: 0d532aa91e0c9bc775c36d9572f5f816d323abb6
Parents: bcd186c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jul 5 16:00:58 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Jul 5 16:00:58 2017 -0400

----------------------------------------------------------------------
 docs/src/upgrade/release-3.3.x.asciidoc | 33 +++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0d532aa9/docs/src/upgrade/release-3.3.x.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.3.x.asciidoc b/docs/src/upgrade/release-3.3.x.asciidoc
index a200063..d729da8 100644
--- a/docs/src/upgrade/release-3.3.x.asciidoc
+++ b/docs/src/upgrade/release-3.3.x.asciidoc
@@ -218,10 +218,13 @@ The following deprecated classes, methods or fields have been removed in this ve
 ** `org.apache.tinkerpop.gremlin.structure.Graph.OptIn#SUITE_GROOVY_ENVIRONMENT`
 ** `org.apache.tinkerpop.gremlin.structure.Graph.OptIn#SUITE_GROOVY_ENVIRONMENT_INTEGRATE`
 ** `org.apache.tinkerpop.gremlin.structure.io.Io.Builder#registry(IoRegistry)`
+** `org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper.Builder#embedTypes(boolean)`
 ** `org.apache.tinkerpop.gremlin.structure.Transaction.submit(Function)`
 * `gremlin-driver`
 ** `org.apache.tinkerpop.gremlin.driver.Cluster$Builder#reconnectIntialDelay(int)`
 ** `org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0(GryoMapper)`
+** `org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV2d0#TOKEN_USE_MAPPER_FROM_GRAPH`
+** `org.apache.tinkerpop.gremlin.driver.ser.AbstractGryoSONMessageSerializerV2d0#TOKEN_USE_MAPPER_FROM_GRAPH`
 * `gremlin-groovy`
 ** `org.apache.tinkerpop.gremlin.groovy.AbstractImportCustomizerProvider`
 ** `org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider`
@@ -252,6 +255,7 @@ The following deprecated classes, methods or fields have been removed in this ve
 ** `org.apache.tinkerpop.gremlin.groovy.util.DependencyGrabber#deleteDependenciesFromPath(org.apache.tinkerpop.gremlin.groovy.plugin.Artifact)`
 ** `org.apache.tinkerpop.gremlin.groovy.util.DependencyGrabber#copyDependenciesToPath(org.apache.tinkerpop.gremlin.groovy.plugin.Artifact)`
 * `gremlin-server`
+** `org.apache.tinkerpop.gremlin.server.GremlinServer(ServerGremlinExecutor)`
 ** `org.apache.tinkerpop.gremlin.server.Settings#plugins`
 ** `org.apache.tinkerpop.gremlin.server.auth.AllowAllAuthenticator.newSaslNegotiator()`
 ** `org.apache.tinkerpop.gremlin.server.auth.Authenticator.newSaslNegotiator()`
@@ -278,12 +282,29 @@ The following deprecated classes, methods or fields have been removed in this ve
 Please see the javadoc deprecation notes or upgrade documentation specific to when the deprecation took place to
 understand how to resolve this breaking change.
 
-See: link:https://issues.apache.org/jira/browse/TINKERPOP-833[TINKERPOP-833], link:https://issues.apache.org/jira/browse/TINKERPOP-1010[TINKERPOP-1010],
-link:https://issues.apache.org/jira/browse/TINKERPOP-1040[TINKERPOP-1040], link:https://issues.apache.org/jira/browse/TINKERPOP-1046[TINKERPOP-1046],
-link:https://issues.apache.org/jira/browse/TINKERPOP-1049[TINKERPOP-1049], link:https://issues.apache.org/jira/browse/TINKERPOP-1283[TINKERPOP-1283],
-link:https://issues.apache.org/jira/browse/TINKERPOP-1420[TINKERPOP-1420], link:https://issues.apache.org/jira/browse/TINKERPOP-1421[TINKERPOP-1421],
-link:https://issues.apache.org/jira/browse/TINKERPOP-1465[TINKERPOP-1465], link:https://issues.apache.org/jira/browse/TINKERPOP-1526[TINKERPOP-1526],
-link:https://issues.apache.org/jira/browse/TINKERPOP-1612[TINKERPOP-1612], link:https://issues.apache.org/jira/browse/TINKERPOP-1622[TINKERPOP-1622]
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-833[TINKERPOP-833],
+link:https://issues.apache.org/jira/browse/TINKERPOP-999[TINKERPOP-999],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1010[TINKERPOP-1010],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1028[TINKERPOP-1028],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1040[TINKERPOP-1040],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1046[TINKERPOP-1046],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1049[TINKERPOP-1049],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1169[TINKERPOP-1169],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1171[TINKERPOP-1171],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1275[TINKERPOP-1275],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1283[TINKERPOP-1283],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1289[TINKERPOP-1289],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1420[TINKERPOP-1420],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1421[TINKERPOP-1421],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1465[TINKERPOP-1465],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1481[TINKERPOP-1481],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1526[TINKERPOP-1526],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1603[TINKERPOP-1603],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1612[TINKERPOP-1612],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1622[TINKERPOP-1622],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1651[TINKERPOP-1651],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1694[TINKERPOP-1694],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1700[TINKERPOP-1700]
 
 Gremlin-server.sh and Init Scripts
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


[03/50] [abbrv] tinkerpop git commit: Merge branch 'tp32'

Posted by sp...@apache.org.
Merge branch 'tp32'


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

Branch: refs/heads/TINKERPOP-1686
Commit: 50b405b4cb521680a09d19b2f3974d44587be004
Parents: e5022c3 beb9a84
Author: Robert Dale <ro...@gmail.com>
Authored: Tue Jul 4 08:47:00 2017 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Tue Jul 4 08:47:00 2017 -0400

----------------------------------------------------------------------
 docs/src/reference/gremlin-applications.asciidoc                 | 4 ++--
 docs/src/reference/intro.asciidoc                                | 2 +-
 .../console/groovy/plugin/UtilitiesGremlinPluginScript.groovy    | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/50b405b4/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------


[25/50] [abbrv] tinkerpop git commit: added a new test case to test_driver_remote_connection.py that is related to TINKERPOP-1716. CTR.

Posted by sp...@apache.org.
added a new test case to test_driver_remote_connection.py that is related to TINKERPOP-1716. CTR.


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

Branch: refs/heads/TINKERPOP-1686
Commit: 31daf3261de14712163cd5ffcfc8cb0104e4e05e
Parents: 402678b
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Jul 10 07:24:12 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Jul 10 07:24:12 2017 -0600

----------------------------------------------------------------------
 .../main/jython/tests/driver/test_driver_remote_connection.py | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/31daf326/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
index cd64e2b..71cebf0 100644
--- a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
@@ -85,6 +85,13 @@ class TestDriverRemoteConnection(object):
         assert 1 == g.V().label().dedup().count().next()
         assert "person" == g.V().label().dedup().next()
         #
+        g = Graph().traversal().withRemote(remote_connection). \
+            withStrategies(SubgraphStrategy(edges=__.hasLabel("created")))
+        assert 6 == g.V().count().next()
+        assert 4 == g.E().count().next()
+        assert 1 == g.E().label().dedup().count().next()
+        assert "created" == g.E().label().dedup().next()
+        #
         g = g.withoutStrategies(SubgraphStrategy). \
             withComputer(vertices=__.has("name", "marko"), edges=__.limit(0))
         assert 1 == g.V().count().next()


[44/50] [abbrv] tinkerpop git commit: TINKERPOP-1686 WIP toward thread-safety in metrics

Posted by sp...@apache.org.
TINKERPOP-1686 WIP toward thread-safety in metrics

Cleaned up javadocs a bit. Added synchronization around setMetrics().


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

Branch: refs/heads/TINKERPOP-1686
Commit: a8ce816b04ae3543d4799e4272cc22d0e2b3d61a
Parents: 4062898
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jun 7 09:39:07 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 11 08:00:57 2017 -0400

----------------------------------------------------------------------
 .../process/traversal/step/Profiling.java       |   6 +-
 .../step/sideEffect/ProfileSideEffectStep.java  |  14 ++-
 .../traversal/step/util/ProfileStep.java        |   3 +
 .../traversal/util/DefaultTraversalMetrics.java | 112 ++++++++++++-------
 .../traversal/util/TraversalMetrics.java        |   8 +-
 5 files changed, 95 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a8ce816b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Profiling.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Profiling.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Profiling.java
index 3e4ff19..5fa53ee 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Profiling.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Profiling.java
@@ -18,11 +18,13 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.step;
 
+import org.apache.tinkerpop.gremlin.process.traversal.Step;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.ProfileStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics;
 
 /**
- * A Step can implement this interface in order to receive a reference to the MutableMetrics object for the Step. The
- * MutableMetrics is initialized when the ProfileStrategy executes.
+ * A {@link Step} can implement this interface in order to receive a reference to the {@link MutableMetrics} object
+ * for the {@link Step}. The {@link MutableMetrics} is initialized when the {@link ProfileStrategy} executes.
  *
  * @author Bob Briody (http://bobbriody.com)
  */

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a8ce816b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/ProfileSideEffectStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/ProfileSideEffectStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/ProfileSideEffectStep.java
index be60808..5a60d02 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/ProfileSideEffectStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/ProfileSideEffectStep.java
@@ -45,7 +45,7 @@ public final class ProfileSideEffectStep<S> extends SideEffectStep<S> implements
     }
 
     @Override
-    protected void sideEffect(Traverser.Admin<S> traverser) {
+    protected void sideEffect(final Traverser.Admin<S> traverser) {
     }
 
     @Override
@@ -61,7 +61,8 @@ public final class ProfileSideEffectStep<S> extends SideEffectStep<S> implements
             return start;
         } finally {
             if (!this.onGraphComputer && start == null) {
-                ((DefaultTraversalMetrics) this.getTraversal().getSideEffects().get(this.sideEffectKey)).setMetrics(this.getTraversal(), false);
+                final DefaultTraversalMetrics m = getTraversalMetricsFromSideEffects();
+                if (!m.isFinalized()) m.setMetrics(this.getTraversal(), false);
             }
         }
     }
@@ -70,14 +71,19 @@ public final class ProfileSideEffectStep<S> extends SideEffectStep<S> implements
     public boolean hasNext() {
         boolean start = super.hasNext();
         if (!this.onGraphComputer && !start) {
-            ((DefaultTraversalMetrics) this.getTraversal().getSideEffects().get(this.sideEffectKey)).setMetrics(this.getTraversal(), false);
+            final DefaultTraversalMetrics m = getTraversalMetricsFromSideEffects();
+            if (!m.isFinalized()) m.setMetrics(this.getTraversal(), false);
         }
         return start;
     }
 
+    private DefaultTraversalMetrics getTraversalMetricsFromSideEffects() {
+        return (DefaultTraversalMetrics) this.getTraversal().getSideEffects().get(this.sideEffectKey);
+    }
+
     @Override
     public DefaultTraversalMetrics generateFinalResult(final DefaultTraversalMetrics tm) {
-        if (this.onGraphComputer)
+        if (this.onGraphComputer && !tm.isFinalized())
             tm.setMetrics(this.getTraversal(), true);
         return tm;
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a8ce816b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ProfileStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ProfileStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ProfileStep.java
index 9b2276b..0bc5f4f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ProfileStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ProfileStep.java
@@ -90,6 +90,9 @@ public final class ProfileStep<S> extends AbstractStep<S, S> implements MemoryCo
             this.onGraphComputer = TraversalHelper.onGraphComputer(this.getTraversal());
             this.metrics = new MutableMetrics(this.getPreviousStep().getId(), this.getPreviousStep().toString());
             final Step<?, S> previousStep = this.getPreviousStep();
+
+            // give metrics to the step being profiled so that it can add additional data to the metrics like
+            // annotations
             if (previousStep instanceof Profiling)
                 ((Profiling) previousStep).setMetrics(this.metrics);
         }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a8ce816b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
index 3c543f6..df24932 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
@@ -28,7 +28,6 @@ import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -37,6 +36,9 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
 /**
+ * Default implementation for {@link TraversalMetrics} that aggregates {@link ImmutableMetrics} instances from a
+ * {@link Traversal}.
+ *
  * @author Bob Briody (http://bobbriody.com)
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
@@ -49,12 +51,21 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
     private final Map<String, MutableMetrics> metrics = new HashMap<>();
     private final TreeMap<Integer, String> indexToLabelMap = new TreeMap<>();
 
-    /*
-    The following are computed values upon the completion of profiling in order to report the results back to the user
+    /**
+     * A computed value representing the total time spent on all steps.
      */
     private long totalStepDuration;
+
+    /**
+     * The metrics that are reported to the caller of profile() which are computed once all metrics have been gathered.
+     */
     private Map<String, ImmutableMetrics> computedMetrics = new LinkedHashMap<>();
 
+    /**
+     * Determines if final metrics have been computed
+     */
+    private volatile boolean finalized = false;
+
     public DefaultTraversalMetrics() {
     }
 
@@ -92,6 +103,10 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
         return this.computedMetrics.values();
     }
 
+    public boolean isFinalized() {
+        return finalized;
+    }
+
     @Override
     public String toString() {
         // Build a pretty table of metrics data.
@@ -111,6 +126,18 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
         return sb.toString();
     }
 
+    /**
+     * Extracts metrics from the provided {@code traversal} and computes metrics. Calling this method finalizes the
+     * metrics such that their values can no longer be modified.
+     */
+    public synchronized void setMetrics(final Traversal.Admin traversal, final boolean onGraphComputer) {
+        if (finalized) throw new IllegalStateException("Metrics have been finalized");
+        finalized = true;
+        addTopLevelMetrics(traversal, onGraphComputer);
+        handleNestedTraversals(traversal, null, onGraphComputer);
+        computeTotals();
+    }
+
     private void appendMetrics(final Collection<? extends Metrics> metrics, final StringBuilder sb, final int indent) {
         // Append each StepMetric's row. indexToLabelMap values are ordered by index.
         for (Metrics m : metrics) {
@@ -222,41 +249,7 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
         tempMetrics.forEach(it -> this.computedMetrics.put(it.getId(), it.getImmutableClone()));
     }
 
-    public static DefaultTraversalMetrics merge(final Iterator<DefaultTraversalMetrics> toMerge) {
-        final DefaultTraversalMetrics newTraversalMetrics = new DefaultTraversalMetrics();
-
-        // iterate the incoming TraversalMetrics
-        toMerge.forEachRemaining(inTraversalMetrics -> {
-            // aggregate the internal Metrics
-            inTraversalMetrics.metrics.forEach((metricsId, toAggregate) -> {
-
-                MutableMetrics aggregateMetrics = newTraversalMetrics.metrics.get(metricsId);
-                if (null == aggregateMetrics) {
-                    // need to create a Metrics to aggregate into
-                    aggregateMetrics = new MutableMetrics(toAggregate.getId(), toAggregate.getName());
-
-                    newTraversalMetrics.metrics.put(metricsId, aggregateMetrics);
-                    // Set the index of the Metrics
-                    for (final Map.Entry<Integer, String> entry : inTraversalMetrics.indexToLabelMap.entrySet()) {
-                        if (metricsId.equals(entry.getValue())) {
-                            newTraversalMetrics.indexToLabelMap.put(entry.getKey(), metricsId);
-                            break;
-                        }
-                    }
-                }
-                aggregateMetrics.aggregate(toAggregate);
-            });
-        });
-        return newTraversalMetrics;
-    }
-
-    public void setMetrics(final Traversal.Admin traversal, final boolean onGraphComputer) {
-        addTopLevelMetrics(traversal, onGraphComputer);
-        handleNestedTraversals(traversal, null, onGraphComputer);
-        computeTotals();
-    }
-
-    private void addTopLevelMetrics(Traversal.Admin traversal, final boolean onGraphComputer) {
+    private void addTopLevelMetrics(final Traversal.Admin traversal, final boolean onGraphComputer) {
         final List<ProfileStep> profileSteps = TraversalHelper.getStepsOfClass(ProfileStep.class, traversal);
         for (int ii = 0; ii < profileSteps.size(); ii++) {
             // The index is necessary to ensure that step order is preserved after a merge.
@@ -308,4 +301,47 @@ public final class DefaultTraversalMetrics implements TraversalMetrics, Serializ
             }
         }
     }
+
+    private void appendMetrics(final Collection<? extends Metrics> metrics, final StringBuilder sb, final int indent) {
+        // Append each StepMetric's row. indexToLabelMap values are ordered by index.
+        for (Metrics m : metrics) {
+            String rowName = m.getName();
+
+            // Handle indentation
+            for (int ii = 0; ii < indent; ii++) {
+                rowName = "  " + rowName;
+            }
+            // Abbreviate if necessary
+            rowName = StringUtils.abbreviate(rowName, 50);
+
+            // Grab the values
+            final Long itemCount = m.getCount(ELEMENT_COUNT_ID);
+            final Long traverserCount = m.getCount(TRAVERSER_COUNT_ID);
+            Double percentDur = (Double) m.getAnnotation(PERCENT_DURATION_KEY);
+
+            // Build the row string
+
+            sb.append(String.format("%n%-50s", rowName));
+
+            if (itemCount != null) {
+                sb.append(String.format(" %21d", itemCount));
+            } else {
+                sb.append(String.format(" %21s", ""));
+            }
+
+            if (traverserCount != null) {
+                sb.append(String.format(" %11d", traverserCount));
+            } else {
+                sb.append(String.format(" %11s", ""));
+            }
+
+            sb.append(String.format(" %15.3f", m.getDuration(TimeUnit.MICROSECONDS) / 1000.0));
+
+            if (percentDur != null) {
+                sb.append(String.format(" %8.2f", percentDur));
+            }
+
+            appendMetrics(m.getNested(), sb, indent + 1);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a8ce816b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalMetrics.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalMetrics.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalMetrics.java
index 6a54680..0dbb2f6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalMetrics.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalMetrics.java
@@ -46,15 +46,13 @@ public interface TraversalMetrics {
     /**
      * Get the total duration taken by the Traversal.
      *
-     * @param unit
      * @return total duration taken by the Traversal.
      */
-    public long getDuration(TimeUnit unit);
+    public long getDuration(final TimeUnit unit);
 
     /**
      * Get an individual Metrics object by the index of the profiled Step.
      *
-     * @param stepIndex
      * @return an individual Metrics object.
      */
     public Metrics getMetrics(final int stepIndex);
@@ -62,10 +60,12 @@ public interface TraversalMetrics {
     /**
      * Get an individual Metrics object by the id of the profiled Step.
      *
-     * @param id
      * @return an individual Metrics object.
      */
     public Metrics getMetrics(final String id);
 
+    /**
+     * Gets all the metrics.
+     */
     public Collection<? extends Metrics> getMetrics();
 }


[35/50] [abbrv] tinkerpop git commit: TINKERPOP-1698 Hooked up Gryo 3.0 for OLAP stuff.

Posted by sp...@apache.org.
TINKERPOP-1698 Hooked up Gryo 3.0 for OLAP stuff.

Improved configurability for the version. Parameterized tests for 1.0 and 3.0.


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

Branch: refs/heads/TINKERPOP-1686
Commit: 21b35c469de912f05b038d60bd4c2f1b22f4ad44
Parents: 9c04663
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 26 13:23:55 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 14:14:02 2017 -0400

----------------------------------------------------------------------
 .../structure/io/GiraphIoRegistryCheck.java     |  9 +++++++--
 .../gremlin/structure/io/gryo/GryoPool.java     | 13 ++++++++++++-
 .../structure/io/gryo/GryoSerializersV3d0.java  | 12 +++++++++++-
 .../ser/GryoMessageSerializerV1d0Test.java      |  3 ---
 .../hadoop/structure/io/HadoopPools.java        |  2 ++
 .../structure/io/AbstractIoRegistryCheck.java   | 17 ++++++++++++++++-
 .../structure/io/gryo/GryoRegistrator.java      |  2 +-
 .../spark/structure/io/gryo/GryoSerializer.java |  2 ++
 .../SparkSingleIterationStrategyTest.java       | 20 ++++++++++++++++++++
 .../structure/io/SparkIoRegistryCheck.java      |  9 +++++++--
 10 files changed, 78 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/21b35c46/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphIoRegistryCheck.java
----------------------------------------------------------------------
diff --git a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphIoRegistryCheck.java b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphIoRegistryCheck.java
index 51a2712..0a9dc81 100644
--- a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphIoRegistryCheck.java
+++ b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphIoRegistryCheck.java
@@ -48,8 +48,13 @@ public class GiraphIoRegistryCheck extends AbstractIoRegistryCheck {
     }
 
     @Test
-    public void shouldSupportGryoIoRegistry() throws Exception {
-        super.checkGryoIoRegistryCompliance((HadoopGraph) graph, GiraphGraphComputer.class);
+    public void shouldSupportGryoV1d0IoRegistry() throws Exception {
+        super.checkGryoV1d0IoRegistryCompliance((HadoopGraph) graph, GiraphGraphComputer.class);
+    }
+
+    @Test
+    public void shouldSupportGryoV3d0IoRegistry() throws Exception {
+        super.checkGryoV3d0IoRegistryCompliance((HadoopGraph) graph, GiraphGraphComputer.class);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/21b35c46/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java
index 485ac98..0887306 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java
@@ -40,7 +40,9 @@ import java.util.function.Function;
 public final class GryoPool {
 
     public static final String CONFIG_IO_GRYO_POOL_SIZE = "gremlin.io.gryo.poolSize";
+    public static final String CONFIG_IO_GRYO_VERSION = "gremlin.io.gryo.version";
     public static final int CONFIG_IO_GRYO_POOL_SIZE_DEFAULT = 256;
+    public static final GryoVersion CONFIG_IO_GRYO_POOL_VERSION_DEFAULT = GryoVersion.V3_0;
 
     public enum Type {READER, WRITER, READER_WRITER}
 
@@ -145,6 +147,15 @@ public final class GryoPool {
         private List<IoRegistry> ioRegistries = new ArrayList<>();
         private Type type = Type.READER_WRITER;
         private Consumer<GryoMapper.Builder> gryoMapperConsumer = null;
+        private GryoVersion version = GryoVersion.V1_0;
+
+        /**
+         * Set the version of Gryo to use for this pool.
+         */
+        public Builder version(final GryoVersion version) {
+            this.version = version;
+            return this;
+        }
 
         /**
          * The {@code IoRegistry} class names to use for the {@code GryoPool}
@@ -207,7 +218,7 @@ public final class GryoPool {
          * @return the new pool
          */
         public GryoPool create() {
-            final GryoMapper.Builder mapper = GryoMapper.build().version(GryoVersion.V1_0);
+            final GryoMapper.Builder mapper = GryoMapper.build().version(version);
             final GryoPool gryoPool = new GryoPool();
             if (null != this.ioRegistries)
                 this.ioRegistries.forEach(mapper::addRegistry);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/21b35c46/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
index fe53ce5..20e13c4 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
@@ -74,7 +74,17 @@ public final class GryoSerializersV3d0 {
             kryo.writeClassAndObject(output, edge.id());
             output.writeString(edge.label());
             kryo.writeClassAndObject(output, edge.inVertex().id());
-            output.writeString(edge.inVertex().label());
+
+            // temporary try/catch perhaps? need this to get SparkSingleIterationStrategyTest to work. Trying to grab
+            // the label of the adjacent vertex ends in error if there's a StarEdge in the ComputerGraph$ComputerEdge.
+            // maybe this gets fixed up when TINKERPOP-1592 is in play. hopefully this serializer will get better
+            // with that
+            try {
+                output.writeString(edge.inVertex().label());
+            } catch (Exception ex) {
+                output.writeString(Vertex.DEFAULT_LABEL);
+            }
+
             kryo.writeClassAndObject(output, edge.outVertex().id());
             output.writeString(edge.outVertex().label());
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/21b35c46/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java
index 29ca9ea..946fd4d 100644
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GryoMessageSerializerV1d0Test.java
@@ -67,13 +67,10 @@ import java.util.function.Supplier;
 import static org.hamcrest.CoreMatchers.instanceOf;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.IsNot.not;
-import static org.hamcrest.core.StringContains.containsString;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeThat;
 
 /**
  * Serializer tests that cover non-lossy serialization/deserialization methods.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/21b35c46/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/HadoopPools.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/HadoopPools.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/HadoopPools.java
index 43e4f29..ea73431 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/HadoopPools.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/HadoopPools.java
@@ -24,6 +24,7 @@ import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
 import org.apache.tinkerpop.gremlin.hadoop.structure.util.ConfUtil;
 import org.apache.tinkerpop.gremlin.structure.io.IoRegistry;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoPool;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoVersion;
 import org.apache.tinkerpop.gremlin.util.SystemUtil;
 
 import java.util.Collections;
@@ -44,6 +45,7 @@ public final class HadoopPools {
             INITIALIZED = true;
             GRYO_POOL = GryoPool.build().
                     poolSize(configuration.getInt(GryoPool.CONFIG_IO_GRYO_POOL_SIZE, 256)).
+                    version(GryoVersion.valueOf(configuration.getString(GryoPool.CONFIG_IO_GRYO_VERSION, GryoPool.CONFIG_IO_GRYO_POOL_VERSION_DEFAULT.name()))).
                     ioRegistries(configuration.getList(IoRegistry.IO_REGISTRY, Collections.emptyList())).
                     initializeMapper(m -> m.registrationRequired(false)).
                     create();

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/21b35c46/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractIoRegistryCheck.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractIoRegistryCheck.java b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractIoRegistryCheck.java
index 06ff5bf..8b89fc1 100644
--- a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractIoRegistryCheck.java
+++ b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractIoRegistryCheck.java
@@ -42,6 +42,8 @@ import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.io.IoRegistry;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoPool;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoVersion;
 import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
 
 import java.io.DataOutputStream;
@@ -61,10 +63,11 @@ public abstract class AbstractIoRegistryCheck extends AbstractGremlinTest {
 
     private static final int NUMBER_OF_VERTICES = 1000;
 
-    public void checkGryoIoRegistryCompliance(final HadoopGraph graph, final Class<? extends GraphComputer> graphComputerClass) throws Exception {
+    public void checkGryoV1d0IoRegistryCompliance(final HadoopGraph graph, final Class<? extends GraphComputer> graphComputerClass) throws Exception {
         final File input = TestHelper.generateTempFile(this.getClass(), "gryo-io-registry", ".kryo");
         graph.configuration().setProperty(Constants.GREMLIN_HADOOP_GRAPH_READER, GryoInputFormat.class.getCanonicalName());
         graph.configuration().setProperty(Constants.GREMLIN_HADOOP_GRAPH_WRITER, GryoOutputFormat.class.getCanonicalName());
+        graph.configuration().setProperty(GryoPool.CONFIG_IO_GRYO_VERSION, GryoVersion.V1_0.name());
         graph.configuration().setProperty(Constants.GREMLIN_HADOOP_INPUT_LOCATION, input.getAbsolutePath());
         graph.configuration().setProperty(IoRegistry.IO_REGISTRY, ToyIoRegistry.class.getCanonicalName());
         final GryoRecordWriter writer = new GryoRecordWriter(new DataOutputStream(new FileOutputStream(input)), ConfUtil.makeHadoopConfiguration(graph.configuration()));
@@ -72,6 +75,18 @@ public abstract class AbstractIoRegistryCheck extends AbstractGremlinTest {
         assertTrue(input.delete());
     }
 
+    public void checkGryoV3d0IoRegistryCompliance(final HadoopGraph graph, final Class<? extends GraphComputer> graphComputerClass) throws Exception {
+        final File input = TestHelper.generateTempFile(this.getClass(), "gryo-io-registry", ".kryo");
+        graph.configuration().setProperty(Constants.GREMLIN_HADOOP_GRAPH_READER, GryoInputFormat.class.getCanonicalName());
+        graph.configuration().setProperty(Constants.GREMLIN_HADOOP_GRAPH_WRITER, GryoOutputFormat.class.getCanonicalName());
+        graph.configuration().setProperty(Constants.GREMLIN_HADOOP_INPUT_LOCATION, input.getAbsolutePath());
+        graph.configuration().setProperty(GryoPool.CONFIG_IO_GRYO_VERSION, GryoVersion.V3_0.name());
+        graph.configuration().setProperty(IoRegistry.IO_REGISTRY, ToyIoRegistry.class.getCanonicalName());
+        final GryoRecordWriter writer = new GryoRecordWriter(new DataOutputStream(new FileOutputStream(input)), ConfUtil.makeHadoopConfiguration(graph.configuration()));
+        validateIoRegistryGraph(graph, graphComputerClass, writer);
+        assertTrue(input.delete());
+    }
+
     public void checkGraphSONIoRegistryCompliance(final HadoopGraph graph, final Class<? extends GraphComputer> graphComputerClass) throws Exception {
         final File input = TestHelper.generateTempFile(this.getClass(), "graphson-io-registry", ".json");
         graph.configuration().setProperty(Constants.GREMLIN_HADOOP_GRAPH_READER, GraphSONInputFormat.class.getCanonicalName());

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/21b35c46/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java
index 501e1ef..5fd76ea 100644
--- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java
+++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoRegistrator.java
@@ -68,7 +68,7 @@ public class GryoRegistrator implements KryoRegistrator {
     private static final Logger log = LoggerFactory.getLogger(GryoRegistrator.class);
 
     @Override
-    public void registerClasses(Kryo kryo) {
+    public void registerClasses(final Kryo kryo) {
         registerClasses(kryo, Collections.emptyMap(), Collections.emptySet());
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/21b35c46/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoSerializer.java
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoSerializer.java b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoSerializer.java
index c1e52ea..677db12 100644
--- a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoSerializer.java
+++ b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoSerializer.java
@@ -45,6 +45,7 @@ import org.apache.tinkerpop.gremlin.structure.io.AbstractIoRegistry;
 import org.apache.tinkerpop.gremlin.structure.io.IoRegistry;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoPool;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoVersion;
 import org.apache.tinkerpop.shaded.kryo.io.Output;
 import org.apache.tinkerpop.shaded.kryo.serializers.ExternalizableSerializer;
 import org.apache.tinkerpop.shaded.kryo.serializers.JavaSerializer;
@@ -90,6 +91,7 @@ public final class GryoSerializer extends Serializer implements Serializable {
         ioRegistries.addAll(makeApacheConfiguration(sparkConfiguration).getList(IoRegistry.IO_REGISTRY, Collections.emptyList()));
         ioRegistries.add(SparkIoRegistry.class.getCanonicalName().replace("." + SparkIoRegistry.class.getSimpleName(), "$" + SparkIoRegistry.class.getSimpleName()));
         HadoopPools.initialize(GryoPool.build().
+                version(GryoVersion.valueOf(sparkConfiguration.get(GryoPool.CONFIG_IO_GRYO_VERSION, GryoPool.CONFIG_IO_GRYO_POOL_VERSION_DEFAULT.name()))).
                 poolSize(sparkConfiguration.getInt(GryoPool.CONFIG_IO_GRYO_POOL_SIZE, GryoPool.CONFIG_IO_GRYO_POOL_SIZE_DEFAULT)).
                 ioRegistries(ioRegistries).
                 initializeMapper(builder ->

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/21b35c46/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/SparkSingleIterationStrategyTest.java
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/SparkSingleIterationStrategyTest.java b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/SparkSingleIterationStrategyTest.java
index 8f97576..5e73608 100644
--- a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/SparkSingleIterationStrategyTest.java
+++ b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/traversal/strategy/optimization/SparkSingleIterationStrategyTest.java
@@ -36,12 +36,18 @@ import org.apache.tinkerpop.gremlin.spark.structure.io.PersistedOutputRDD;
 import org.apache.tinkerpop.gremlin.structure.Column;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.T;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoPool;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoVersion;
 import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
 
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
+import java.util.function.Supplier;
 
 import static org.apache.tinkerpop.gremlin.structure.Column.keys;
 import static org.junit.Assert.assertEquals;
@@ -51,7 +57,20 @@ import static org.junit.Assert.assertTrue;
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
+@RunWith(Parameterized.class)
 public class SparkSingleIterationStrategyTest extends AbstractSparkTest {
+    @Parameterized.Parameters(name = "expect({0})")
+    public static Iterable<Object[]> data() {
+        return Arrays.asList(new Object[][]{
+                {"V1d0", GryoVersion.V1_0},
+                {"V3d0", GryoVersion.V3_0}});
+    }
+
+    @Parameterized.Parameter(value = 0)
+    public String name;
+
+    @Parameterized.Parameter(value = 1)
+    public GryoVersion version;
 
     @Test
     public void shouldSuccessfullyEvaluateSingleIterationTraversals() throws Exception {
@@ -63,6 +82,7 @@ public class SparkSingleIterationStrategyTest extends AbstractSparkTest {
         configuration.setProperty(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, outputLocation);
         configuration.setProperty(Constants.GREMLIN_HADOOP_DEFAULT_GRAPH_COMPUTER, SparkGraphComputer.class.getCanonicalName());
         configuration.setProperty(Constants.GREMLIN_SPARK_PERSIST_CONTEXT, true);
+        configuration.setProperty(GryoPool.CONFIG_IO_GRYO_VERSION, version.name());
 
         /////////// WITHOUT SINGLE-ITERATION STRATEGY LESS SINGLE-PASS OPTIONS ARE AVAILABLE
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/21b35c46/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/SparkIoRegistryCheck.java
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/SparkIoRegistryCheck.java b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/SparkIoRegistryCheck.java
index 948bbbe..11fac14 100644
--- a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/SparkIoRegistryCheck.java
+++ b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/SparkIoRegistryCheck.java
@@ -53,8 +53,13 @@ public class SparkIoRegistryCheck extends AbstractIoRegistryCheck {
     }
 
     @Test
-    public void shouldSupportGryoIoRegistry() throws Exception {
-        super.checkGryoIoRegistryCompliance((HadoopGraph) graph, SparkGraphComputer.class);
+    public void shouldSupportGryoV1d0IoRegistry() throws Exception {
+        super.checkGryoV1d0IoRegistryCompliance((HadoopGraph) graph, SparkGraphComputer.class);
+    }
+
+    @Test
+    public void shouldSupportGryoV3d0IoRegistry() throws Exception {
+        super.checkGryoV3d0IoRegistryCompliance((HadoopGraph) graph, SparkGraphComputer.class);
     }
 
     @Test


[37/50] [abbrv] tinkerpop git commit: TINKERPOP-1698 Added Gryo v3 to all configs

Posted by sp...@apache.org.
TINKERPOP-1698 Added Gryo v3 to all configs

Removed v1 where necessary - don't really want to promote that version anymore.


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

Branch: refs/heads/TINKERPOP-1686
Commit: fdc15dff8a3d4e53acc65b57d42b56027acea972
Parents: 155e50d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jun 29 10:18:38 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 14:14:03 2017 -0400

----------------------------------------------------------------------
 .../src/test/resources/gremlin-server.yaml      |  5 +--
 gremlin-console/conf/remote-objects.yaml        |  4 +-
 gremlin-console/conf/remote-secure.yaml         |  2 +-
 gremlin-console/conf/remote.yaml                |  2 +-
 .../console/jsr223/DriverGremlinPlugin.java     |  2 +
 .../jsr223/gremlin-server-integration.yaml      |  4 +-
 .../gremlin/console/jsr223/remote.yaml          |  2 +-
 .../driver/gremlin-server-modern-secure-py.yaml |  3 --
 gremlin-server/conf/gremlin-server-classic.yaml |  5 +--
 .../conf/gremlin-server-modern-py.yaml          |  5 +--
 .../conf/gremlin-server-modern-readonly.yaml    |  5 +--
 gremlin-server/conf/gremlin-server-modern.yaml  |  5 +--
 gremlin-server/conf/gremlin-server-neo4j.yaml   |  5 +--
 gremlin-server/conf/gremlin-server-secure.yaml  |  5 +--
 gremlin-server/conf/gremlin-server-spark.yaml   |  5 +--
 gremlin-server/conf/gremlin-server.yaml         | 10 ++---
 .../gremlin/server/AbstractChannelizer.java     |  6 +--
 .../server/GremlinDriverIntegrateTest.java      | 40 ++++++++++++++++++--
 .../GremlinServerAuthKrb5IntegrateTest.java     | 21 +++++++++-
 .../remote/gremlin-server-integration.yaml      |  2 +-
 .../server/gremlin-server-integration.yaml      |  1 +
 21 files changed, 90 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
index c0e4e3c..f5613ef 100644
--- a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
@@ -29,9 +29,8 @@ scriptEngines: {
                org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern.groovy]}}}}
 serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}       # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0], custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}}
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}   # application/vnd.gremlin-v1.0+gryo-stringd
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0]}}
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}                                                                                                                                                                # application/vnd.gremlin-v1.0+gryo-stringd
 metrics: {
   slf4jReporter: {enabled: true, interval: 180000}}
 strictTransactionManagement: false

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-console/conf/remote-objects.yaml
----------------------------------------------------------------------
diff --git a/gremlin-console/conf/remote-objects.yaml b/gremlin-console/conf/remote-objects.yaml
index 8c9f944..ba9bd69 100644
--- a/gremlin-console/conf/remote-objects.yaml
+++ b/gremlin-console/conf/remote-objects.yaml
@@ -32,5 +32,5 @@
 
 hosts: [localhost]
 port: 8182
-serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0,
-              config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}
\ No newline at end of file
+serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0,
+              config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-console/conf/remote-secure.yaml
----------------------------------------------------------------------
diff --git a/gremlin-console/conf/remote-secure.yaml b/gremlin-console/conf/remote-secure.yaml
index 4f8d22b..592adcc 100644
--- a/gremlin-console/conf/remote-secure.yaml
+++ b/gremlin-console/conf/remote-secure.yaml
@@ -30,4 +30,4 @@ username: stephen
 password: password
 connectionPool: {
   enableSsl: true}
-serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
\ No newline at end of file
+serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-console/conf/remote.yaml
----------------------------------------------------------------------
diff --git a/gremlin-console/conf/remote.yaml b/gremlin-console/conf/remote.yaml
index c181591..76da387 100644
--- a/gremlin-console/conf/remote.yaml
+++ b/gremlin-console/conf/remote.yaml
@@ -29,4 +29,4 @@
 
 hosts: [localhost]
 port: 8182
-serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
\ No newline at end of file
+serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/jsr223/DriverGremlinPlugin.java
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/jsr223/DriverGremlinPlugin.java b/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/jsr223/DriverGremlinPlugin.java
index a47700d..d6e67a6 100644
--- a/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/jsr223/DriverGremlinPlugin.java
+++ b/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/jsr223/DriverGremlinPlugin.java
@@ -42,6 +42,7 @@ import org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0;
 import org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0;
 import org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0;
 import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
+import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0;
 import org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer;
 import org.apache.tinkerpop.gremlin.driver.ser.MessageTextSerializer;
 import org.apache.tinkerpop.gremlin.driver.ser.SerTokens;
@@ -83,6 +84,7 @@ public class DriverGremlinPlugin extends AbstractGremlinPlugin {
                     GraphSONMessageSerializerV2d0.class,
                     GryoLiteMessageSerializerV1d0.class,
                     GryoMessageSerializerV1d0.class,
+                    GryoMessageSerializerV3d0.class,
                     JsonBuilderGryoSerializer.class,
                     MessageTextSerializer.class,
                     SerializationException.class,

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/jsr223/gremlin-server-integration.yaml
----------------------------------------------------------------------
diff --git a/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/jsr223/gremlin-server-integration.yaml b/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/jsr223/gremlin-server-integration.yaml
index 0f6a331..8ba9372 100644
--- a/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/jsr223/gremlin-server-integration.yaml
+++ b/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/jsr223/gremlin-server-integration.yaml
@@ -25,9 +25,7 @@ scriptEngines: {
                org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
                org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}}}}
 serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { }}             # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { }}         # application/vnd.gremlin-v1.0+gryo-lite
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}         # application/vnd.gremlin-v1.0+gryo-stringd
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}         # application/vnd.gremlin-v3.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0]  }} # application/vnd.gremlin-v2.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { }}         # application/json,application/vnd.gremlin-v3.0+json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/jsr223/remote.yaml
----------------------------------------------------------------------
diff --git a/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/jsr223/remote.yaml b/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/jsr223/remote.yaml
index 373934b..9bb27c7 100644
--- a/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/jsr223/remote.yaml
+++ b/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/jsr223/remote.yaml
@@ -17,4 +17,4 @@
 
 hosts: [localhost]
 port: 45940
-serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
\ No newline at end of file
+serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml
----------------------------------------------------------------------
diff --git a/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml b/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml
index 4241ca6..8b87aa9 100644
--- a/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml
+++ b/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml
@@ -40,9 +40,6 @@ scriptEngines: {
   gremlin-python: {}
 }
 serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-server/conf/gremlin-server-classic.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-classic.yaml b/gremlin-server/conf/gremlin-server-classic.yaml
index 7413c4f..f2ffe7c 100644
--- a/gremlin-server/conf/gremlin-server-classic.yaml
+++ b/gremlin-server/conf/gremlin-server-classic.yaml
@@ -27,9 +27,8 @@ scriptEngines: {
                org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-classic.groovy]}}}}
 serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}            # application/vnd.gremlin-v3.0+gryo
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}                                                                      # application/vnd.gremlin-v3.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-server/conf/gremlin-server-modern-py.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-modern-py.yaml b/gremlin-server/conf/gremlin-server-modern-py.yaml
index 430cc39..d095f8c 100644
--- a/gremlin-server/conf/gremlin-server-modern-py.yaml
+++ b/gremlin-server/conf/gremlin-server-modern-py.yaml
@@ -42,9 +42,8 @@ scriptEngines: {
   gremlin-python: {}
 }
 serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}            # application/vnd.gremlin-v3.0+gryo
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}                                                                      # application/vnd.gremlin-v3.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-server/conf/gremlin-server-modern-readonly.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-modern-readonly.yaml b/gremlin-server/conf/gremlin-server-modern-readonly.yaml
index 030cd7c..1c29908 100644
--- a/gremlin-server/conf/gremlin-server-modern-readonly.yaml
+++ b/gremlin-server/conf/gremlin-server-modern-readonly.yaml
@@ -27,9 +27,8 @@ scriptEngines: {
                org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern-readonly.groovy]}}}}
 serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}            # application/vnd.gremlin-v3.0+gryo
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}                                                                      # application/vnd.gremlin-v3.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-server/conf/gremlin-server-modern.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-modern.yaml b/gremlin-server/conf/gremlin-server-modern.yaml
index 50de824..90ec123 100644
--- a/gremlin-server/conf/gremlin-server-modern.yaml
+++ b/gremlin-server/conf/gremlin-server-modern.yaml
@@ -27,9 +27,8 @@ scriptEngines: {
                org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern.groovy]}}}}
 serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}            # application/vnd.gremlin-v3.0+gryo
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}                                                                      # application/vnd.gremlin-v3.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-server/conf/gremlin-server-neo4j.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-neo4j.yaml b/gremlin-server/conf/gremlin-server-neo4j.yaml
index 1a9cff9..5a5fa16 100644
--- a/gremlin-server/conf/gremlin-server-neo4j.yaml
+++ b/gremlin-server/conf/gremlin-server-neo4j.yaml
@@ -38,9 +38,8 @@ scriptEngines: {
                org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy]}}}}
 serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}            # application/vnd.gremlin-v3.0+gryo
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}                                                                      # application/vnd.gremlin-v3.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-server/conf/gremlin-server-secure.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-secure.yaml b/gremlin-server/conf/gremlin-server-secure.yaml
index f91b0fe..36d2292 100644
--- a/gremlin-server/conf/gremlin-server-secure.yaml
+++ b/gremlin-server/conf/gremlin-server-secure.yaml
@@ -37,9 +37,8 @@ scriptEngines: {
                org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample-secure.groovy]}}}}
 serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}            # application/vnd.gremlin-v3.0+gryo
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}                                                                      # application/vnd.gremlin-v3.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-server/conf/gremlin-server-spark.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-spark.yaml b/gremlin-server/conf/gremlin-server-spark.yaml
index c1b6862..4ad719e 100644
--- a/gremlin-server/conf/gremlin-server-spark.yaml
+++ b/gremlin-server/conf/gremlin-server-spark.yaml
@@ -51,9 +51,8 @@ scriptEngines: {
                org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/spark.groovy]}}}}
 serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}            # application/vnd.gremlin-v3.0+gryo
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}                                                                      # application/vnd.gremlin-v3.0+gryo-stringd
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/json

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-server/conf/gremlin-server.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server.yaml b/gremlin-server/conf/gremlin-server.yaml
index 7961217..05e0eb6 100644
--- a/gremlin-server/conf/gremlin-server.yaml
+++ b/gremlin-server/conf/gremlin-server.yaml
@@ -28,13 +28,11 @@ scriptEngines: {
                org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy]}}}}
 serializers:
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}            # application/vnd.gremlin-v1.0+gryo
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}             # application/vnd.gremlin-v3.0+gryo
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/vnd.gremlin-v1.0+gryo-lite
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}        # application/json
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}                                                                       # application/vnd.gremlin-v3.0+gryo-stringd
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}  # application/vnd.gremlin-v1.0+json
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }}  # application/vnd.gremlin-v2.0+json
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}         # application/json
 processors:
   - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }}
   - { className: org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor, config: { cacheExpirationTime: 600000, cacheMaxSize: 1000 }}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
index abc337d..cb088be 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
@@ -25,7 +25,7 @@ import io.netty.handler.ssl.util.SelfSignedCertificate;
 import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
 import org.apache.tinkerpop.gremlin.driver.ser.AbstractGryoMessageSerializerV1d0;
 import org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0;
-import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
+import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0;
 import org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor;
 import org.apache.tinkerpop.gremlin.server.auth.Authenticator;
 import org.apache.tinkerpop.gremlin.server.handler.AbstractAuthenticationHandler;
@@ -67,8 +67,8 @@ import java.util.stream.Stream;
 public abstract class AbstractChannelizer extends ChannelInitializer<SocketChannel> implements Channelizer {
     private static final Logger logger = LoggerFactory.getLogger(AbstractChannelizer.class);
     protected static final List<Settings.SerializerSettings> DEFAULT_SERIALIZERS = Arrays.asList(
-            new Settings.SerializerSettings(GryoMessageSerializerV1d0.class.getName(), Collections.emptyMap()),
-            new Settings.SerializerSettings(GryoMessageSerializerV1d0.class.getName(), new HashMap<String,Object>(){{
+            new Settings.SerializerSettings(GryoMessageSerializerV3d0.class.getName(), Collections.emptyMap()),
+            new Settings.SerializerSettings(GryoMessageSerializerV3d0.class.getName(), new HashMap<String,Object>(){{
                 put(AbstractGryoMessageSerializerV1d0.TOKEN_SERIALIZE_RESULT_TO_STRING, true);
             }}),
             new Settings.SerializerSettings(GraphSONMessageSerializerV2d0.class.getName(), Collections.emptyMap())

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
index 041095c..efed270 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
@@ -29,6 +29,7 @@ import org.apache.tinkerpop.gremlin.driver.ResultSet;
 import org.apache.tinkerpop.gremlin.driver.exception.ResponseException;
 import org.apache.tinkerpop.gremlin.driver.handler.WebSocketClientHandler;
 import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
+import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0;
 import org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer;
 import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
 import org.apache.tinkerpop.gremlin.driver.ser.Serializers;
@@ -663,7 +664,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
     }
 
     @Test
-    public void shouldSerializeToStringWhenRequested() throws Exception {
+    public void shouldSerializeToStringWhenRequestedGryoV1() throws Exception {
         final Map<String, Object> m = new HashMap<>();
         m.put("serializeResultToString", true);
         final GryoMessageSerializerV1d0 serializer = new GryoMessageSerializerV1d0();
@@ -681,9 +682,27 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
     }
 
     @Test
-    public void shouldDeserializeWithCustomClasses() throws Exception {
+    public void shouldSerializeToStringWhenRequestedGryoV3() throws Exception {
         final Map<String, Object> m = new HashMap<>();
-        m.put("custom", Arrays.asList(String.format("%s;%s", JsonBuilder.class.getCanonicalName(), JsonBuilderGryoSerializer.class.getCanonicalName())));
+        m.put("serializeResultToString", true);
+        final GryoMessageSerializerV3d0 serializer = new GryoMessageSerializerV3d0();
+        serializer.configure(m, null);
+
+        final Cluster cluster = TestClientFactory.build().serializer(serializer).create();
+        final Client client = cluster.connect();
+
+        final ResultSet resultSet = client.submit("TinkerFactory.createClassic()");
+        final List<Result> results = resultSet.all().join();
+        assertEquals(1, results.size());
+        assertEquals("tinkergraph[vertices:6 edges:6]", results.get(0).getString());
+
+        cluster.close();
+    }
+
+    @Test
+    public void shouldDeserializeWithCustomClassesV1() throws Exception {
+        final Map<String, Object> m = new HashMap<>();
+        m.put("custom", Collections.singletonList(String.format("%s;%s", JsonBuilder.class.getCanonicalName(), JsonBuilderGryoSerializer.class.getCanonicalName())));
         final GryoMessageSerializerV1d0 serializer = new GryoMessageSerializerV1d0();
         serializer.configure(m, null);
 
@@ -696,6 +715,21 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
     }
 
     @Test
+    public void shouldDeserializeWithCustomClassesV3() throws Exception {
+        final Map<String, Object> m = new HashMap<>();
+        m.put("custom", Collections.singletonList(String.format("%s;%s", JsonBuilder.class.getCanonicalName(), JsonBuilderGryoSerializer.class.getCanonicalName())));
+        final GryoMessageSerializerV3d0 serializer = new GryoMessageSerializerV3d0();
+        serializer.configure(m, null);
+
+        final Cluster cluster = TestClientFactory.build().serializer(serializer).create();
+        final Client client = cluster.connect();
+
+        final List<Result> json = client.submit("b = new groovy.json.JsonBuilder();b.people{person {fname 'stephen'\nlname 'mallette'}};b").all().join();
+        assertEquals("{\"people\":{\"person\":{\"fname\":\"stephen\",\"lname\":\"mallette\"}}}", json.get(0).getString());
+        cluster.close();
+    }
+
+    @Test
     public void shouldWorkWithGraphSONV1Serialization() throws Exception {
         final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON_V1D0).create();
         final Client client = cluster.connect();

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
index 7211eb3..5a02d0a 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
@@ -25,6 +25,7 @@ import org.apache.tinkerpop.gremlin.driver.Cluster;
 import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
 import org.apache.tinkerpop.gremlin.driver.exception.ResponseException;
 import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
+import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0;
 import org.apache.tinkerpop.gremlin.server.auth.Krb5Authenticator;
 import org.apache.tinkerpop.gremlin.util.Log4jRecordingAppender;
 import org.ietf.jgss.GSSException;
@@ -224,7 +225,7 @@ public class GremlinServerAuthKrb5IntegrateTest extends AbstractGremlinServerInt
     }
 
     @Test
-    public void shouldAuthenticateWithSerializeResultToString() throws Exception {
+    public void shouldAuthenticateWithSerializeResultToStringV1() throws Exception {
         MessageSerializer serializer = new GryoMessageSerializerV1d0();
         Map config = new HashMap<String, Object>();
         config.put("serializeResultToString", true);
@@ -240,4 +241,22 @@ public class GremlinServerAuthKrb5IntegrateTest extends AbstractGremlinServerInt
             cluster.close();
         }
     }
+
+    @Test
+    public void shouldAuthenticateWithSerializeResultToStringV3() throws Exception {
+        MessageSerializer serializer = new GryoMessageSerializerV3d0();
+        Map config = new HashMap<String, Object>();
+        config.put("serializeResultToString", true);
+        serializer.configure(config, null);
+        final Cluster cluster = TestClientFactory.build().jaasEntry(TESTCONSOLE)
+                .protocol(kdcServer.serverPrincipalName).addContactPoint(kdcServer.hostname).serializer(serializer).create();
+        final Client client = cluster.connect();
+        try {
+            assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
+            assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
+            assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
+        } finally {
+            cluster.close();
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
index 044c672..340442a 100644
--- a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
+++ b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
@@ -34,7 +34,7 @@ serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0], custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0], custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0], custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}}
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true}}
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true}}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdc15dff/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
index 2444dc0..5e725bd 100644
--- a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
+++ b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
@@ -31,6 +31,7 @@ serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0], custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0], custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true}}
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true}}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }}


[41/50] [abbrv] tinkerpop git commit: Fixed bad link CTR

Posted by sp...@apache.org.
Fixed bad link CTR


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

Branch: refs/heads/TINKERPOP-1686
Commit: bd4b98957818650e3daeed7fd37dd124a0b9b31d
Parents: 31daf32
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jul 11 07:45:23 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 11 07:45:23 2017 -0400

----------------------------------------------------------------------
 docs/src/dev/developer/administration.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bd4b9895/docs/src/dev/developer/administration.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/developer/administration.asciidoc b/docs/src/dev/developer/administration.asciidoc
index ddf6719..eef199b 100644
--- a/docs/src/dev/developer/administration.asciidoc
+++ b/docs/src/dev/developer/administration.asciidoc
@@ -101,7 +101,7 @@ productivity.
 
 Finally, new committers should be sent an email that covers some of the administrative elements of their new role:
 
-* link:http://www.apache.org/dev/committers.html[Apache Committer Guide]
+* link:https://www.apache.org/dev/new-committers-guide.html[Apache Committer Guide]
 * link:http://www.apache.org/dev/committers.html[Apache Committer FAQ]
 * link:http://tinkerpop.apache.org/docs/current/dev/developer/[TinkerPop Developer Documentation]
 ** Bring specific attention to the "committer" section which describes our general policies.


[09/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1171'

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


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

Branch: refs/heads/TINKERPOP-1686
Commit: 1744b3ffc929f13acf4343fe8b69cd25f4b9f761
Parents: 4a3eb6d 11fd0d2
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jul 5 07:12:13 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jul 5 07:12:13 2017 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 docs/src/upgrade/release-3.3.x.asciidoc         |  1 +
 .../process/traversal/TraversalSource.java      | 31 -------
 .../dsl/graph/GraphTraversalSource.java         | 95 --------------------
 .../tinkerpop/gremlin/structure/Graph.java      | 13 ---
 .../computer/SparkHadoopGraphProvider.java      | 10 +--
 .../process/TinkerGraphComputerProvider.java    | 15 ++--
 7 files changed, 10 insertions(+), 156 deletions(-)
----------------------------------------------------------------------



[15/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1708' into tp32

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


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

Branch: refs/heads/TINKERPOP-1686
Commit: 77d6dfdc34c296f7c337c583088a7c1fdc934280
Parents: 5f56495 f629033
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Jul 5 08:54:39 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Jul 5 08:54:39 2017 -0600

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 53 ++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/77d6dfdc/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------