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/10 21:25:43 UTC

[01/50] [abbrv] tinkerpop git commit: Merge branch 'tp31' into tp32 [Forced Update!]

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1427 0655211ab -> b738211f4 (forced update)


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-1427
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
----------------------------------------------------------------------


[33/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-1427
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] }}


[35/50] [abbrv] tinkerpop git commit: TINKERPOP-1427 Should use GraphSON 3.0 in the serializer provider

Posted by sp...@apache.org.
TINKERPOP-1427 Should use GraphSON 3.0 in the serializer provider


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

Branch: refs/heads/TINKERPOP-1427
Commit: 0489cd51f0bbfd4a781b45221ba9e3a9ddf675ef
Parents: 42a05a7
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jun 30 14:00:13 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 16:22:19 2017 -0400

----------------------------------------------------------------------
 .../structure/io/graphson/GraphSONSerializerProvider.java       | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0489cd51/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java
index 458a2d9..bd7f966 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java
@@ -40,9 +40,12 @@ final class GraphSONSerializerProvider extends DefaultSerializerProvider {
         if (version == GraphSONVersion.V1_0) {
             setDefaultKeySerializer(new GraphSONSerializersV1d0.GraphSONKeySerializer());
             unknownTypeSerializer = new ToStringSerializer();
-        } else {
+        } else if (version == GraphSONVersion.V2_0) {
             setDefaultKeySerializer(new GraphSONSerializersV2d0.GraphSONKeySerializer());
             unknownTypeSerializer = new ToStringGraphSONSerializer();
+        } else {
+            setDefaultKeySerializer(new GraphSONSerializersV3d0.GraphSONKeySerializer());
+            unknownTypeSerializer = new ToStringGraphSONSerializer();
         }
     }
 


[12/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-1427
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
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


[17/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-1427
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

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

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



[49/50] [abbrv] tinkerpop git commit: TINKERPOP-1427 Fixed py server config

Posted by sp...@apache.org.
TINKERPOP-1427 Fixed py server config

Should have used maching TinkerGraph IORegistry for the version.


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

Branch: refs/heads/TINKERPOP-1427
Commit: 498039f0cef0117075bc7f77b268ee7a1558d011
Parents: fdd1bc3
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jul 7 11:35:34 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 16:25:38 2017 -0400

----------------------------------------------------------------------
 .../gremlin/python/driver/gremlin-server-modern-secure-py.yaml     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/498039f0/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 8b87aa9..5d7ff5c 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
@@ -42,7 +42,7 @@ scriptEngines: {
 serializers:
   - { 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.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}        # application/json
 metrics: {
   slf4jReporter: {enabled: true, interval: 180000}}
 strictTransactionManagement: false


[04/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-1427
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`


[42/50] [abbrv] tinkerpop git commit: 99 percent complete GraphSON 3.0 working with Gremlin-Python. Extended test suite to support both GraphSON 2.0 and GraphSON 3.0 testing. There is one last requirement to do on the code -- a version flag on GraphSONMe

Posted by sp...@apache.org.
99 percent complete GraphSON 3.0 working with Gremlin-Python. Extended test suite to support both GraphSON 2.0 and GraphSON 3.0 testing. There is one last requirement to do on the code -- a version flag on GraphSONMessageSerializer. However, for some reason application/gremlin-v3.0 mime type stuff doesn't work for the Python->GremlinServer tests... Committing what I have so far as I think the issue might be an easy .yaml file fix or something. Dunno.


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

Branch: refs/heads/TINKERPOP-1427
Commit: fdd1bc3f63e390fd422350c956cddd6e4fdc0005
Parents: fc544cb
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Jul 6 15:56:46 2017 -0600
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 16:24:26 2017 -0400

----------------------------------------------------------------------
 .../io/graphson/TraversalSerializersV3d0.java   |  14 +-
 .../jython/gremlin_python/driver/serializer.py  |  32 +-
 .../src/main/jython/gremlin_python/statics.py   |   6 +
 .../gremlin_python/structure/io/graphson.py     | 400 ----------------
 .../gremlin_python/structure/io/graphsonV2d0.py | 400 ++++++++++++++++
 .../gremlin_python/structure/io/graphsonV3d0.py | 466 +++++++++++++++++++
 .../jython/tests/structure/io/test_graphson.py  | 271 -----------
 .../tests/structure/io/test_graphsonV2d0.py     | 273 +++++++++++
 .../tests/structure/io/test_graphsonV3d0.py     | 287 ++++++++++++
 .../python/jsr223/JythonScriptEngineSetup.java  |   9 +-
 .../jsr223/PythonGraphSONJavaTranslator.java    |  29 +-
 .../gremlin/python/jsr223/PythonProvider.java   |   9 +-
 .../io/graphson/GraphSONReaderTest.java         | 149 +++---
 .../io/graphson/GraphSONWriterTest.java         | 142 +++---
 14 files changed, 1667 insertions(+), 820 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdd1bc3f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java
index 57b6736..c629b3f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java
@@ -38,7 +38,6 @@ import org.apache.tinkerpop.shaded.jackson.core.JsonProcessingException;
 import org.apache.tinkerpop.shaded.jackson.core.JsonToken;
 import org.apache.tinkerpop.shaded.jackson.databind.DeserializationContext;
 import org.apache.tinkerpop.shaded.jackson.databind.JavaType;
-import org.apache.tinkerpop.shaded.jackson.databind.JsonNode;
 import org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider;
 import org.apache.tinkerpop.shaded.jackson.databind.deser.std.StdDeserializer;
 import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer;
@@ -160,16 +159,9 @@ final class TraversalSerializersV3d0 {
                     jsonGenerator.writeObject(predicate);
                 }
                 jsonGenerator.writeEndArray();
-            } else {
-                if (p.getValue() instanceof Collection) {
-                    jsonGenerator.writeArrayFieldStart(GraphSONTokens.VALUE);
-                    for (final Object object : (Collection) p.getValue()) {
-                        jsonGenerator.writeObject(object);
-                    }
-                    jsonGenerator.writeEndArray();
-                } else
-                    jsonGenerator.writeObjectField(GraphSONTokens.VALUE, p.getValue());
-            }
+            } else
+                jsonGenerator.writeObjectField(GraphSONTokens.VALUE, p.getValue());
+
             jsonGenerator.writeEndObject();
         }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdd1bc3f/gremlin-python/src/main/jython/gremlin_python/driver/serializer.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/driver/serializer.py b/gremlin-python/src/main/jython/gremlin_python/driver/serializer.py
index a29d4dc..3248b4e 100644
--- a/gremlin-python/src/main/jython/gremlin_python/driver/serializer.py
+++ b/gremlin-python/src/main/jython/gremlin_python/driver/serializer.py
@@ -21,7 +21,8 @@ try:
 except ImportError:
     import json
 
-from gremlin_python.structure.io import graphson
+from gremlin_python.structure.io import graphsonV2d0
+from gremlin_python.structure.io import graphsonV3d0
 
 __author__ = 'David M. Brown (davebshow@gmail.com)'
 
@@ -85,10 +86,10 @@ class GraphSONMessageSerializer:
 
     def __init__(self, reader=None, writer=None):
         if not reader:
-            reader = graphson.GraphSONReader()
+            reader = graphsonV2d0.GraphSONReader()
         self._graphson_reader = reader
         if not writer:
-            writer = graphson.GraphSONWriter()
+            writer = graphsonV2d0.GraphSONWriter()
         self.standard = Standard(writer)
         self.traversal = Traversal(writer)
 
@@ -127,3 +128,28 @@ class GraphSONMessageSerializer:
 
     def deserialize_message(self, message):
         return self._graphson_reader.toObject(message)
+
+class GraphSONSerializersV2d0(GraphSONMessageSerializer):
+    """Message serializer for GraphSON 2.0"""
+
+    def __init__(self, reader=None, writer=None):
+        GraphSONMessageSerializer.__init__(self, reader, writer, "2.0")
+        if not reader:
+            self._graphson_reader = graphsonV2d0.GraphSONReader()
+        if not writer:
+            self._graphson_writer = graphsonV2d0.GraphSONWriter()
+        self.standard = Standard(self._graphson_writer)
+        self.traversal = Traversal(self._graphson_writer)
+
+
+class GraphSONSerializersV3d0(GraphSONMessageSerializer):
+    """Message serializer for GraphSON 3.0"""
+
+    def __init__(self, reader=None, writer=None):
+        GraphSONMessageSerializer.__init__(self, reader, writer, "3.0")
+        if not reader:
+            self._graphson_reader = graphsonV3d0.GraphSONReader()
+        if not writer:
+            self._graphson_writer = graphsonV3d0.GraphSONWriter()
+        self.standard = Standard(self._graphson_writer)
+        self.traversal = Traversal(self._graphson_writer)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdd1bc3f/gremlin-python/src/main/jython/gremlin_python/statics.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/statics.py b/gremlin-python/src/main/jython/gremlin_python/statics.py
index a1abf8e..28cae14 100644
--- a/gremlin-python/src/main/jython/gremlin_python/statics.py
+++ b/gremlin-python/src/main/jython/gremlin_python/statics.py
@@ -29,12 +29,18 @@ if six.PY3:
     IntType = int
     LongType = long
     TypeType = type
+    ListType = list
+    DictType = dict
+    SetType = set
 else:
     long = long
+    SetType = set
     from types import FloatType
     from types import IntType
     from types import LongType
     from types import TypeType
+    from types import ListType
+    from types import DictType
 
 staticMethods = {}
 staticEnums = {}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdd1bc3f/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py
deleted file mode 100644
index 5c7ccdb..0000000
--- a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py
+++ /dev/null
@@ -1,400 +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.
-'''
-from aenum import Enum
-import json
-import six
-
-from gremlin_python import statics
-from gremlin_python.statics import FloatType, FunctionType, IntType, LongType, TypeType
-from gremlin_python.process.traversal import Binding, Bytecode, P, Traversal, Traverser, TraversalStrategy
-from gremlin_python.structure.graph import Edge, Property, Vertex, VertexProperty, Path
-
-_serializers = {}
-_deserializers = {}
-
-
-class GraphSONTypeType(type):
-    def __new__(mcs, name, bases, dct):
-        cls = super(GraphSONTypeType, mcs).__new__(mcs, name, bases, dct)
-        if not name.startswith('_'):
-            if cls.python_type:
-                _serializers[cls.python_type] = cls
-            if cls.graphson_type:
-                _deserializers[cls.graphson_type] = cls
-        return cls
-
-
-class GraphSONUtil(object):
-    TYPE_KEY = "@type"
-    VALUE_KEY = "@value"
-
-    @classmethod
-    def typedValue(cls, type_name, value, prefix="g"):
-        out = {cls.TYPE_KEY: cls.formatType(prefix, type_name)}
-        if value is not None:
-            out[cls.VALUE_KEY] = value
-        return out
-
-    @classmethod
-    def formatType(cls, prefix, type_name):
-        return "%s:%s" % (prefix, type_name)
-
-
-# Read/Write classes split to follow precedence of the Java API
-class GraphSONWriter(object):
-    def __init__(self, serializer_map=None):
-        """
-        :param serializer_map: map from Python type to serializer instance implementing `dictify`
-        """
-        self.serializers = _serializers.copy()
-        if serializer_map:
-            self.serializers.update(serializer_map)
-
-    def writeObject(self, objectData):
-        # to JSON
-        return json.dumps(self.toDict(objectData), separators=(',', ':'))
-
-    def toDict(self, obj):
-        """
-        Encodes python objects in GraphSON type-tagged dict values
-        """
-        try:
-            return self.serializers[type(obj)].dictify(obj, self)
-        except KeyError:
-            for key, serializer in self.serializers.items():
-                if isinstance(obj, key):
-                    return serializer.dictify(obj, self)
-
-        # list and map are treated as normal json objs (could be isolated serializers)
-        if isinstance(obj, (list, set)):
-            return [self.toDict(o) for o in obj]
-        elif isinstance(obj, dict):
-            return dict((self.toDict(k), self.toDict(v)) for k, v in obj.items())
-        else:
-            return obj
-
-
-class GraphSONReader(object):
-    def __init__(self, deserializer_map=None):
-        """
-        :param deserializer_map: map from GraphSON type tag to deserializer instance implementing `objectify`
-        """
-        self.deserializers = _deserializers.copy()
-        if deserializer_map:
-            self.deserializers.update(deserializer_map)
-
-    def readObject(self, jsonData):
-        # from JSON
-        return self.toObject(json.loads(jsonData))
-
-    def toObject(self, obj):
-        """
-        Unpacks GraphSON type-tagged dict values into objects mapped in self.deserializers
-        """
-        if isinstance(obj, dict):
-            try:
-                return self.deserializers[obj[GraphSONUtil.TYPE_KEY]].objectify(obj[GraphSONUtil.VALUE_KEY], self)
-            except KeyError:
-                pass
-            # list and map are treated as normal json objs (could be isolated deserializers)
-            return dict((self.toObject(k), self.toObject(v)) for k, v in obj.items())
-        elif isinstance(obj, list):
-            return [self.toObject(o) for o in obj]
-        else:
-            return obj
-
-
-@six.add_metaclass(GraphSONTypeType)
-class _GraphSONTypeIO(object):
-    python_type = None
-    graphson_type = None
-
-    symbolMap = {"global_": "global", "as_": "as", "in_": "in", "and_": "and",
-                 "or_": "or", "is_": "is", "not_": "not", "from_": "from",
-                 "set_": "set", "list_": "list", "all_": "all"}
-
-    @classmethod
-    def unmangleKeyword(cls, symbol):
-        return cls.symbolMap.get(symbol, symbol)
-
-    def dictify(self, obj, writer):
-        raise NotImplementedError()
-
-    def objectify(self, d, reader):
-        raise NotImplementedError()
-
-
-class _BytecodeSerializer(_GraphSONTypeIO):
-    @classmethod
-    def _dictify_instructions(cls, instructions, writer):
-        out = []
-        for instruction in instructions:
-            inst = [instruction[0]]
-            inst.extend(writer.toDict(arg) for arg in instruction[1:])
-            out.append(inst)
-        return out
-
-    @classmethod
-    def dictify(cls, bytecode, writer):
-        if isinstance(bytecode, Traversal):
-            bytecode = bytecode.bytecode
-        out = {}
-        if bytecode.source_instructions:
-            out["source"] = cls._dictify_instructions(bytecode.source_instructions, writer)
-        if bytecode.step_instructions:
-            out["step"] = cls._dictify_instructions(bytecode.step_instructions, writer)
-        return GraphSONUtil.typedValue("Bytecode", out)
-
-
-class TraversalSerializer(_BytecodeSerializer):
-    python_type = Traversal
-
-
-class BytecodeSerializer(_BytecodeSerializer):
-    python_type = Bytecode
-
-
-class VertexSerializer(_GraphSONTypeIO):
-    python_type = Vertex
-    graphson_type = "g:Vertex"
-
-    @classmethod
-    def dictify(cls, vertex, writer):
-        return GraphSONUtil.typedValue("Vertex", {"id": writer.toDict(vertex.id),
-                                                  "label": writer.toDict(vertex.label)})
-
-
-class EdgeSerializer(_GraphSONTypeIO):
-    python_type = Edge
-    graphson_type = "g:Edge"
-
-    @classmethod
-    def dictify(cls, edge, writer):
-        return GraphSONUtil.typedValue("Edge", {"id": writer.toDict(edge.id),
-                                                "outV": writer.toDict(edge.outV.id),
-                                                "outVLabel": writer.toDict(edge.outV.label),
-                                                "label": writer.toDict(edge.label),
-                                                "inV": writer.toDict(edge.inV.id),
-                                                "inVLabel": writer.toDict(edge.inV.label)})
-
-
-class VertexPropertySerializer(_GraphSONTypeIO):
-    python_type = VertexProperty
-    graphson_type = "g:VertexProperty"
-
-    @classmethod
-    def dictify(cls, vertex_property, writer):
-        return GraphSONUtil.typedValue("VertexProperty", {"id": writer.toDict(vertex_property.id),
-                                                          "label": writer.toDict(vertex_property.label),
-                                                          "value": writer.toDict(vertex_property.value),
-                                                          "vertex": writer.toDict(vertex_property.vertex.id)})
-
-
-class PropertySerializer(_GraphSONTypeIO):
-    python_type = Property
-    graphson_type = "g:Property"
-
-    @classmethod
-    def dictify(cls, property, writer):
-        elementDict = writer.toDict(property.element)
-        if elementDict is not None:
-            valueDict = elementDict["@value"]
-            if "outVLabel" in valueDict:
-                del valueDict["outVLabel"]
-            if "inVLabel" in valueDict:
-                del valueDict["inVLabel"]
-            if "properties" in valueDict:
-                del valueDict["properties"]
-            if "value" in valueDict:
-                del valueDict["value"]
-        return GraphSONUtil.typedValue("Property", {"key": writer.toDict(property.key),
-                                                    "value": writer.toDict(property.value),
-                                                    "element": elementDict})
-
-
-class TraversalStrategySerializer(_GraphSONTypeIO):
-    python_type = TraversalStrategy
-
-    @classmethod
-    def dictify(cls, strategy, writer):
-        return GraphSONUtil.typedValue(strategy.strategy_name, writer.toDict(strategy.configuration))
-
-
-class TraverserIO(_GraphSONTypeIO):
-    python_type = Traverser
-    graphson_type = "g:Traverser"
-
-    @classmethod
-    def dictify(cls, traverser, writer):
-        return GraphSONUtil.typedValue("Traverser", {"value": writer.toDict(traverser.object),
-                                                     "bulk": writer.toDict(traverser.bulk)})
-
-    @classmethod
-    def objectify(cls, d, reader):
-        return Traverser(reader.toObject(d["value"]),
-                         reader.toObject(d["bulk"]))
-
-
-class EnumSerializer(_GraphSONTypeIO):
-    python_type = Enum
-
-    @classmethod
-    def dictify(cls, enum, _):
-        return GraphSONUtil.typedValue(cls.unmangleKeyword(type(enum).__name__),
-                                       cls.unmangleKeyword(str(enum.name)))
-
-
-class PSerializer(_GraphSONTypeIO):
-    python_type = P
-
-    @classmethod
-    def dictify(cls, p, writer):
-        out = {"predicate": p.operator,
-               "value": [writer.toDict(p.value), writer.toDict(p.other)] if p.other is not None else
-               writer.toDict(p.value)}
-        return GraphSONUtil.typedValue("P", out)
-
-
-class BindingSerializer(_GraphSONTypeIO):
-    python_type = Binding
-
-    @classmethod
-    def dictify(cls, binding, writer):
-        out = {"key": binding.key,
-               "value": writer.toDict(binding.value)}
-        return GraphSONUtil.typedValue("Binding", out)
-
-
-class LambdaSerializer(_GraphSONTypeIO):
-    python_type = FunctionType
-
-    @classmethod
-    def dictify(cls, lambda_object, writer):
-        lambda_result = lambda_object()
-        script = lambda_result if isinstance(lambda_result, str) else lambda_result[0]
-        language = statics.default_lambda_language if isinstance(lambda_result, str) else lambda_result[1]
-        out = {"script": script,
-               "language": language}
-        if language == "gremlin-jython" or language == "gremlin-python":
-            if not script.strip().startswith("lambda"):
-                script = "lambda " + script
-                out["script"] = script
-            out["arguments"] = six.get_function_code(eval(out["script"])).co_argcount
-        else:
-            out["arguments"] = -1
-        return GraphSONUtil.typedValue("Lambda", out)
-
-
-class TypeSerializer(_GraphSONTypeIO):
-    python_type = TypeType
-
-    @classmethod
-    def dictify(cls, typ, writer):
-        return writer.toDict(typ())
-
-
-class _NumberIO(_GraphSONTypeIO):
-    @classmethod
-    def dictify(cls, n, writer):
-        if isinstance(n, bool):  # because isinstance(False, int) and isinstance(True, int)
-            return n
-        return GraphSONUtil.typedValue(cls.graphson_base_type, n)
-
-    @classmethod
-    def objectify(cls, v, _):
-        return cls.python_type(v)
-
-
-class FloatIO(_NumberIO):
-    python_type = FloatType
-    graphson_type = "g:Float"
-    graphson_base_type = "Float"
-
-
-class DoubleIO(FloatIO):
-    graphson_type = "g:Double"
-    graphson_base_type = "Double"
-
-
-class Int64IO(_NumberIO):
-    python_type = LongType
-    graphson_type = "g:Int64"
-    graphson_base_type = "Int64"
-
-
-class Int32IO(_NumberIO):
-    python_type = IntType
-    graphson_type = "g:Int32"
-    graphson_base_type = "Int32"
-
-    @classmethod
-    def dictify(cls, n, writer):
-        if isinstance(n, bool):
-            return n
-        return GraphSONUtil.typedValue(cls.graphson_base_type, n)
-
-
-class VertexDeserializer(_GraphSONTypeIO):
-    graphson_type = "g:Vertex"
-
-    @classmethod
-    def objectify(cls, d, reader):
-        return Vertex(reader.toObject(d["id"]), d.get("label", "vertex"))
-
-
-class EdgeDeserializer(_GraphSONTypeIO):
-    graphson_type = "g:Edge"
-
-    @classmethod
-    def objectify(cls, d, reader):
-        return Edge(reader.toObject(d["id"]),
-                    Vertex(reader.toObject(d["outV"]), d.get("outVLabel", "vertex")),
-                    d.get("label", "edge"),
-                    Vertex(reader.toObject(d["inV"]), d.get("inVLabel", "vertex")))
-
-
-class VertexPropertyDeserializer(_GraphSONTypeIO):
-    graphson_type = "g:VertexProperty"
-
-    @classmethod
-    def objectify(cls, d, reader):
-        vertex = Vertex(reader.toObject(d.get("vertex"))) if "vertex" in d else None
-        return VertexProperty(reader.toObject(d["id"]),
-                              d["label"],
-                              reader.toObject(d["value"]),
-                              vertex)
-
-
-class PropertyDeserializer(_GraphSONTypeIO):
-    graphson_type = "g:Property"
-
-    @classmethod
-    def objectify(cls, d, reader):
-        element = reader.toObject(d["element"]) if "element" in d else None
-        return Property(d["key"], reader.toObject(d["value"]), element)
-
-
-class PathDeserializer(_GraphSONTypeIO):
-    graphson_type = "g:Path"
-
-    @classmethod
-    def objectify(cls, d, reader):
-        labels = [set(label) for label in d["labels"]]
-        objects = [reader.toObject(o) for o in d["objects"]]
-        return Path(labels, objects)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdd1bc3f/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV2d0.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV2d0.py b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV2d0.py
new file mode 100644
index 0000000..5c7ccdb
--- /dev/null
+++ b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV2d0.py
@@ -0,0 +1,400 @@
+'''
+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.
+'''
+from aenum import Enum
+import json
+import six
+
+from gremlin_python import statics
+from gremlin_python.statics import FloatType, FunctionType, IntType, LongType, TypeType
+from gremlin_python.process.traversal import Binding, Bytecode, P, Traversal, Traverser, TraversalStrategy
+from gremlin_python.structure.graph import Edge, Property, Vertex, VertexProperty, Path
+
+_serializers = {}
+_deserializers = {}
+
+
+class GraphSONTypeType(type):
+    def __new__(mcs, name, bases, dct):
+        cls = super(GraphSONTypeType, mcs).__new__(mcs, name, bases, dct)
+        if not name.startswith('_'):
+            if cls.python_type:
+                _serializers[cls.python_type] = cls
+            if cls.graphson_type:
+                _deserializers[cls.graphson_type] = cls
+        return cls
+
+
+class GraphSONUtil(object):
+    TYPE_KEY = "@type"
+    VALUE_KEY = "@value"
+
+    @classmethod
+    def typedValue(cls, type_name, value, prefix="g"):
+        out = {cls.TYPE_KEY: cls.formatType(prefix, type_name)}
+        if value is not None:
+            out[cls.VALUE_KEY] = value
+        return out
+
+    @classmethod
+    def formatType(cls, prefix, type_name):
+        return "%s:%s" % (prefix, type_name)
+
+
+# Read/Write classes split to follow precedence of the Java API
+class GraphSONWriter(object):
+    def __init__(self, serializer_map=None):
+        """
+        :param serializer_map: map from Python type to serializer instance implementing `dictify`
+        """
+        self.serializers = _serializers.copy()
+        if serializer_map:
+            self.serializers.update(serializer_map)
+
+    def writeObject(self, objectData):
+        # to JSON
+        return json.dumps(self.toDict(objectData), separators=(',', ':'))
+
+    def toDict(self, obj):
+        """
+        Encodes python objects in GraphSON type-tagged dict values
+        """
+        try:
+            return self.serializers[type(obj)].dictify(obj, self)
+        except KeyError:
+            for key, serializer in self.serializers.items():
+                if isinstance(obj, key):
+                    return serializer.dictify(obj, self)
+
+        # list and map are treated as normal json objs (could be isolated serializers)
+        if isinstance(obj, (list, set)):
+            return [self.toDict(o) for o in obj]
+        elif isinstance(obj, dict):
+            return dict((self.toDict(k), self.toDict(v)) for k, v in obj.items())
+        else:
+            return obj
+
+
+class GraphSONReader(object):
+    def __init__(self, deserializer_map=None):
+        """
+        :param deserializer_map: map from GraphSON type tag to deserializer instance implementing `objectify`
+        """
+        self.deserializers = _deserializers.copy()
+        if deserializer_map:
+            self.deserializers.update(deserializer_map)
+
+    def readObject(self, jsonData):
+        # from JSON
+        return self.toObject(json.loads(jsonData))
+
+    def toObject(self, obj):
+        """
+        Unpacks GraphSON type-tagged dict values into objects mapped in self.deserializers
+        """
+        if isinstance(obj, dict):
+            try:
+                return self.deserializers[obj[GraphSONUtil.TYPE_KEY]].objectify(obj[GraphSONUtil.VALUE_KEY], self)
+            except KeyError:
+                pass
+            # list and map are treated as normal json objs (could be isolated deserializers)
+            return dict((self.toObject(k), self.toObject(v)) for k, v in obj.items())
+        elif isinstance(obj, list):
+            return [self.toObject(o) for o in obj]
+        else:
+            return obj
+
+
+@six.add_metaclass(GraphSONTypeType)
+class _GraphSONTypeIO(object):
+    python_type = None
+    graphson_type = None
+
+    symbolMap = {"global_": "global", "as_": "as", "in_": "in", "and_": "and",
+                 "or_": "or", "is_": "is", "not_": "not", "from_": "from",
+                 "set_": "set", "list_": "list", "all_": "all"}
+
+    @classmethod
+    def unmangleKeyword(cls, symbol):
+        return cls.symbolMap.get(symbol, symbol)
+
+    def dictify(self, obj, writer):
+        raise NotImplementedError()
+
+    def objectify(self, d, reader):
+        raise NotImplementedError()
+
+
+class _BytecodeSerializer(_GraphSONTypeIO):
+    @classmethod
+    def _dictify_instructions(cls, instructions, writer):
+        out = []
+        for instruction in instructions:
+            inst = [instruction[0]]
+            inst.extend(writer.toDict(arg) for arg in instruction[1:])
+            out.append(inst)
+        return out
+
+    @classmethod
+    def dictify(cls, bytecode, writer):
+        if isinstance(bytecode, Traversal):
+            bytecode = bytecode.bytecode
+        out = {}
+        if bytecode.source_instructions:
+            out["source"] = cls._dictify_instructions(bytecode.source_instructions, writer)
+        if bytecode.step_instructions:
+            out["step"] = cls._dictify_instructions(bytecode.step_instructions, writer)
+        return GraphSONUtil.typedValue("Bytecode", out)
+
+
+class TraversalSerializer(_BytecodeSerializer):
+    python_type = Traversal
+
+
+class BytecodeSerializer(_BytecodeSerializer):
+    python_type = Bytecode
+
+
+class VertexSerializer(_GraphSONTypeIO):
+    python_type = Vertex
+    graphson_type = "g:Vertex"
+
+    @classmethod
+    def dictify(cls, vertex, writer):
+        return GraphSONUtil.typedValue("Vertex", {"id": writer.toDict(vertex.id),
+                                                  "label": writer.toDict(vertex.label)})
+
+
+class EdgeSerializer(_GraphSONTypeIO):
+    python_type = Edge
+    graphson_type = "g:Edge"
+
+    @classmethod
+    def dictify(cls, edge, writer):
+        return GraphSONUtil.typedValue("Edge", {"id": writer.toDict(edge.id),
+                                                "outV": writer.toDict(edge.outV.id),
+                                                "outVLabel": writer.toDict(edge.outV.label),
+                                                "label": writer.toDict(edge.label),
+                                                "inV": writer.toDict(edge.inV.id),
+                                                "inVLabel": writer.toDict(edge.inV.label)})
+
+
+class VertexPropertySerializer(_GraphSONTypeIO):
+    python_type = VertexProperty
+    graphson_type = "g:VertexProperty"
+
+    @classmethod
+    def dictify(cls, vertex_property, writer):
+        return GraphSONUtil.typedValue("VertexProperty", {"id": writer.toDict(vertex_property.id),
+                                                          "label": writer.toDict(vertex_property.label),
+                                                          "value": writer.toDict(vertex_property.value),
+                                                          "vertex": writer.toDict(vertex_property.vertex.id)})
+
+
+class PropertySerializer(_GraphSONTypeIO):
+    python_type = Property
+    graphson_type = "g:Property"
+
+    @classmethod
+    def dictify(cls, property, writer):
+        elementDict = writer.toDict(property.element)
+        if elementDict is not None:
+            valueDict = elementDict["@value"]
+            if "outVLabel" in valueDict:
+                del valueDict["outVLabel"]
+            if "inVLabel" in valueDict:
+                del valueDict["inVLabel"]
+            if "properties" in valueDict:
+                del valueDict["properties"]
+            if "value" in valueDict:
+                del valueDict["value"]
+        return GraphSONUtil.typedValue("Property", {"key": writer.toDict(property.key),
+                                                    "value": writer.toDict(property.value),
+                                                    "element": elementDict})
+
+
+class TraversalStrategySerializer(_GraphSONTypeIO):
+    python_type = TraversalStrategy
+
+    @classmethod
+    def dictify(cls, strategy, writer):
+        return GraphSONUtil.typedValue(strategy.strategy_name, writer.toDict(strategy.configuration))
+
+
+class TraverserIO(_GraphSONTypeIO):
+    python_type = Traverser
+    graphson_type = "g:Traverser"
+
+    @classmethod
+    def dictify(cls, traverser, writer):
+        return GraphSONUtil.typedValue("Traverser", {"value": writer.toDict(traverser.object),
+                                                     "bulk": writer.toDict(traverser.bulk)})
+
+    @classmethod
+    def objectify(cls, d, reader):
+        return Traverser(reader.toObject(d["value"]),
+                         reader.toObject(d["bulk"]))
+
+
+class EnumSerializer(_GraphSONTypeIO):
+    python_type = Enum
+
+    @classmethod
+    def dictify(cls, enum, _):
+        return GraphSONUtil.typedValue(cls.unmangleKeyword(type(enum).__name__),
+                                       cls.unmangleKeyword(str(enum.name)))
+
+
+class PSerializer(_GraphSONTypeIO):
+    python_type = P
+
+    @classmethod
+    def dictify(cls, p, writer):
+        out = {"predicate": p.operator,
+               "value": [writer.toDict(p.value), writer.toDict(p.other)] if p.other is not None else
+               writer.toDict(p.value)}
+        return GraphSONUtil.typedValue("P", out)
+
+
+class BindingSerializer(_GraphSONTypeIO):
+    python_type = Binding
+
+    @classmethod
+    def dictify(cls, binding, writer):
+        out = {"key": binding.key,
+               "value": writer.toDict(binding.value)}
+        return GraphSONUtil.typedValue("Binding", out)
+
+
+class LambdaSerializer(_GraphSONTypeIO):
+    python_type = FunctionType
+
+    @classmethod
+    def dictify(cls, lambda_object, writer):
+        lambda_result = lambda_object()
+        script = lambda_result if isinstance(lambda_result, str) else lambda_result[0]
+        language = statics.default_lambda_language if isinstance(lambda_result, str) else lambda_result[1]
+        out = {"script": script,
+               "language": language}
+        if language == "gremlin-jython" or language == "gremlin-python":
+            if not script.strip().startswith("lambda"):
+                script = "lambda " + script
+                out["script"] = script
+            out["arguments"] = six.get_function_code(eval(out["script"])).co_argcount
+        else:
+            out["arguments"] = -1
+        return GraphSONUtil.typedValue("Lambda", out)
+
+
+class TypeSerializer(_GraphSONTypeIO):
+    python_type = TypeType
+
+    @classmethod
+    def dictify(cls, typ, writer):
+        return writer.toDict(typ())
+
+
+class _NumberIO(_GraphSONTypeIO):
+    @classmethod
+    def dictify(cls, n, writer):
+        if isinstance(n, bool):  # because isinstance(False, int) and isinstance(True, int)
+            return n
+        return GraphSONUtil.typedValue(cls.graphson_base_type, n)
+
+    @classmethod
+    def objectify(cls, v, _):
+        return cls.python_type(v)
+
+
+class FloatIO(_NumberIO):
+    python_type = FloatType
+    graphson_type = "g:Float"
+    graphson_base_type = "Float"
+
+
+class DoubleIO(FloatIO):
+    graphson_type = "g:Double"
+    graphson_base_type = "Double"
+
+
+class Int64IO(_NumberIO):
+    python_type = LongType
+    graphson_type = "g:Int64"
+    graphson_base_type = "Int64"
+
+
+class Int32IO(_NumberIO):
+    python_type = IntType
+    graphson_type = "g:Int32"
+    graphson_base_type = "Int32"
+
+    @classmethod
+    def dictify(cls, n, writer):
+        if isinstance(n, bool):
+            return n
+        return GraphSONUtil.typedValue(cls.graphson_base_type, n)
+
+
+class VertexDeserializer(_GraphSONTypeIO):
+    graphson_type = "g:Vertex"
+
+    @classmethod
+    def objectify(cls, d, reader):
+        return Vertex(reader.toObject(d["id"]), d.get("label", "vertex"))
+
+
+class EdgeDeserializer(_GraphSONTypeIO):
+    graphson_type = "g:Edge"
+
+    @classmethod
+    def objectify(cls, d, reader):
+        return Edge(reader.toObject(d["id"]),
+                    Vertex(reader.toObject(d["outV"]), d.get("outVLabel", "vertex")),
+                    d.get("label", "edge"),
+                    Vertex(reader.toObject(d["inV"]), d.get("inVLabel", "vertex")))
+
+
+class VertexPropertyDeserializer(_GraphSONTypeIO):
+    graphson_type = "g:VertexProperty"
+
+    @classmethod
+    def objectify(cls, d, reader):
+        vertex = Vertex(reader.toObject(d.get("vertex"))) if "vertex" in d else None
+        return VertexProperty(reader.toObject(d["id"]),
+                              d["label"],
+                              reader.toObject(d["value"]),
+                              vertex)
+
+
+class PropertyDeserializer(_GraphSONTypeIO):
+    graphson_type = "g:Property"
+
+    @classmethod
+    def objectify(cls, d, reader):
+        element = reader.toObject(d["element"]) if "element" in d else None
+        return Property(d["key"], reader.toObject(d["value"]), element)
+
+
+class PathDeserializer(_GraphSONTypeIO):
+    graphson_type = "g:Path"
+
+    @classmethod
+    def objectify(cls, d, reader):
+        labels = [set(label) for label in d["labels"]]
+        objects = [reader.toObject(o) for o in d["objects"]]
+        return Path(labels, objects)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdd1bc3f/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py
new file mode 100644
index 0000000..1818df7
--- /dev/null
+++ b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py
@@ -0,0 +1,466 @@
+'''
+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.
+'''
+from aenum import Enum
+import json
+import six
+
+from gremlin_python import statics
+from gremlin_python.statics import FloatType, FunctionType, IntType, LongType, TypeType, DictType, ListType, SetType
+from gremlin_python.process.traversal import Binding, Bytecode, P, Traversal, Traverser, TraversalStrategy
+from gremlin_python.structure.graph import Edge, Property, Vertex, VertexProperty, Path
+
+_serializers = {}
+_deserializers = {}
+
+
+class GraphSONTypeType(type):
+    def __new__(mcs, name, bases, dct):
+        cls = super(GraphSONTypeType, mcs).__new__(mcs, name, bases, dct)
+        if not name.startswith('_'):
+            if cls.python_type:
+                _serializers[cls.python_type] = cls
+            if cls.graphson_type:
+                _deserializers[cls.graphson_type] = cls
+        return cls
+
+
+class GraphSONUtil(object):
+    TYPE_KEY = "@type"
+    VALUE_KEY = "@value"
+
+    @classmethod
+    def typedValue(cls, type_name, value, prefix="g"):
+        out = {cls.TYPE_KEY: cls.formatType(prefix, type_name)}
+        if value is not None:
+            out[cls.VALUE_KEY] = value
+        return out
+
+    @classmethod
+    def formatType(cls, prefix, type_name):
+        return "%s:%s" % (prefix, type_name)
+
+
+# Read/Write classes split to follow precedence of the Java API
+class GraphSONWriter(object):
+    def __init__(self, serializer_map=None):
+        """
+        :param serializer_map: map from Python type to serializer instance implementing `dictify`
+        """
+        self.serializers = _serializers.copy()
+        if serializer_map:
+            self.serializers.update(serializer_map)
+
+    def writeObject(self, objectData):
+        # to JSON
+        return json.dumps(self.toDict(objectData), separators=(',', ':'))
+
+    def toDict(self, obj):
+        """
+        Encodes python objects in GraphSON type-tagged dict values
+        """
+        try:
+            return self.serializers[type(obj)].dictify(obj, self)
+        except KeyError:
+            for key, serializer in self.serializers.items():
+                if isinstance(obj, key):
+                    return serializer.dictify(obj, self)
+
+        if isinstance(obj, dict):
+            return dict((self.toDict(k), self.toDict(v)) for k, v in obj.items())
+        elif isinstance(obj, set):
+            return set([self.toDict(o) for o in obj])
+        elif isinstance(obj, list):
+            return [self.toDict(o) for o in obj]
+        else:
+            return obj
+
+
+class GraphSONReader(object):
+    def __init__(self, deserializer_map=None):
+        """
+        :param deserializer_map: map from GraphSON type tag to deserializer instance implementing `objectify`
+        """
+        self.deserializers = _deserializers.copy()
+        if deserializer_map:
+            self.deserializers.update(deserializer_map)
+
+    def readObject(self, jsonData):
+        # from JSON
+        return self.toObject(json.loads(jsonData))
+
+    def toObject(self, obj):
+        """
+        Unpacks GraphSON type-tagged dict values into objects mapped in self.deserializers
+        """
+        if isinstance(obj, dict):
+            try:
+                return self.deserializers[obj[GraphSONUtil.TYPE_KEY]].objectify(obj[GraphSONUtil.VALUE_KEY], self)
+            except KeyError:
+                pass
+            return dict((self.toObject(k), self.toObject(v)) for k, v in obj.items())
+        elif isinstance(obj, set):
+            return set([self.toObject(o) for o in obj])
+        elif isinstance(obj, list):
+            return [self.toObject(o) for o in obj]
+        else:
+            return obj
+
+
+@six.add_metaclass(GraphSONTypeType)
+class _GraphSONTypeIO(object):
+    python_type = None
+    graphson_type = None
+
+    symbolMap = {"global_": "global", "as_": "as", "in_": "in", "and_": "and",
+                 "or_": "or", "is_": "is", "not_": "not", "from_": "from",
+                 "set_": "set", "list_": "list", "all_": "all"}
+
+    @classmethod
+    def unmangleKeyword(cls, symbol):
+        return cls.symbolMap.get(symbol, symbol)
+
+    def dictify(self, obj, writer):
+        raise NotImplementedError()
+
+    def objectify(self, d, reader):
+        raise NotImplementedError()
+
+
+class _BytecodeSerializer(_GraphSONTypeIO):
+    @classmethod
+    def _dictify_instructions(cls, instructions, writer):
+        out = []
+        for instruction in instructions:
+            inst = [instruction[0]]
+            inst.extend(writer.toDict(arg) for arg in instruction[1:])
+            out.append(inst)
+        return out
+
+    @classmethod
+    def dictify(cls, bytecode, writer):
+        if isinstance(bytecode, Traversal):
+            bytecode = bytecode.bytecode
+        out = {}
+        if bytecode.source_instructions:
+            out["source"] = cls._dictify_instructions(bytecode.source_instructions, writer)
+        if bytecode.step_instructions:
+            out["step"] = cls._dictify_instructions(bytecode.step_instructions, writer)
+        return GraphSONUtil.typedValue("Bytecode", out)
+
+
+class TraversalSerializer(_BytecodeSerializer):
+    python_type = Traversal
+
+
+class BytecodeSerializer(_BytecodeSerializer):
+    python_type = Bytecode
+
+
+class VertexSerializer(_GraphSONTypeIO):
+    python_type = Vertex
+    graphson_type = "g:Vertex"
+
+    @classmethod
+    def dictify(cls, vertex, writer):
+        return GraphSONUtil.typedValue("Vertex", {"id": writer.toDict(vertex.id),
+                                                  "label": writer.toDict(vertex.label)})
+
+
+class EdgeSerializer(_GraphSONTypeIO):
+    python_type = Edge
+    graphson_type = "g:Edge"
+
+    @classmethod
+    def dictify(cls, edge, writer):
+        return GraphSONUtil.typedValue("Edge", {"id": writer.toDict(edge.id),
+                                                "outV": writer.toDict(edge.outV.id),
+                                                "outVLabel": writer.toDict(edge.outV.label),
+                                                "label": writer.toDict(edge.label),
+                                                "inV": writer.toDict(edge.inV.id),
+                                                "inVLabel": writer.toDict(edge.inV.label)})
+
+
+class VertexPropertySerializer(_GraphSONTypeIO):
+    python_type = VertexProperty
+    graphson_type = "g:VertexProperty"
+
+    @classmethod
+    def dictify(cls, vertex_property, writer):
+        return GraphSONUtil.typedValue("VertexProperty", {"id": writer.toDict(vertex_property.id),
+                                                          "label": writer.toDict(vertex_property.label),
+                                                          "value": writer.toDict(vertex_property.value),
+                                                          "vertex": writer.toDict(vertex_property.vertex.id)})
+
+
+class PropertySerializer(_GraphSONTypeIO):
+    python_type = Property
+    graphson_type = "g:Property"
+
+    @classmethod
+    def dictify(cls, property, writer):
+        elementDict = writer.toDict(property.element)
+        if elementDict is not None:
+            valueDict = elementDict["@value"]
+            if "outVLabel" in valueDict:
+                del valueDict["outVLabel"]
+            if "inVLabel" in valueDict:
+                del valueDict["inVLabel"]
+            if "properties" in valueDict:
+                del valueDict["properties"]
+            if "value" in valueDict:
+                del valueDict["value"]
+        return GraphSONUtil.typedValue("Property", {"key": writer.toDict(property.key),
+                                                    "value": writer.toDict(property.value),
+                                                    "element": elementDict})
+
+
+class TraversalStrategySerializer(_GraphSONTypeIO):
+    python_type = TraversalStrategy
+
+    @classmethod
+    def dictify(cls, strategy, writer):
+        configuration = {}
+        for key in strategy.configuration:
+            configuration[key] = writer.toDict(strategy.configuration[key])
+        return GraphSONUtil.typedValue(strategy.strategy_name, configuration)
+
+
+class TraverserIO(_GraphSONTypeIO):
+    python_type = Traverser
+    graphson_type = "g:Traverser"
+
+    @classmethod
+    def dictify(cls, traverser, writer):
+        return GraphSONUtil.typedValue("Traverser", {"value": writer.toDict(traverser.object),
+                                                     "bulk": writer.toDict(traverser.bulk)})
+
+    @classmethod
+    def objectify(cls, d, reader):
+        return Traverser(reader.toObject(d["value"]),
+                         reader.toObject(d["bulk"]))
+
+
+class EnumSerializer(_GraphSONTypeIO):
+    python_type = Enum
+
+    @classmethod
+    def dictify(cls, enum, _):
+        return GraphSONUtil.typedValue(cls.unmangleKeyword(type(enum).__name__),
+                                       cls.unmangleKeyword(str(enum.name)))
+
+
+class PSerializer(_GraphSONTypeIO):
+    python_type = P
+
+    @classmethod
+    def dictify(cls, p, writer):
+        out = {"predicate": p.operator,
+               "value": [writer.toDict(p.value), writer.toDict(p.other)] if p.other is not None else
+               writer.toDict(p.value)}
+        return GraphSONUtil.typedValue("P", out)
+
+
+class BindingSerializer(_GraphSONTypeIO):
+    python_type = Binding
+
+    @classmethod
+    def dictify(cls, binding, writer):
+        out = {"key": binding.key,
+               "value": writer.toDict(binding.value)}
+        return GraphSONUtil.typedValue("Binding", out)
+
+
+class LambdaSerializer(_GraphSONTypeIO):
+    python_type = FunctionType
+
+    @classmethod
+    def dictify(cls, lambda_object, writer):
+        lambda_result = lambda_object()
+        script = lambda_result if isinstance(lambda_result, str) else lambda_result[0]
+        language = statics.default_lambda_language if isinstance(lambda_result, str) else lambda_result[1]
+        out = {"script": script,
+               "language": language}
+        if language == "gremlin-jython" or language == "gremlin-python":
+            if not script.strip().startswith("lambda"):
+                script = "lambda " + script
+                out["script"] = script
+            out["arguments"] = six.get_function_code(eval(out["script"])).co_argcount
+        else:
+            out["arguments"] = -1
+        return GraphSONUtil.typedValue("Lambda", out)
+
+
+class TypeSerializer(_GraphSONTypeIO):
+    python_type = TypeType
+
+    @classmethod
+    def dictify(cls, typ, writer):
+        return writer.toDict(typ())
+
+
+class _NumberIO(_GraphSONTypeIO):
+    @classmethod
+    def dictify(cls, n, writer):
+        if isinstance(n, bool):  # because isinstance(False, int) and isinstance(True, int)
+            return n
+        return GraphSONUtil.typedValue(cls.graphson_base_type, n)
+
+    @classmethod
+    def objectify(cls, v, _):
+        return cls.python_type(v)
+
+
+class ListIO(_GraphSONTypeIO):
+    python_type = ListType
+    graphson_type = "g:List"
+
+    @classmethod
+    def dictify(cls, l, writer):
+        new_list = []
+        for obj in l:
+            new_list.append(writer.toDict(obj))
+        return GraphSONUtil.typedValue("List", new_list)
+
+    @classmethod
+    def objectify(cls, l, reader):
+        new_list = []
+        for obj in l:
+            new_list.append(reader.toObject(obj))
+        return new_list
+
+
+class SetIO(_GraphSONTypeIO):
+    python_type = SetType
+    graphson_type = "g:Set"
+
+    @classmethod
+    def dictify(cls, s, writer):
+        new_list = []
+        for obj in s:
+            new_list.append(writer.toDict(obj))
+        return GraphSONUtil.typedValue("Set", new_list)
+
+    @classmethod
+    def objectify(cls, s, reader):
+        new_set = set()
+        for obj in s:
+            new_set.add(reader.toObject(obj))
+        return new_set
+
+
+class MapType(_GraphSONTypeIO):
+    python_type = DictType
+    graphson_type = "g:Map"
+
+    @classmethod
+    def dictify(cls, d, writer):
+        l = []
+        for key in d:
+            l.append(writer.toDict(key))
+            l.append(writer.toDict(d[key]))
+        return GraphSONUtil.typedValue("Map", l)
+
+    @classmethod
+    def objectify(cls, l, reader):
+        new_dict = {}
+        if len(l) > 0:
+            x = 0
+            while x < len(l):
+                new_dict[reader.toObject(l[x])] = reader.toObject(l[x + 1])
+                x = x + 2
+        return new_dict
+
+
+class FloatIO(_NumberIO):
+    python_type = FloatType
+    graphson_type = "g:Float"
+    graphson_base_type = "Float"
+
+
+class DoubleIO(FloatIO):
+    graphson_type = "g:Double"
+    graphson_base_type = "Double"
+
+
+class Int64IO(_NumberIO):
+    python_type = LongType
+    graphson_type = "g:Int64"
+    graphson_base_type = "Int64"
+
+
+class Int32IO(_NumberIO):
+    python_type = IntType
+    graphson_type = "g:Int32"
+    graphson_base_type = "Int32"
+
+    @classmethod
+    def dictify(cls, n, writer):
+        if isinstance(n, bool):
+            return n
+        return GraphSONUtil.typedValue(cls.graphson_base_type, n)
+
+
+class VertexDeserializer(_GraphSONTypeIO):
+    graphson_type = "g:Vertex"
+
+    @classmethod
+    def objectify(cls, d, reader):
+        return Vertex(reader.toObject(d["id"]), d.get("label", "vertex"))
+
+
+class EdgeDeserializer(_GraphSONTypeIO):
+    graphson_type = "g:Edge"
+
+    @classmethod
+    def objectify(cls, d, reader):
+        return Edge(reader.toObject(d["id"]),
+                    Vertex(reader.toObject(d["outV"]), d.get("outVLabel", "vertex")),
+                    d.get("label", "edge"),
+                    Vertex(reader.toObject(d["inV"]), d.get("inVLabel", "vertex")))
+
+
+class VertexPropertyDeserializer(_GraphSONTypeIO):
+    graphson_type = "g:VertexProperty"
+
+    @classmethod
+    def objectify(cls, d, reader):
+        vertex = Vertex(reader.toObject(d.get("vertex"))) if "vertex" in d else None
+        return VertexProperty(reader.toObject(d["id"]),
+                              d["label"],
+                              reader.toObject(d["value"]),
+                              vertex)
+
+
+class PropertyDeserializer(_GraphSONTypeIO):
+    graphson_type = "g:Property"
+
+    @classmethod
+    def objectify(cls, d, reader):
+        element = reader.toObject(d["element"]) if "element" in d else None
+        return Property(d["key"], reader.toObject(d["value"]), element)
+
+
+class PathDeserializer(_GraphSONTypeIO):
+    graphson_type = "g:Path"
+
+    @classmethod
+    def objectify(cls, d, reader):
+        labels = [set(label) for label in d["labels"]]
+        objects = [reader.toObject(o) for o in d["objects"]]
+        return Path(labels, objects)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdd1bc3f/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py b/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py
deleted file mode 100644
index 719550b..0000000
--- a/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py
+++ /dev/null
@@ -1,271 +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.
-'''
-
-__author__ = 'Marko A. Rodriguez (http://markorodriguez.com)'
-
-import sys
-import json
-from mock import Mock
-
-import six
-
-from gremlin_python.statics import *
-from gremlin_python.structure.graph import Vertex, Edge, Property, VertexProperty
-from gremlin_python.structure.graph import Path
-from gremlin_python.structure.io.graphson import GraphSONWriter, GraphSONReader, GraphSONUtil
-import gremlin_python.structure.io.graphson
-from gremlin_python.process.traversal import P
-from gremlin_python.process.strategies import SubgraphStrategy
-from gremlin_python.process.graph_traversal import __
-
-
-class TestGraphSONReader(object):
-    graphson_reader = GraphSONReader()
-
-    def test_number_input(self):
-        x = self.graphson_reader.readObject(json.dumps({
-            "@type": "g:Int32",
-            "@value": 31
-        }))
-        assert isinstance(x, int)
-        assert 31 == x
-        ##
-        x = self.graphson_reader.readObject(json.dumps({
-            "@type": "g:Int64",
-            "@value": 31
-        }))
-        assert isinstance(x, long)
-        assert long(31) == x
-        ##
-        x = self.graphson_reader.readObject(json.dumps({
-            "@type": "g:Float",
-            "@value": 31.3
-        }))
-        assert isinstance(x, float)
-        assert 31.3 == x
-        ##
-        x = self.graphson_reader.readObject(json.dumps({
-            "@type": "g:Double",
-            "@value": 31.2
-        }))
-        assert isinstance(x, float)
-        assert 31.2 == x
-
-    def test_graph(self):
-        vertex = self.graphson_reader.readObject("""
-        {"@type":"g:Vertex", "@value":{"id":{"@type":"g:Int32","@value":1},"label":"person","outE":{"created":[{"id":{"@type":"g:Int32","@value":9},"inV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Double","@value":0.4}}}],"knows":[{"id":{"@type":"g:Int32","@value":7},"inV":{"@type":"g:Int32","@value":2},"properties":{"weight":{"@type":"g:Double","@value":0.5}}},{"id":{"@type":"g:Int32","@value":8},"inV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@type":"g:Double","@value":1.0}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"marko"}],"age":[{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29}}]}}}""")
-        assert isinstance(vertex, Vertex)
-        assert "person" == vertex.label
-        assert 1 == vertex.id
-        assert isinstance(vertex.id, int)
-        assert vertex == Vertex(1)
-        ##
-        vertex = self.graphson_reader.readObject("""
-        {"@type":"g:Vertex", "@value":{"id":{"@type":"g:Float","@value":45.23}}}""")
-        assert isinstance(vertex, Vertex)
-        assert 45.23 == vertex.id
-        assert isinstance(vertex.id, FloatType)
-        assert "vertex" == vertex.label
-        assert vertex == Vertex(45.23)
-        ##
-        vertex_property = self.graphson_reader.readObject("""
-        {"@type":"g:VertexProperty", "@value":{"id":"anId","label":"aKey","value":true,"vertex":{"@type":"g:Int32","@value":9}}}""")
-        assert isinstance(vertex_property, VertexProperty)
-        assert "anId" == vertex_property.id
-        assert "aKey" == vertex_property.label
-        assert vertex_property.value
-        assert vertex_property.vertex == Vertex(9)
-        ##
-        vertex_property = self.graphson_reader.readObject("""
-        {"@type":"g:VertexProperty", "@value":{"id":{"@type":"g:Int32","@value":1},"label":"name","value":"marko"}}""")
-        assert isinstance(vertex_property, VertexProperty)
-        assert 1 == vertex_property.id
-        assert "name" == vertex_property.label
-        assert "marko" == vertex_property.value
-        assert vertex_property.vertex is None
-        ##
-        edge = self.graphson_reader.readObject("""
-        {"@type":"g:Edge", "@value":{"id":{"@type":"g:Int64","@value":17},"label":"knows","inV":"x","outV":"y","inVLabel":"xLab","properties":{"aKey":"aValue","bKey":true}}}""")
-        # print edge
-        assert isinstance(edge, Edge)
-        assert 17 == edge.id
-        assert "knows" == edge.label
-        assert edge.inV == Vertex("x", "xLabel")
-        assert edge.outV == Vertex("y", "vertex")
-        ##
-        property = self.graphson_reader.readObject("""
-        {"@type":"g:Property", "@value":{"key":"aKey","value":{"@type":"g:Int64","@value":17},"element":{"@type":"g:Edge","@value":{"id":{"@type":"g:Int64","@value":122},"label":"knows","inV":"x","outV":"y","inVLabel":"xLab"}}}}""")
-        # print property
-        assert isinstance(property, Property)
-        assert "aKey" == property.key
-        assert 17 == property.value
-        assert Edge(122, Vertex("x"), "knows", Vertex("y")) == property.element
-
-    def test_path(self):
-        path = self.graphson_reader.readObject(
-            """{"@type":"g:Path","@value":{"labels":[["a"],["b","c"],[]],"objects":[{"@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":1},"label":"person","properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":0},"value":"marko","label":"name"}}],"age":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29},"label":"age"}}]}}},{"@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":3},"label":"software","properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":4},"value":"lop","label":"name"}}],"lang":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":5},"value":"java","label":"lang"}}]}}},"lop"]}}"""
-        )
-        assert isinstance(path, Path)
-        if six.PY3:
-            assert "[v[1], v[3], 'lop']" == str(path)
-        else:
-            assert "[v[1], v[3], u'lop']" == str(path)
-        assert Vertex(1) == path[0]
-        assert Vertex(1) == path["a"]
-        assert "lop" == path[2]
-        assert 3 == len(path)
-
-    def test_custom_mapping(self):
-
-        # extended mapping
-        class X(object):
-            pass
-
-        type_string = "test:Xtype"
-        override_string = "g:Int64"
-        serdes = Mock()
-
-        reader = GraphSONReader(deserializer_map={type_string: serdes})
-        assert type_string in reader.deserializers
-
-        # base dicts are not modified
-        assert type_string not in gremlin_python.structure.io.graphson._deserializers
-
-        x = X()
-        o = reader.toObject({GraphSONUtil.TYPE_KEY: type_string, GraphSONUtil.VALUE_KEY: x})
-        serdes.objectify.assert_called_once_with(x, reader)
-        assert o is serdes.objectify()
-
-        # overridden mapping
-        type_string = "g:Int64"
-        serdes = Mock()
-        reader = GraphSONReader(deserializer_map={type_string: serdes, override_string: serdes})
-        assert gremlin_python.structure.io.graphson._deserializers[type_string] is not reader.deserializers[type_string]
-
-        value = 3
-        o = reader.toObject({GraphSONUtil.TYPE_KEY: type_string, GraphSONUtil.VALUE_KEY: value})
-        serdes.objectify.assert_called_once_with(value, reader)
-        assert o is serdes.objectify()
-
-
-class TestGraphSONWriter(object):
-
-    graphson_writer = GraphSONWriter()
-
-    def test_number_output(self):
-        assert {"@type": "g:Int64", "@value": 2} == json.loads(self.graphson_writer.writeObject(long(2)))
-        assert {"@type": "g:Int32", "@value": 1} == json.loads(self.graphson_writer.writeObject(1))
-        assert {"@type": "g:Double", "@value": 3.2} == json.loads(self.graphson_writer.writeObject(3.2))
-        assert """true""" == self.graphson_writer.writeObject(True)
-
-    def test_numbers(self):
-        assert {"@type": "g:Int64", "@value": 2} == json.loads(self.graphson_writer.writeObject(long(2)))
-        assert {"@type": "g:Int32", "@value": 1} == json.loads(self.graphson_writer.writeObject(1))
-        assert {"@type": "g:Double", "@value": 3.2} == json.loads(self.graphson_writer.writeObject(3.2))
-        assert """true""" == self.graphson_writer.writeObject(True)
-
-    def test_P(self):
-        result = {'@type': 'g:P',
-                  '@value': {
-                     'predicate': 'and',
-                     'value': [{
-                        '@type': 'g:P',
-                        '@value': {
-                            'predicate': 'or',
-                            'value': [{
-                                '@type': 'g:P',
-                                '@value': {'predicate': 'lt', 'value': 'b'}
-                            },
-                            {'@type': 'g:P', '@value': {'predicate': 'gt', 'value': 'c'}}
-                            ]
-                        }
-                    },
-                    {'@type': 'g:P', '@value': {'predicate': 'neq', 'value': 'd'}}]}}
-
-        assert  result == json.loads(
-            self.graphson_writer.writeObject(P.lt("b").or_(P.gt("c")).and_(P.neq("d"))))
-
-    def test_strategies(self):
-        # we have a proxy model for now given that we don't want to have to have g:XXX all registered on the Gremlin traversal machine (yet)
-        assert {"@type": "g:SubgraphStrategy", "@value": {}} == json.loads(
-            self.graphson_writer.writeObject(SubgraphStrategy))
-        assert {"@type": "g:SubgraphStrategy", "@value": {
-            "vertices": {"@type": "g:Bytecode", "@value": {"step": [["has", "name", "marko"]]}}}} == json.loads(
-            self.graphson_writer.writeObject(SubgraphStrategy(vertices=__.has("name", "marko"))))
-
-    def test_graph(self):
-        # TODO: this assert is not compatible with python 3 and now that we test with both 2 and 3 it fails
-        assert {"@type": "g:Vertex", "@value": {"id": {"@type": "g:Int64", "@value": 12}, "label": "person"}} == json.loads(self.graphson_writer.writeObject(Vertex(long(12), "person")))
-
-        assert {"@type": "g:Edge", "@value": {"id": {"@type": "g:Int32", "@value": 7},
-                                              "outV": {"@type": "g:Int32", "@value": 0},
-                                              "outVLabel": "person",
-                                              "label": "knows",
-                                              "inV": {"@type": "g:Int32", "@value": 1},
-                                              "inVLabel": "dog"}} == json.loads(
-            self.graphson_writer.writeObject(Edge(7, Vertex(0, "person"), "knows", Vertex(1, "dog"))))
-        assert {"@type": "g:VertexProperty", "@value": {"id": "blah", "label": "keyA", "value": True,
-                                                        "vertex": "stephen"}} == json.loads(
-            self.graphson_writer.writeObject(VertexProperty("blah", "keyA", True, Vertex("stephen"))))
-
-        assert {"@type": "g:Property",
-                "@value": {"key": "name", "value": "marko", "element": {"@type": "g:VertexProperty",
-                                                                        "@value": {
-                                                                            "vertex": "vertexId",
-                                                                            "id": {"@type": "g:Int32", "@value": 1234},
-                                                                            "label": "aKey"}}}} == json.loads(
-            self.graphson_writer.writeObject(
-                Property("name", "marko", VertexProperty(1234, "aKey", 21345, Vertex("vertexId")))))
-
-    def test_custom_mapping(self):
-        # extended mapping
-        class X(object):
-            pass
-
-        serdes = Mock()
-        writer = GraphSONWriter(serializer_map={X: serdes})
-        assert X in writer.serializers
-
-        # base dicts are not modified
-        assert X not in gremlin_python.structure.io.graphson._serializers
-
-        obj = X()
-        d = writer.toDict(obj)
-        serdes.dictify.assert_called_once_with(obj, writer)
-        assert d is serdes.dictify()
-
-        # overridden mapping
-        serdes = Mock()
-        writer = GraphSONWriter(serializer_map={int: serdes})
-        assert gremlin_python.structure.io.graphson._serializers[int] is not writer.serializers[int]
-
-        value = 3
-        d = writer.toDict(value)
-        serdes.dictify.assert_called_once_with(value, writer)
-        assert d is serdes.dictify()
-
-    def test_write_long(self):
-
-        mapping = self.graphson_writer.toDict(1)
-        assert mapping['@type'] == 'g:Int32'
-        assert mapping['@value'] == 1
-
-        mapping = self.graphson_writer.toDict(long(1))
-        assert mapping['@type'] == 'g:Int64'
-        assert mapping['@value'] == 1

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdd1bc3f/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV2d0.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV2d0.py b/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV2d0.py
new file mode 100644
index 0000000..6bc5097
--- /dev/null
+++ b/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV2d0.py
@@ -0,0 +1,273 @@
+'''
+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.
+'''
+
+__author__ = 'Marko A. Rodriguez (http://markorodriguez.com)'
+
+import sys
+import json
+from mock import Mock
+
+import six
+
+from gremlin_python.statics import *
+from gremlin_python.structure.graph import Vertex, Edge, Property, VertexProperty
+from gremlin_python.structure.graph import Path
+from gremlin_python.structure.io.graphsonV2d0 import GraphSONWriter, GraphSONReader, GraphSONUtil
+import gremlin_python.structure.io.graphsonV2d0
+from gremlin_python.process.traversal import P
+from gremlin_python.process.strategies import SubgraphStrategy
+from gremlin_python.process.graph_traversal import __
+
+
+class TestGraphSONReader(object):
+    graphson_reader = GraphSONReader()
+
+    def test_number_input(self):
+        x = self.graphson_reader.readObject(json.dumps({
+            "@type": "g:Int32",
+            "@value": 31
+        }))
+        assert isinstance(x, int)
+        assert 31 == x
+        ##
+        x = self.graphson_reader.readObject(json.dumps({
+            "@type": "g:Int64",
+            "@value": 31
+        }))
+        assert isinstance(x, long)
+        assert long(31) == x
+        ##
+        x = self.graphson_reader.readObject(json.dumps({
+            "@type": "g:Float",
+            "@value": 31.3
+        }))
+        assert isinstance(x, float)
+        assert 31.3 == x
+        ##
+        x = self.graphson_reader.readObject(json.dumps({
+            "@type": "g:Double",
+            "@value": 31.2
+        }))
+        assert isinstance(x, float)
+        assert 31.2 == x
+
+    def test_graph(self):
+        vertex = self.graphson_reader.readObject("""
+        {"@type":"g:Vertex", "@value":{"id":{"@type":"g:Int32","@value":1},"label":"person","outE":{"created":[{"id":{"@type":"g:Int32","@value":9},"inV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Double","@value":0.4}}}],"knows":[{"id":{"@type":"g:Int32","@value":7},"inV":{"@type":"g:Int32","@value":2},"properties":{"weight":{"@type":"g:Double","@value":0.5}}},{"id":{"@type":"g:Int32","@value":8},"inV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@type":"g:Double","@value":1.0}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"marko"}],"age":[{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29}}]}}}""")
+        assert isinstance(vertex, Vertex)
+        assert "person" == vertex.label
+        assert 1 == vertex.id
+        assert isinstance(vertex.id, int)
+        assert vertex == Vertex(1)
+        ##
+        vertex = self.graphson_reader.readObject("""
+        {"@type":"g:Vertex", "@value":{"id":{"@type":"g:Float","@value":45.23}}}""")
+        assert isinstance(vertex, Vertex)
+        assert 45.23 == vertex.id
+        assert isinstance(vertex.id, FloatType)
+        assert "vertex" == vertex.label
+        assert vertex == Vertex(45.23)
+        ##
+        vertex_property = self.graphson_reader.readObject("""
+        {"@type":"g:VertexProperty", "@value":{"id":"anId","label":"aKey","value":true,"vertex":{"@type":"g:Int32","@value":9}}}""")
+        assert isinstance(vertex_property, VertexProperty)
+        assert "anId" == vertex_property.id
+        assert "aKey" == vertex_property.label
+        assert vertex_property.value
+        assert vertex_property.vertex == Vertex(9)
+        ##
+        vertex_property = self.graphson_reader.readObject("""
+        {"@type":"g:VertexProperty", "@value":{"id":{"@type":"g:Int32","@value":1},"label":"name","value":"marko"}}""")
+        assert isinstance(vertex_property, VertexProperty)
+        assert 1 == vertex_property.id
+        assert "name" == vertex_property.label
+        assert "marko" == vertex_property.value
+        assert vertex_property.vertex is None
+        ##
+        edge = self.graphson_reader.readObject("""
+        {"@type":"g:Edge", "@value":{"id":{"@type":"g:Int64","@value":17},"label":"knows","inV":"x","outV":"y","inVLabel":"xLab","properties":{"aKey":"aValue","bKey":true}}}""")
+        # print edge
+        assert isinstance(edge, Edge)
+        assert 17 == edge.id
+        assert "knows" == edge.label
+        assert edge.inV == Vertex("x", "xLabel")
+        assert edge.outV == Vertex("y", "vertex")
+        ##
+        property = self.graphson_reader.readObject("""
+        {"@type":"g:Property", "@value":{"key":"aKey","value":{"@type":"g:Int64","@value":17},"element":{"@type":"g:Edge","@value":{"id":{"@type":"g:Int64","@value":122},"label":"knows","inV":"x","outV":"y","inVLabel":"xLab"}}}}""")
+        # print property
+        assert isinstance(property, Property)
+        assert "aKey" == property.key
+        assert 17 == property.value
+        assert Edge(122, Vertex("x"), "knows", Vertex("y")) == property.element
+
+    def test_path(self):
+        path = self.graphson_reader.readObject(
+            """{"@type":"g:Path","@value":{"labels":[["a"],["b","c"],[]],"objects":[{"@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":1},"label":"person","properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":0},"value":"marko","label":"name"}}],"age":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29},"label":"age"}}]}}},{"@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":3},"label":"software","properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":4},"value":"lop","label":"name"}}],"lang":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":5},"value":"java","label":"lang"}}]}}},"lop"]}}"""
+        )
+        assert isinstance(path, Path)
+        if six.PY3:
+            assert "[v[1], v[3], 'lop']" == str(path)
+        else:
+            assert "[v[1], v[3], u'lop']" == str(path)
+        assert Vertex(1) == path[0]
+        assert Vertex(1) == path["a"]
+        assert "lop" == path[2]
+        assert 3 == len(path)
+
+    def test_custom_mapping(self):
+
+        # extended mapping
+        class X(object):
+            pass
+
+        type_string = "test:Xtype"
+        override_string = "g:Int64"
+        serdes = Mock()
+
+        reader = GraphSONReader(deserializer_map={type_string: serdes})
+        assert type_string in reader.deserializers
+
+        # base dicts are not modified
+        assert type_string not in gremlin_python.structure.io.graphsonV2d0._deserializers
+
+        x = X()
+        o = reader.toObject({GraphSONUtil.TYPE_KEY: type_string, GraphSONUtil.VALUE_KEY: x})
+        serdes.objectify.assert_called_once_with(x, reader)
+        assert o is serdes.objectify()
+
+        # overridden mapping
+        type_string = "g:Int64"
+        serdes = Mock()
+        reader = GraphSONReader(deserializer_map={type_string: serdes, override_string: serdes})
+        assert gremlin_python.structure.io.graphsonV2d0._deserializers[type_string] is not reader.deserializers[type_string]
+
+        value = 3
+        o = reader.toObject({GraphSONUtil.TYPE_KEY: type_string, GraphSONUtil.VALUE_KEY: value})
+        serdes.objectify.assert_called_once_with(value, reader)
+        assert o is serdes.objectify()
+
+class TestGraphSONWriter(object):
+
+    graphson_writer = GraphSONWriter()
+
+    def test_number_output(self):
+        assert {"@type": "g:Int64", "@value": 2} == json.loads(self.graphson_writer.writeObject(long(2)))
+        assert {"@type": "g:Int32", "@value": 1} == json.loads(self.graphson_writer.writeObject(1))
+        assert {"@type": "g:Double", "@value": 3.2} == json.loads(self.graphson_writer.writeObject(3.2))
+        assert """true""" == self.graphson_writer.writeObject(True)
+
+    def test_numbers(self):
+        assert {"@type": "g:Int64", "@value": 2} == json.loads(self.graphson_writer.writeObject(long(2)))
+        assert {"@type": "g:Int32", "@value": 1} == json.loads(self.graphson_writer.writeObject(1))
+        assert {"@type": "g:Double", "@value": 3.2} == json.loads(self.graphson_writer.writeObject(3.2))
+        assert """true""" == self.graphson_writer.writeObject(True)
+
+    def test_P(self):
+        result = {'@type': 'g:P',
+                  '@value': {
+                     'predicate': 'and',
+                     'value': [{
+                        '@type': 'g:P',
+                        '@value': {
+                            'predicate': 'or',
+                            'value': [{
+                                '@type': 'g:P',
+                                '@value': {'predicate': 'lt', 'value': 'b'}
+                            },
+                            {'@type': 'g:P', '@value': {'predicate': 'gt', 'value': 'c'}}
+                            ]
+                        }
+                    },
+                    {'@type': 'g:P', '@value': {'predicate': 'neq', 'value': 'd'}}]}}
+
+        assert  result == json.loads(
+            self.graphson_writer.writeObject(P.lt("b").or_(P.gt("c")).and_(P.neq("d"))))
+
+        result = {'@type': 'g:P', '@value': {'predicate':'within','value': [{"@type": "g:Int32", "@value": 1},{"@type": "g:Int32", "@value": 2}]}}
+        assert result == json.loads(self.graphson_writer.writeObject(P.within([1,2])))
+
+    def test_strategies(self):
+        # we have a proxy model for now given that we don't want to have to have g:XXX all registered on the Gremlin traversal machine (yet)
+        assert {"@type": "g:SubgraphStrategy", "@value": {}} == json.loads(
+            self.graphson_writer.writeObject(SubgraphStrategy))
+        assert {"@type": "g:SubgraphStrategy", "@value": {
+            "vertices": {"@type": "g:Bytecode", "@value": {"step": [["has", "name", "marko"]]}}}} == json.loads(
+            self.graphson_writer.writeObject(SubgraphStrategy(vertices=__.has("name", "marko"))))
+
+    def test_graph(self):
+        # TODO: this assert is not compatible with python 3 and now that we test with both 2 and 3 it fails
+        assert {"@type": "g:Vertex", "@value": {"id": {"@type": "g:Int64", "@value": 12}, "label": "person"}} == json.loads(self.graphson_writer.writeObject(Vertex(long(12), "person")))
+
+        assert {"@type": "g:Edge", "@value": {"id": {"@type": "g:Int32", "@value": 7},
+                                              "outV": {"@type": "g:Int32", "@value": 0},
+                                              "outVLabel": "person",
+                                              "label": "knows",
+                                              "inV": {"@type": "g:Int32", "@value": 1},
+                                              "inVLabel": "dog"}} == json.loads(
+            self.graphson_writer.writeObject(Edge(7, Vertex(0, "person"), "knows", Vertex(1, "dog"))))
+        assert {"@type": "g:VertexProperty", "@value": {"id": "blah", "label": "keyA", "value": True,
+                                                        "vertex": "stephen"}} == json.loads(
+            self.graphson_writer.writeObject(VertexProperty("blah", "keyA", True, Vertex("stephen"))))
+
+        assert {"@type": "g:Property",
+                "@value": {"key": "name", "value": "marko", "element": {"@type": "g:VertexProperty",
+                                                                        "@value": {
+                                                                            "vertex": "vertexId",
+                                                                            "id": {"@type": "g:Int32", "@value": 1234},
+                                                                            "label": "aKey"}}}} == json.loads(
+            self.graphson_writer.writeObject(
+                Property("name", "marko", VertexProperty(1234, "aKey", 21345, Vertex("vertexId")))))
+
+    def test_custom_mapping(self):
+        # extended mapping
+        class X(object):
+            pass
+
+        serdes = Mock()
+        writer = GraphSONWriter(serializer_map={X: serdes})
+        assert X in writer.serializers
+
+        # base dicts are not modified
+        assert X not in gremlin_python.structure.io.graphsonV2d0._serializers
+
+        obj = X()
+        d = writer.toDict(obj)
+        serdes.dictify.assert_called_once_with(obj, writer)
+        assert d is serdes.dictify()
+
+        # overridden mapping
+        serdes = Mock()
+        writer = GraphSONWriter(serializer_map={int: serdes})
+        assert gremlin_python.structure.io.graphsonV2d0._serializers[int] is not writer.serializers[int]
+
+        value = 3
+        d = writer.toDict(value)
+        serdes.dictify.assert_called_once_with(value, writer)
+        assert d is serdes.dictify()
+
+    def test_write_long(self):
+
+        mapping = self.graphson_writer.toDict(1)
+        assert mapping['@type'] == 'g:Int32'
+        assert mapping['@value'] == 1
+
+        mapping = self.graphson_writer.toDict(long(1))
+        assert mapping['@type'] == 'g:Int64'
+        assert mapping['@value'] == 1
\ No newline at end of file


[47/50] [abbrv] tinkerpop git commit: TINKERPOP-1427 Fixed problems with v2 vs v3 in gremlin-python

Posted by sp...@apache.org.
TINKERPOP-1427 Fixed problems with v2 vs v3 in gremlin-python

There were several problems. In protocol.py there was an expectation as the to the format of the ResponseMessage that changed between v2 and v3. I added a bit of a sketchy hack to deal with that detects v2/v3 and then parses accordingly. That should be nicer. There were some issues with tests as well that bound assertions to v2 so that when the default serializer swapped from v2 to v3 those assertions started failing. I forced those specific tests to v2 to get them to pass. Ultimately, we need to more generally test v2 and v3, but at least gremlin-python is defaulted to v3 at this point and all tests are passing.


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

Branch: refs/heads/TINKERPOP-1427
Commit: 851bede4aa43e1ceb0609ba6bbf15ada926b8ec0
Parents: 498039f
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jul 7 13:52:15 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 16:25:38 2017 -0400

----------------------------------------------------------------------
 .../src/main/jython/gremlin_python/driver/client.py   |  2 +-
 .../src/main/jython/gremlin_python/driver/protocol.py | 11 ++++++++---
 .../main/jython/gremlin_python/driver/serializer.py   | 14 +++++++-------
 gremlin-python/src/main/jython/tests/conftest.py      | 13 +++++++++++++
 .../src/main/jython/tests/driver/test_client.py       |  5 ++++-
 .../tests/driver/test_driver_remote_connection.py     |  4 ++--
 .../jython/tests/structure/io/test_graphsonV3d0.py    |  5 ++---
 7 files changed, 37 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/851bede4/gremlin-python/src/main/jython/gremlin_python/driver/client.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/driver/client.py b/gremlin-python/src/main/jython/gremlin_python/driver/client.py
index 4d06071..faf4ca4 100644
--- a/gremlin-python/src/main/jython/gremlin_python/driver/client.py
+++ b/gremlin-python/src/main/jython/gremlin_python/driver/client.py
@@ -42,7 +42,7 @@ class Client:
         self._url = url
         self._traversal_source = traversal_source
         if message_serializer is None:
-            message_serializer = serializer.GraphSONMessageSerializer()
+            message_serializer = serializer.GraphSONSerializersV3d0()
         self._message_serializer = message_serializer
         self._username = username
         self._password = password

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/851bede4/gremlin-python/src/main/jython/gremlin_python/driver/protocol.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/driver/protocol.py b/gremlin-python/src/main/jython/gremlin_python/driver/protocol.py
index 84a7d82..75c99bc 100644
--- a/gremlin-python/src/main/jython/gremlin_python/driver/protocol.py
+++ b/gremlin-python/src/main/jython/gremlin_python/driver/protocol.py
@@ -86,9 +86,14 @@ class GremlinServerWSProtocol(AbstractBaseProtocol):
             del results_dict[request_id]
         elif status_code in [200, 206]:
             results = []
-            for msg in data["result"]["data"]:
-                results.append(
-                    self._message_serializer.deserialize_message(msg))
+            # this is a bit of a hack for now. basically the protocol.py picks the json apart and doesn't
+            # account for types too well right now.
+            if self._message_serializer.version == b"application/vnd.gremlin-v2.0+json":
+                for msg in data["result"]["data"]:
+                    results.append(
+                        self._message_serializer.deserialize_message(msg))
+            else:
+                results = self._message_serializer.deserialize_message(data["result"]["data"]["@value"])
             result_set.stream.put_nowait(results)
             if status_code == 206:
                 data = self._transport.read()

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/851bede4/gremlin-python/src/main/jython/gremlin_python/driver/serializer.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/driver/serializer.py b/gremlin-python/src/main/jython/gremlin_python/driver/serializer.py
index 3248b4e..8686b7b 100644
--- a/gremlin-python/src/main/jython/gremlin_python/driver/serializer.py
+++ b/gremlin-python/src/main/jython/gremlin_python/driver/serializer.py
@@ -84,12 +84,13 @@ class Traversal(Processor):
 class GraphSONMessageSerializer:
     """Message serializer for GraphSON"""
 
-    def __init__(self, reader=None, writer=None):
+    def __init__(self, reader=None, writer=None, version=b"application/vnd.gremlin-v3.0+json"):
+        self.version = version
         if not reader:
-            reader = graphsonV2d0.GraphSONReader()
+            reader = graphsonV3d0.GraphSONReader()
         self._graphson_reader = reader
         if not writer:
-            writer = graphsonV2d0.GraphSONWriter()
+            writer = graphsonV3d0.GraphSONWriter()
         self.standard = Standard(writer)
         self.traversal = Traversal(writer)
 
@@ -118,8 +119,7 @@ class GraphSONMessageSerializer:
             'op': op,
             'args': args
         }
-        return self.finalize_message(message, b"\x21",
-                                     b"application/vnd.gremlin-v2.0+json")
+        return self.finalize_message(message, b"\x21", self.version)
 
     def finalize_message(self, message, mime_len, mime_type):
         message = json.dumps(message)
@@ -133,7 +133,7 @@ class GraphSONSerializersV2d0(GraphSONMessageSerializer):
     """Message serializer for GraphSON 2.0"""
 
     def __init__(self, reader=None, writer=None):
-        GraphSONMessageSerializer.__init__(self, reader, writer, "2.0")
+        GraphSONMessageSerializer.__init__(self, reader, writer, b"application/vnd.gremlin-v2.0+json")
         if not reader:
             self._graphson_reader = graphsonV2d0.GraphSONReader()
         if not writer:
@@ -146,7 +146,7 @@ class GraphSONSerializersV3d0(GraphSONMessageSerializer):
     """Message serializer for GraphSON 3.0"""
 
     def __init__(self, reader=None, writer=None):
-        GraphSONMessageSerializer.__init__(self, reader, writer, "3.0")
+        GraphSONMessageSerializer.__init__(self, reader, writer, b"application/vnd.gremlin-v3.0+json")
         if not reader:
             self._graphson_reader = graphsonV3d0.GraphSONReader()
         if not writer:

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/851bede4/gremlin-python/src/main/jython/tests/conftest.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/conftest.py b/gremlin-python/src/main/jython/tests/conftest.py
index 2cd4282..d014296 100644
--- a/gremlin-python/src/main/jython/tests/conftest.py
+++ b/gremlin-python/src/main/jython/tests/conftest.py
@@ -23,6 +23,7 @@ from six.moves import queue
 
 from gremlin_python.driver.client import Client
 from gremlin_python.driver.connection import Connection
+from gremlin_python.driver import serializer
 from gremlin_python.driver.driver_remote_connection import (
     DriverRemoteConnection)
 from gremlin_python.driver.protocol import GremlinServerWSProtocol
@@ -73,3 +74,15 @@ def remote_connection(request):
             remote_conn.close()
         request.addfinalizer(fin)
         return remote_conn
+
+@pytest.fixture
+def remote_connection_v2(request):
+    try:
+        remote_conn = DriverRemoteConnection('ws://localhost:45940/gremlin', 'g', message_serializer=serializer.GraphSONSerializersV2d0())
+    except OSError:
+        pytest.skip('Gremlin Server is not running')
+    else:
+        def fin():
+            remote_conn.close()
+        request.addfinalizer(fin)
+        return remote_conn

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/851bede4/gremlin-python/src/main/jython/tests/driver/test_client.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_client.py b/gremlin-python/src/main/jython/tests/driver/test_client.py
index f7b01ce..7a6f3b4 100644
--- a/gremlin-python/src/main/jython/tests/driver/test_client.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_client.py
@@ -21,6 +21,7 @@ import pytest
 from gremlin_python.driver.client import Client
 from gremlin_python.driver.request import RequestMessage
 from gremlin_python.structure.graph import Graph
+from gremlin_python.driver import serializer
 
 __author__ = 'David M. Brown (davebshow@gmail.com)'
 
@@ -78,7 +79,7 @@ def test_client_async(client):
 
 def test_connection_share(client):
     # Overwrite fixture with pool_size=1 client
-    client = Client('ws://localhost:45940/gremlin', 'g', pool_size=1)
+    client = Client('ws://localhost:45940/gremlin', 'g', pool_size=1, message_serializer=serializer.GraphSONSerializersV2d0())
     g = Graph().traversal()
     t = g.V()
     message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode})
@@ -98,6 +99,8 @@ def test_multi_conn_pool(client):
     g = Graph().traversal()
     t = g.V()
     message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode})
+
+    client = Client('ws://localhost:45940/gremlin', 'g', pool_size=1, message_serializer=serializer.GraphSONSerializersV2d0())
     future = client.submitAsync(message)
     future2 = client.submitAsync(message)
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/851bede4/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 71cebf0..45b7433 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
@@ -103,10 +103,10 @@ class TestDriverRemoteConnection(object):
         assert 6 == g.V().count().next()
         assert 6 == g.E().count().next()
 
-    def test_side_effects(self, remote_connection):
+    def test_side_effects(self, remote_connection_v2):
         statics.load_statics(globals())
         #
-        g = Graph().traversal().withRemote(remote_connection)
+        g = Graph().traversal().withRemote(remote_connection_v2)
         ###
         t = g.V().hasLabel("project").name.iterate()
         assert 0 == len(t.side_effects.keys())

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/851bede4/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py b/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py
index 65425e4..19897dc 100644
--- a/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py
+++ b/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py
@@ -176,9 +176,8 @@ class TestGraphSONWriter(object):
                                              {"@type": "g:Int32", "@value": 3}]} == json.loads(
             self.graphson_writer.writeObject(set([1, 2, 3, 3])))
         assert {"@type": "g:Map",
-                "@value": ['a', {"@type": "g:Int32", "@value": 1},
-                           'b', {"@type": "g:Int32", "@value": 2}]} == json.loads(
-            self.graphson_writer.writeObject({'a': 1, 'b': 2}))
+                "@value": ['a', {"@type": "g:Int32", "@value": 1}]} == json.loads(
+            self.graphson_writer.writeObject({'a': 1}))
 
     def test_number_output(self):
         assert {"@type": "g:Int64", "@value": 2} == json.loads(self.graphson_writer.writeObject(long(2)))


[25/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-1427
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);


[23/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-1427
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());


[11/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-1427
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
----------------------------------------------------------------------


[14/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-1427
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 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-1427
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]


[34/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-1427
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
 ^^^^^^^^^^^^^^^^^^^^
 


[48/50] [abbrv] tinkerpop git commit: added GraphSONReader tests for set/list/map to test_graphsonV3d0.py. Already tested in the Jython infrastruture, but why not have it also localized in the pure Python tests.

Posted by sp...@apache.org.
added GraphSONReader tests for set/list/map to test_graphsonV3d0.py. Already tested in the Jython infrastruture, but why not have it also localized in the pure Python tests.


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

Branch: refs/heads/TINKERPOP-1427
Commit: c12988cc05b143753e0cbe6f9bc2e94b6c9be464
Parents: 851bede
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri Jul 7 14:52:30 2017 -0600
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 16:25:38 2017 -0400

----------------------------------------------------------------------
 .../tests/structure/io/test_graphsonV3d0.py     | 31 ++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c12988cc/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py b/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py
index 19897dc..78798b3 100644
--- a/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py
+++ b/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py
@@ -33,9 +33,35 @@ from gremlin_python.process.traversal import P
 from gremlin_python.process.strategies import SubgraphStrategy
 from gremlin_python.process.graph_traversal import __
 
+
 class TestGraphSONReader(object):
     graphson_reader = GraphSONReader()
 
+    def test_collections(self):
+        x = self.graphson_reader.readObject(
+            json.dumps({"@type": "g:List", "@value": [{"@type": "g:Int32", "@value": 1},
+                                                      {"@type": "g:Int32", "@value": 2},
+                                                      "3"]}))
+        assert isinstance(x, list)
+        assert x[0] == 1
+        assert x[1] == 2
+        assert x[2] == "3"
+        ##
+        x = self.graphson_reader.readObject(
+            json.dumps({"@type": "g:Set", "@value": [{"@type": "g:Int32", "@value": 1},
+                                                     {"@type": "g:Int32", "@value": 2},
+                                                     "3"]}))
+        assert isinstance(x, set)
+        assert x == set([1, 2, "3"])
+        ##
+        x = self.graphson_reader.readObject(
+            json.dumps({"@type": "g:Map",
+                        "@value": ['a', {"@type": "g:Int32", "@value": 1}, 'b', "marko"]}))
+        assert isinstance(x, dict)
+        assert x['a'] == 1
+        assert x['b'] == "marko"
+        assert len(x) == 2
+
     def test_number_input(self):
         x = self.graphson_reader.readObject(json.dumps({
             "@type": "g:Int32",
@@ -212,8 +238,9 @@ class TestGraphSONWriter(object):
         assert result == json.loads(
             self.graphson_writer.writeObject(P.lt("b").or_(P.gt("c")).and_(P.neq("d"))))
 
-        result = {'@type': 'g:P', '@value': {'predicate':'within','value': {'@type': 'g:List', '@value':[{"@type": "g:Int32", "@value": 1},{"@type": "g:Int32", "@value": 2}]}}}
-        assert result == json.loads(self.graphson_writer.writeObject(P.within([1,2])))
+        result = {'@type': 'g:P', '@value': {'predicate': 'within', 'value': {'@type': 'g:List', '@value': [
+            {"@type": "g:Int32", "@value": 1}, {"@type": "g:Int32", "@value": 2}]}}}
+        assert result == json.loads(self.graphson_writer.writeObject(P.within([1, 2])))
 
     def test_strategies(self):
         # we have a proxy model for now given that we don't want to have to have g:XXX all registered on the Gremlin traversal machine (yet)


[21/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-1427
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)


[18/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-1427
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>


[40/50] [abbrv] tinkerpop git commit: TINKERPOP-1427 Added g:Set and g:List for GraphSON 3.0

Posted by sp...@apache.org.
TINKERPOP-1427 Added g:Set and g:List for GraphSON 3.0


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

Branch: refs/heads/TINKERPOP-1427
Commit: fc544cbab4fabf0afa311cd24b09b187bf95a053
Parents: 98a6c59
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Sun Jul 2 17:51:18 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 16:24:26 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   2 +-
 .../structure/io/graphson/GraphSONModule.java   |   8 +
 .../io/graphson/GraphSONSerializersV3d0.java    |  20 +-
 .../io/graphson/GraphSONTypeSerializerV3d0.java |  26 +++
 .../io/graphson/JavaUtilSerializersV3d0.java    |  83 +++++++++
 .../GraphSONMapperEmbeddedTypeTest.java         |  42 ++++-
 .../GremlinServerAuditLogIntegrateTest.java     |   3 +-
 .../server/GremlinServerHttpIntegrateTest.java  |  77 ++++----
 .../io/graphson/_3_3_0/metrics-v3d0.json        |  49 ++---
 .../structure/io/graphson/_3_3_0/path-v3d0.json |  73 +++++---
 .../io/graphson/_3_3_0/standardresult-v3d0.json | 179 +++++++++---------
 .../graphson/_3_3_0/traversalmetrics-v3d0.json  | 181 ++++++++++---------
 12 files changed, 464 insertions(+), 279 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fc544cba/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 8c08d5d..7ef804e 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -42,7 +42,6 @@ TinkerPop 3.3.0 (Release Date: NOT OFFICIALLY RELEASED YET)
 * Updated Docker build scripts to include Python dependencies (NOTE: users should remove any previously generated TinkerPop Docker images).
 * Added "attachment requisite" `VertexProperty.element()` and `Property.element()` data in GraphSON serialization.
 * GraphSON 3.0 is now the default serialization format in TinkerGraph and Gremlin Server.
-* Established the GraphSON 3.0 format.
 * Changed `ServerGremlinExecutor` to not use generics since there really is no flexibility in the kind of `ScheduledExecutorService` that will be used.
 * Removed support for passing a byte array on the `sasl` parameter.
 * Removed previously deprecated `GraphSONMapper$Builder#embedTypes` option.
@@ -50,6 +49,7 @@ TinkerPop 3.3.0 (Release Date: NOT OFFICIALLY RELEASED YET)
 * Removed previously deprecated `ConnectionPoolSettings.sessionId` and `ConnectionPoolSettings.optionalSessionId()`.
 * Removed previously deprecated `reconnectInitialDelay` setting from the Java driver.
 * Removed previously deprecated `useMapperFromGraph` option.
+* Established the GraphSON 3.0 format with new `g:Map`, `g:List` and `g:Set` types.
 * Removed previously deprecated `Io.Builder#registry(IoRegistry)` method.
 * Removed previously deprecated `GryoMessageSerializerV1d0(GryoMapper)` constructor.
 * Removed previously deprecated `TinkerIoRegistry`.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fc544cba/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
index 22dc6b2..00bec01 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
@@ -90,7 +90,9 @@ import java.time.ZonedDateTime;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.LinkedHashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.stream.Stream;
 
 /**
@@ -125,6 +127,8 @@ abstract class GraphSONModule extends TinkerPopJacksonModule {
 
                     put(Map.Entry.class, "Entry");
                     put(Map.class, "Map");
+                    put(List.class, "List");
+                    put(Set.class, "Set");
 
                     // Tinkerpop Graph objects
                     put(Lambda.class, "Lambda");
@@ -206,6 +210,8 @@ abstract class GraphSONModule extends TinkerPopJacksonModule {
             // java.util
             addSerializer(Map.Entry.class, new JavaUtilSerializersV3d0.MapEntryJacksonSerializer());
             addSerializer(Map.class, new JavaUtilSerializersV3d0.MapJacksonSerializer());
+            addSerializer(List.class, new JavaUtilSerializersV3d0.ListJacksonSerializer());
+            addSerializer(Set.class, new JavaUtilSerializersV3d0.SetJacksonSerializer());
 
             // need to explicitly add serializers for those types because Jackson doesn't do it at all.
             addSerializer(Integer.class, new GraphSONSerializersV3d0.IntegerGraphSONSerializer());
@@ -245,6 +251,8 @@ abstract class GraphSONModule extends TinkerPopJacksonModule {
             // java.util
             addDeserializer(Map.Entry.class, new JavaUtilSerializersV3d0.MapEntryJacksonDeserializer());
             addDeserializer(Map.class, new JavaUtilSerializersV3d0.MapJacksonDeserializer());
+            addDeserializer(List.class, new JavaUtilSerializersV3d0.ListJacksonDeserializer());
+            addDeserializer(Set.class, new JavaUtilSerializersV3d0.SetJacksonDeserializer());
 
             // numbers
             addDeserializer(Integer.class, new GraphSONSerializersV3d0.IntegerJackonsDeserializer());

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fc544cba/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java
index 5fe8e74..8c601b1 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java
@@ -547,18 +547,22 @@ class GraphSONSerializersV3d0 {
 
         @Override
         public Path deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
-            final JsonNode n = jsonParser.readValueAsTree();
             final Path p = MutablePath.make();
 
-            final ArrayNode labels = (ArrayNode) n.get(GraphSONTokens.LABELS);
-            final ArrayNode objects = (ArrayNode) n.get(GraphSONTokens.OBJECTS);
+            List<Object> labels = new ArrayList<>();
+            List<Object> objects = new ArrayList<>();
+            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
+                if (jsonParser.getCurrentName().equals(GraphSONTokens.LABELS)) {
+                    jsonParser.nextToken();
+                    labels = deserializationContext.readValue(jsonParser, List.class);
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.OBJECTS)) {
+                    jsonParser.nextToken();
+                    objects = deserializationContext.readValue(jsonParser, List.class);
+                }
+            }
 
             for (int i = 0; i < objects.size(); i++) {
-                final JsonParser po = objects.get(i).traverse();
-                po.nextToken();
-                final JsonParser pl = labels.get(i).traverse();
-                pl.nextToken();
-                p.extend(deserializationContext.readValue(po, Object.class), deserializationContext.readValue(pl, setType));
+                p.extend(objects.get(i), (Set<String>) labels.get(i));
             }
 
             return p;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fc544cba/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java
index 246d38f..f3b7afa 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java
@@ -42,7 +42,9 @@ import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeIdResolver;
 import java.io.IOException;
 import java.net.InetAddress;
 import java.nio.ByteBuffer;
+import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * GraphSON 2.0 {@code TypeSerializer}.
@@ -78,6 +80,26 @@ public class GraphSONTypeSerializerV3d0 extends AbstractGraphSONTypeSerializer {
     }
 
     @Override
+    public void writeTypePrefixForArray(final Object o, final JsonGenerator jsonGenerator) throws IOException {
+        if (o instanceof List || o instanceof Set) {
+            writeTypePrefix(jsonGenerator, getTypeIdResolver().idFromValueAndType(o, getClassFromObject(o)));
+            jsonGenerator.writeStartArray();
+        } else {
+            jsonGenerator.writeStartArray();
+        }
+    }
+
+    @Override
+    public void writeTypeSuffixForArray(final Object o, final JsonGenerator jsonGenerator) throws IOException {
+        if (o instanceof List || o instanceof Set) {
+            jsonGenerator.writeEndArray();
+            writeTypeSuffix(jsonGenerator);
+        } else {
+            jsonGenerator.writeEndArray();
+        }
+    }
+
+    @Override
     protected Class getClassFromObject(final Object o) {
         final Class c = o.getClass();
         if (classMap.containsKey(c))
@@ -88,6 +110,10 @@ public class GraphSONTypeSerializerV3d0 extends AbstractGraphSONTypeSerializer {
             mapped = Map.class;
         else if (Map.Entry.class.isAssignableFrom(c))
             mapped = Map.Entry.class;
+        else if (List.class.isAssignableFrom(c))
+            mapped = List.class;
+        else if (Set.class.isAssignableFrom(c))
+            mapped = Set.class;
         else if (Vertex.class.isAssignableFrom(c))
             mapped = Vertex.class;
         else if (Edge.class.isAssignableFrom(c))

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fc544cba/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java
index 900eeb8..8298ce7 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java
@@ -32,6 +32,9 @@ import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdSerializer;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -89,6 +92,50 @@ final class JavaUtilSerializersV3d0 {
         }
     }
 
+    final static class SetJacksonSerializer extends StdSerializer<Set> {
+        public SetJacksonSerializer() {
+            super(Set.class);
+        }
+
+        @Override
+        public void serialize(final Set set, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
+                throws IOException {
+            for(Object o : set) {
+                jsonGenerator.writeObject(o);
+            }
+        }
+
+        @Override
+        public void serializeWithType(final Set set, final JsonGenerator jsonGenerator,
+                                      final SerializerProvider serializerProvider, final TypeSerializer typeSerializer) throws IOException {
+            typeSerializer.writeTypePrefixForArray(set, jsonGenerator);
+            serialize(set, jsonGenerator, serializerProvider);
+            typeSerializer.writeTypeSuffixForArray(set, jsonGenerator);
+        }
+    }
+
+    final static class ListJacksonSerializer extends StdSerializer<List> {
+        public ListJacksonSerializer() {
+            super(List.class);
+        }
+
+        @Override
+        public void serialize(final List list, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
+                throws IOException {
+            for(Object o : list) {
+                jsonGenerator.writeObject(o);
+            }
+        }
+
+        @Override
+        public void serializeWithType(final List list, final JsonGenerator jsonGenerator,
+                                      final SerializerProvider serializerProvider, final TypeSerializer typeSerializer) throws IOException {
+            typeSerializer.writeTypePrefixForArray(list, jsonGenerator);
+            serialize(list, jsonGenerator, serializerProvider);
+            typeSerializer.writeTypeSuffixForArray(list, jsonGenerator);
+        }
+    }
+
     ////////////////////////////// DESERIALIZERS /////////////////////////////////
 
 
@@ -133,4 +180,40 @@ final class JavaUtilSerializersV3d0 {
             return m.entrySet().iterator().next();
         }
     }
+
+    static class SetJacksonDeserializer extends StdDeserializer<Set> {
+
+        protected SetJacksonDeserializer() {
+            super(Set.class);
+        }
+
+        @Override
+        public Set deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            final Set<Object> s = new LinkedHashSet<>();
+
+            while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
+                s.add(deserializationContext.readValue(jsonParser, Object.class));
+            }
+
+            return s;
+        }
+    }
+
+    static class ListJacksonDeserializer extends StdDeserializer<List> {
+
+        protected ListJacksonDeserializer() {
+            super(List.class);
+        }
+
+        @Override
+        public List deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            final List<Object> s = new LinkedList<>();
+
+            while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
+                s.add(deserializationContext.readValue(jsonParser, Object.class));
+            }
+
+            return s;
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fc544cba/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java
index b65f5c7..a375e3b 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java
@@ -42,10 +42,15 @@ import java.time.Year;
 import java.time.YearMonth;
 import java.time.ZoneOffset;
 import java.time.ZonedDateTime;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import static org.hamcrest.CoreMatchers.any;
 import static org.hamcrest.Matchers.either;
@@ -83,7 +88,7 @@ public class GraphSONMapperEmbeddedTypeTest extends AbstractGraphSONTest {
     public void shouldHandleMap() throws Exception {
         assumeThat(version, startsWith("v3"));
 
-        final Map<Object,Object> o = new HashMap<>();
+        final Map<Object,Object> o = new LinkedHashMap<>();
         o.put("string key", "string value");
         o.put(1, 1);
         o.put(1L, 1L);
@@ -95,6 +100,41 @@ public class GraphSONMapperEmbeddedTypeTest extends AbstractGraphSONTest {
     }
 
     @Test
+    public void shouldHandleList() throws Exception {
+        assumeThat(version, startsWith("v3"));
+
+        final List<Object> o = new ArrayList<>();
+        o.add("test");
+        o.add(1);
+        o.add(1);
+        o.add(1L);
+        o.add(1L);
+
+        final List<Object> l = Arrays.asList("test", 1, 5L);
+        o.add(l);
+
+        assertEquals(o, serializeDeserialize(mapper, o, List.class));
+    }
+
+    @Test
+    public void shouldHandleSet() throws Exception {
+        assumeThat(version, startsWith("v3"));
+
+        final Set<Object> o = new LinkedHashSet<>();
+        o.add("test");
+        o.add(1);
+        o.add(1);
+        o.add(1L);
+        o.add(1L);
+
+        final List<Object> l = Arrays.asList("test", 1, 5L);
+        o.add(l);
+
+        assertEquals(o, serializeDeserialize(mapper, o, Set.class));
+
+    }
+
+    @Test
     public void shouldHandleBiFunctionLambda() throws Exception {
         assumeThat(version, either(startsWith("v2")).or(startsWith("v3")));
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fc544cba/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
index bcce801..7100720 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
@@ -33,6 +33,7 @@ import org.apache.tinkerpop.gremlin.driver.Cluster;
 import org.apache.tinkerpop.gremlin.driver.Channelizer;
 import org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer;
 import org.apache.tinkerpop.gremlin.server.channel.NioChannelizer;
+import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens;
 import org.apache.tinkerpop.shaded.jackson.databind.JsonNode;
 import org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper;
 import org.apache.tinkerpop.gremlin.server.auth.AllowAllAuthenticator;
@@ -302,7 +303,7 @@ public class GremlinServerAuditLogIntegrateTest extends AbstractGremlinServerInt
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(0, node.get("result").get("data").get(0).intValue());
+            assertEquals(0, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).intValue());
         }
 
         final List<LoggingEvent> log = recordingAppender.getEvents();

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fc544cba/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
index 643657f..800b82f 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
@@ -44,7 +44,6 @@ import java.time.Instant;
 import java.util.Base64;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 import static org.hamcrest.MatcherAssert.assertThat;
@@ -268,7 +267,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(0, node.get("result").get("data").get(0).intValue());
+            assertEquals(0, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).intValue());
         }
     }
 
@@ -285,7 +284,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(0, node.get("result").get("data").get(0).intValue());
+            assertEquals(0, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).intValue());
         }
     }
 
@@ -302,7 +301,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(0, node.get("result").get("data").get(0).intValue());
+            assertEquals(0, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).intValue());
         }
     }
 
@@ -320,7 +319,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(0, node.get("result").get("data").get(0).intValue());
+            assertEquals(0, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).intValue());
         }
     }
 
@@ -334,7 +333,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(20, node.get("result").get("data").get(0).get("@value").intValue());
+            assertEquals(20, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).intValue());
         }
     }
 
@@ -348,7 +347,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(6, node.get("result").get("data").size());
+            assertEquals(6, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).size());
         }
     }
 
@@ -363,7 +362,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(6, node.get("result").get("data").size());
+            assertEquals(6, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).size());
         }
 
         final CloseableHttpClient httpclient = HttpClients.createDefault();
@@ -374,7 +373,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(6, node.get("result").get("data").size());
+            assertEquals(6, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).size());
         }
     }
 
@@ -402,7 +401,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals("stephen", node.get("result").get("data").get(0).get(GraphSONTokens.VALUEPROP).get("properties").get("name").get(0).get(GraphSONTokens.VALUEPROP).get(GraphSONTokens.VALUE).asText());
+            assertEquals("stephen", node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).get("properties").get("name").get(0).get(GraphSONTokens.VALUEPROP).get(GraphSONTokens.VALUE).asText());
         }
     }
 
@@ -416,7 +415,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(20, node.get("result").get("data").get(0).get("@value").intValue());
+            assertEquals(20, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).intValue());
         }
     }
 
@@ -441,7 +440,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(0, node.get("result").get("data").get(0).asInt());
+            assertEquals(0, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).asInt());
         }
     }
 
@@ -468,7 +467,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(0, node.get("result").get("data").get(0).intValue());
+            assertEquals(0, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).intValue());
         }
     }
 
@@ -486,7 +485,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(Instant.MAX, Instant.parse(node.get("result").get("data").get(0).get("@value").asText()));
+            assertEquals(Instant.MAX, Instant.parse(node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).asText()));
         }
     }
 
@@ -504,7 +503,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(1, node.get("result").get("data").get(0).get("@value").intValue());
+            assertEquals(1, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).intValue());
         }
 
         final HttpGet httpget = new HttpGet(TestClientFactory.createURLString("?gremlin=g.V().count()"));
@@ -518,7 +517,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
                 assertEquals("application/json", response.getEntity().getContentType().getValue());
                 final String json = EntityUtils.toString(response.getEntity());
                 final JsonNode node = mapper.readTree(json);
-                assertEquals(1, node.get("result").get("data").get(0).get("@value").intValue());
+                assertEquals(1, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).intValue());
             }
         }
     }
@@ -538,7 +537,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(1, node.get("result").get("data").size());
+            assertEquals(1, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).size());
         }
 
         final CloseableHttpClient httpclient = HttpClients.createDefault();
@@ -551,7 +550,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(1, node.get("result").get("data").size());
+            assertEquals(1, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).size());
         }
     }
 
@@ -567,7 +566,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(6, node.get("result").get("data").size());
+            assertEquals(6, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).size());
         }
     }
 
@@ -584,10 +583,10 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode resultJson = mapper.readTree(json);
             final JsonNode data = resultJson.get("result").get("data");
-            assertEquals(1, data.size());
+            assertEquals(1, data.get(GraphSONTokens.VALUEPROP).size());
 
-            assertEquals(6, data.get(0).get(GraphSONTokens.VERTICES).get(1).size());
-            assertEquals(6, data.get(0).get(GraphSONTokens.EDGES).get(1).size());
+            assertEquals(6, data.get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VERTICES).get(1).size());
+            assertEquals(6, data.get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.EDGES).get(1).size());
         }
     }
 
@@ -604,7 +603,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(6, node.get("result").get("data").size());
+            assertEquals(6, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).size());
         }
 
         final CloseableHttpClient httpclient = HttpClients.createDefault();
@@ -617,7 +616,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(6, node.get("result").get("data").size());
+            assertEquals(6, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).size());
         }
     }
 
@@ -633,7 +632,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(20, node.get("result").get("data").get(0).get("@value").intValue());
+            assertEquals(20, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).intValue());
         }
     }
 
@@ -649,7 +648,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(10, node.get("result").get("data").get(0).get("@value").intValue());
+            assertEquals(10, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).intValue());
         }
     }
 
@@ -665,7 +664,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(10.5d, node.get("result").get("data").get(0).get("@value").doubleValue(), 0.0001);
+            assertEquals(10.5d, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).doubleValue(), 0.0001);
         }
     }
 
@@ -681,7 +680,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals("10", node.get("result").get("data").get(0).textValue());
+            assertEquals("10", node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).textValue());
         }
     }
 
@@ -697,7 +696,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(true, node.get("result").get("data").get(0).booleanValue());
+            assertEquals(true, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).booleanValue());
         }
     }
 
@@ -713,7 +712,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(true, node.get("result").get("data").get(0).isNull());
+            assertEquals(true, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).isNull());
         }
     }
 
@@ -729,10 +728,10 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(true, node.get("result").get("data").isArray());
-            assertEquals(1, node.get("result").get("data").get(0).get("@value").intValue());
-            assertEquals(2, node.get("result").get("data").get(1).get("@value").intValue());
-            assertEquals(3, node.get("result").get("data").get(2).get("@value").intValue());
+            assertEquals(true, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).isArray());
+            assertEquals(1, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).intValue());
+            assertEquals(2, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(1).get(GraphSONTokens.VALUEPROP).intValue());
+            assertEquals(3, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(2).get(GraphSONTokens.VALUEPROP).intValue());
         }
     }
 
@@ -748,8 +747,8 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(true, node.get("result").get("data").get(0).isObject());
-            assertEquals(1, node.get("result").get("data").get(0).get("@value").get(1).get("@value").asInt());
+            assertEquals("g:Entry", node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get("@type").asText());
+            assertEquals(1, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).get(1).get(GraphSONTokens.VALUEPROP).asInt());
         }
     }
 
@@ -803,7 +802,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(0, node.get("result").get("data").get(0).asInt());
+            assertEquals(0, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).asInt());
         }
     }
 
@@ -820,7 +819,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(0, node.get("result").get("data").get(0).asInt());
+            assertEquals(0, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).asInt());
         }
     }
 
@@ -882,7 +881,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals(0, node.get("result").get("data").get(0).asInt());
+            assertEquals(0, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).asInt());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fc544cba/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/metrics-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/metrics-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/metrics-v3d0.json
index b4f86cd..f6e678b 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/metrics-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/metrics-v3d0.json
@@ -20,30 +20,33 @@
         "@type" : "g:Double",
         "@value" : 25.0
       } ]
-    }, "id", "7.0.0()", "metrics", [ {
-      "@type" : "g:Metrics",
-      "@value" : {
-        "@type" : "g:Map",
-        "@value" : [ "dur", {
-          "@type" : "g:Double",
-          "@value" : 100.0
-        }, "counts", {
+    }, "id", "7.0.0()", "metrics", {
+      "@type" : "g:List",
+      "@value" : [ {
+        "@type" : "g:Metrics",
+        "@value" : {
           "@type" : "g:Map",
-          "@value" : [ "traverserCount", {
-            "@type" : "g:Int64",
-            "@value" : 7
-          }, "elementCount", {
-            "@type" : "g:Int64",
-            "@value" : 7
-          } ]
-        }, "name", "VertexStep(OUT,vertex)", "annotations", {
-          "@type" : "g:Map",
-          "@value" : [ "percentDur", {
+          "@value" : [ "dur", {
             "@type" : "g:Double",
-            "@value" : 25.0
-          } ]
-        }, "id", "3.0.0()" ]
-      }
-    } ] ]
+            "@value" : 100.0
+          }, "counts", {
+            "@type" : "g:Map",
+            "@value" : [ "traverserCount", {
+              "@type" : "g:Int64",
+              "@value" : 7
+            }, "elementCount", {
+              "@type" : "g:Int64",
+              "@value" : 7
+            } ]
+          }, "name", "VertexStep(OUT,vertex)", "annotations", {
+            "@type" : "g:Map",
+            "@value" : [ "percentDur", {
+              "@type" : "g:Double",
+              "@value" : 25.0
+            } ]
+          }, "id", "3.0.0()" ]
+        }
+      } ]
+    } ]
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fc544cba/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/path-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/path-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/path-v3d0.json
index 9ccaa00..216b393 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/path-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/path-v3d0.json
@@ -1,34 +1,49 @@
 {
   "@type" : "g:Path",
   "@value" : {
-    "labels" : [ [ ], [ ], [ ] ],
-    "objects" : [ {
-      "@type" : "g:Vertex",
-      "@value" : {
-        "id" : {
-          "@type" : "g:Int32",
-          "@value" : 1
-        },
-        "label" : "person"
-      }
-    }, {
-      "@type" : "g:Vertex",
-      "@value" : {
-        "id" : {
-          "@type" : "g:Int32",
-          "@value" : 10
-        },
-        "label" : "software"
-      }
-    }, {
-      "@type" : "g:Vertex",
-      "@value" : {
-        "id" : {
-          "@type" : "g:Int32",
-          "@value" : 11
-        },
-        "label" : "software"
-      }
-    } ]
+    "labels" : {
+      "@type" : "g:List",
+      "@value" : [ {
+        "@type" : "g:Set",
+        "@value" : [ ]
+      }, {
+        "@type" : "g:Set",
+        "@value" : [ ]
+      }, {
+        "@type" : "g:Set",
+        "@value" : [ ]
+      } ]
+    },
+    "objects" : {
+      "@type" : "g:List",
+      "@value" : [ {
+        "@type" : "g:Vertex",
+        "@value" : {
+          "id" : {
+            "@type" : "g:Int32",
+            "@value" : 1
+          },
+          "label" : "person"
+        }
+      }, {
+        "@type" : "g:Vertex",
+        "@value" : {
+          "id" : {
+            "@type" : "g:Int32",
+            "@value" : 10
+          },
+          "label" : "software"
+        }
+      }, {
+        "@type" : "g:Vertex",
+        "@value" : {
+          "id" : {
+            "@type" : "g:Int32",
+            "@value" : 11
+          },
+          "label" : "software"
+        }
+      } ]
+    }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fc544cba/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/standardresult-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/standardresult-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/standardresult-v3d0.json
index 0be6d51..dfca400 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/standardresult-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/standardresult-v3d0.json
@@ -9,106 +9,109 @@
     }
   },
   "result" : {
-    "data" : [ {
-      "@type" : "g:Vertex",
-      "@value" : {
-        "id" : {
-          "@type" : "g:Int32",
-          "@value" : 1
-        },
-        "label" : "person",
-        "properties" : {
-          "name" : [ {
-            "@type" : "g:VertexProperty",
-            "@value" : {
-              "id" : {
-                "@type" : "g:Int64",
-                "@value" : 0
-              },
-              "value" : "marko",
-              "label" : "name"
-            }
-          } ],
-          "location" : [ {
-            "@type" : "g:VertexProperty",
-            "@value" : {
-              "id" : {
-                "@type" : "g:Int64",
-                "@value" : 6
-              },
-              "value" : "san diego",
-              "label" : "location",
-              "properties" : {
-                "startTime" : {
-                  "@type" : "g:Int32",
-                  "@value" : 1997
+    "data" : {
+      "@type" : "g:List",
+      "@value" : [ {
+        "@type" : "g:Vertex",
+        "@value" : {
+          "id" : {
+            "@type" : "g:Int32",
+            "@value" : 1
+          },
+          "label" : "person",
+          "properties" : {
+            "name" : [ {
+              "@type" : "g:VertexProperty",
+              "@value" : {
+                "id" : {
+                  "@type" : "g:Int64",
+                  "@value" : 0
                 },
-                "endTime" : {
-                  "@type" : "g:Int32",
-                  "@value" : 2001
+                "value" : "marko",
+                "label" : "name"
+              }
+            } ],
+            "location" : [ {
+              "@type" : "g:VertexProperty",
+              "@value" : {
+                "id" : {
+                  "@type" : "g:Int64",
+                  "@value" : 6
+                },
+                "value" : "san diego",
+                "label" : "location",
+                "properties" : {
+                  "startTime" : {
+                    "@type" : "g:Int32",
+                    "@value" : 1997
+                  },
+                  "endTime" : {
+                    "@type" : "g:Int32",
+                    "@value" : 2001
+                  }
                 }
               }
-            }
-          }, {
-            "@type" : "g:VertexProperty",
-            "@value" : {
-              "id" : {
-                "@type" : "g:Int64",
-                "@value" : 7
-              },
-              "value" : "santa cruz",
-              "label" : "location",
-              "properties" : {
-                "startTime" : {
-                  "@type" : "g:Int32",
-                  "@value" : 2001
+            }, {
+              "@type" : "g:VertexProperty",
+              "@value" : {
+                "id" : {
+                  "@type" : "g:Int64",
+                  "@value" : 7
                 },
-                "endTime" : {
-                  "@type" : "g:Int32",
-                  "@value" : 2004
+                "value" : "santa cruz",
+                "label" : "location",
+                "properties" : {
+                  "startTime" : {
+                    "@type" : "g:Int32",
+                    "@value" : 2001
+                  },
+                  "endTime" : {
+                    "@type" : "g:Int32",
+                    "@value" : 2004
+                  }
                 }
               }
-            }
-          }, {
-            "@type" : "g:VertexProperty",
-            "@value" : {
-              "id" : {
-                "@type" : "g:Int64",
-                "@value" : 8
-              },
-              "value" : "brussels",
-              "label" : "location",
-              "properties" : {
-                "startTime" : {
-                  "@type" : "g:Int32",
-                  "@value" : 2004
+            }, {
+              "@type" : "g:VertexProperty",
+              "@value" : {
+                "id" : {
+                  "@type" : "g:Int64",
+                  "@value" : 8
                 },
-                "endTime" : {
-                  "@type" : "g:Int32",
-                  "@value" : 2005
+                "value" : "brussels",
+                "label" : "location",
+                "properties" : {
+                  "startTime" : {
+                    "@type" : "g:Int32",
+                    "@value" : 2004
+                  },
+                  "endTime" : {
+                    "@type" : "g:Int32",
+                    "@value" : 2005
+                  }
                 }
               }
-            }
-          }, {
-            "@type" : "g:VertexProperty",
-            "@value" : {
-              "id" : {
-                "@type" : "g:Int64",
-                "@value" : 9
-              },
-              "value" : "santa fe",
-              "label" : "location",
-              "properties" : {
-                "startTime" : {
-                  "@type" : "g:Int32",
-                  "@value" : 2005
+            }, {
+              "@type" : "g:VertexProperty",
+              "@value" : {
+                "id" : {
+                  "@type" : "g:Int64",
+                  "@value" : 9
+                },
+                "value" : "santa fe",
+                "label" : "location",
+                "properties" : {
+                  "startTime" : {
+                    "@type" : "g:Int32",
+                    "@value" : 2005
+                  }
                 }
               }
-            }
-          } ]
+            } ]
+          }
         }
-      }
-    } ],
+      } ]
+    },
     "meta" : {
       "@type" : "g:Map",
       "@value" : [ ]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fc544cba/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/traversalmetrics-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/traversalmetrics-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/traversalmetrics-v3d0.json
index 8e7effd..46f7636 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/traversalmetrics-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/traversalmetrics-v3d0.json
@@ -5,102 +5,105 @@
     "@value" : [ "dur", {
       "@type" : "g:Double",
       "@value" : 0.004
-    }, "metrics", [ {
-      "@type" : "g:Metrics",
-      "@value" : {
-        "@type" : "g:Map",
-        "@value" : [ "dur", {
-          "@type" : "g:Double",
-          "@value" : 100.0
-        }, "counts", {
+    }, "metrics", {
+      "@type" : "g:List",
+      "@value" : [ {
+        "@type" : "g:Metrics",
+        "@value" : {
           "@type" : "g:Map",
-          "@value" : [ "traverserCount", {
-            "@type" : "g:Int64",
-            "@value" : 4
-          }, "elementCount", {
-            "@type" : "g:Int64",
-            "@value" : 4
-          } ]
-        }, "name", "TinkerGraphStep(vertex,[~label.eq(person)])", "annotations", {
-          "@type" : "g:Map",
-          "@value" : [ "percentDur", {
+          "@value" : [ "dur", {
             "@type" : "g:Double",
-            "@value" : 25.0
-          } ]
-        }, "id", "7.0.0()" ]
-      }
-    }, {
-      "@type" : "g:Metrics",
-      "@value" : {
-        "@type" : "g:Map",
-        "@value" : [ "dur", {
-          "@type" : "g:Double",
-          "@value" : 100.0
-        }, "counts", {
-          "@type" : "g:Map",
-          "@value" : [ "traverserCount", {
-            "@type" : "g:Int64",
-            "@value" : 13
-          }, "elementCount", {
-            "@type" : "g:Int64",
-            "@value" : 13
-          } ]
-        }, "name", "VertexStep(OUT,vertex)", "annotations", {
+            "@value" : 100.0
+          }, "counts", {
+            "@type" : "g:Map",
+            "@value" : [ "traverserCount", {
+              "@type" : "g:Int64",
+              "@value" : 4
+            }, "elementCount", {
+              "@type" : "g:Int64",
+              "@value" : 4
+            } ]
+          }, "name", "TinkerGraphStep(vertex,[~label.eq(person)])", "annotations", {
+            "@type" : "g:Map",
+            "@value" : [ "percentDur", {
+              "@type" : "g:Double",
+              "@value" : 25.0
+            } ]
+          }, "id", "7.0.0()" ]
+        }
+      }, {
+        "@type" : "g:Metrics",
+        "@value" : {
           "@type" : "g:Map",
-          "@value" : [ "percentDur", {
+          "@value" : [ "dur", {
             "@type" : "g:Double",
-            "@value" : 25.0
-          } ]
-        }, "id", "2.0.0()" ]
-      }
-    }, {
-      "@type" : "g:Metrics",
-      "@value" : {
-        "@type" : "g:Map",
-        "@value" : [ "dur", {
-          "@type" : "g:Double",
-          "@value" : 100.0
-        }, "counts", {
+            "@value" : 100.0
+          }, "counts", {
+            "@type" : "g:Map",
+            "@value" : [ "traverserCount", {
+              "@type" : "g:Int64",
+              "@value" : 13
+            }, "elementCount", {
+              "@type" : "g:Int64",
+              "@value" : 13
+            } ]
+          }, "name", "VertexStep(OUT,vertex)", "annotations", {
+            "@type" : "g:Map",
+            "@value" : [ "percentDur", {
+              "@type" : "g:Double",
+              "@value" : 25.0
+            } ]
+          }, "id", "2.0.0()" ]
+        }
+      }, {
+        "@type" : "g:Metrics",
+        "@value" : {
           "@type" : "g:Map",
-          "@value" : [ "traverserCount", {
-            "@type" : "g:Int64",
-            "@value" : 7
-          }, "elementCount", {
-            "@type" : "g:Int64",
-            "@value" : 7
-          } ]
-        }, "name", "VertexStep(OUT,vertex)", "annotations", {
-          "@type" : "g:Map",
-          "@value" : [ "percentDur", {
+          "@value" : [ "dur", {
             "@type" : "g:Double",
-            "@value" : 25.0
-          } ]
-        }, "id", "3.0.0()" ]
-      }
-    }, {
-      "@type" : "g:Metrics",
-      "@value" : {
-        "@type" : "g:Map",
-        "@value" : [ "dur", {
-          "@type" : "g:Double",
-          "@value" : 100.0
-        }, "counts", {
-          "@type" : "g:Map",
-          "@value" : [ "traverserCount", {
-            "@type" : "g:Int64",
-            "@value" : 1
-          }, "elementCount", {
-            "@type" : "g:Int64",
-            "@value" : 1
-          } ]
-        }, "name", "TreeStep", "annotations", {
+            "@value" : 100.0
+          }, "counts", {
+            "@type" : "g:Map",
+            "@value" : [ "traverserCount", {
+              "@type" : "g:Int64",
+              "@value" : 7
+            }, "elementCount", {
+              "@type" : "g:Int64",
+              "@value" : 7
+            } ]
+          }, "name", "VertexStep(OUT,vertex)", "annotations", {
+            "@type" : "g:Map",
+            "@value" : [ "percentDur", {
+              "@type" : "g:Double",
+              "@value" : 25.0
+            } ]
+          }, "id", "3.0.0()" ]
+        }
+      }, {
+        "@type" : "g:Metrics",
+        "@value" : {
           "@type" : "g:Map",
-          "@value" : [ "percentDur", {
+          "@value" : [ "dur", {
             "@type" : "g:Double",
-            "@value" : 25.0
-          } ]
-        }, "id", "4.0.0()" ]
-      }
-    } ] ]
+            "@value" : 100.0
+          }, "counts", {
+            "@type" : "g:Map",
+            "@value" : [ "traverserCount", {
+              "@type" : "g:Int64",
+              "@value" : 1
+            }, "elementCount", {
+              "@type" : "g:Int64",
+              "@value" : 1
+            } ]
+          }, "name", "TreeStep", "annotations", {
+            "@type" : "g:Map",
+            "@value" : [ "percentDur", {
+              "@type" : "g:Double",
+              "@value" : 25.0
+            } ]
+          }, "id", "4.0.0()" ]
+        }
+      } ]
+    } ]
   }
 }
\ No newline at end of file


[09/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-1427
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
----------------------------------------------------------------------


[50/50] [abbrv] tinkerpop git commit: TINKERPOP-1427 Fixed a bad variable naming after a rebase

Posted by sp...@apache.org.
TINKERPOP-1427 Fixed a bad variable naming after a rebase


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

Branch: refs/heads/TINKERPOP-1427
Commit: b738211f402ebee08d26da41ac7138671698109c
Parents: 1225bd0
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jul 10 17:25:07 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 17:25:07 2017 -0400

----------------------------------------------------------------------
 .../org/apache/tinkerpop/gremlin/structure/io/IoCustomTest.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b738211f/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 705874d..f5733d6 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
@@ -70,8 +70,8 @@ public class IoCustomTest extends AbstractGremlinTest {
                         (Function<Graph, GraphReader>) g -> g.io(IoCore.graphson()).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().addCustomModule(moduleV2d0).typeInfo(TypeInfo.PARTIAL_TYPES).create()).create(),
                         (Function<Graph, GraphWriter>) g -> g.io(IoCore.graphson()).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().addCustomModule(moduleV2d0).typeInfo(TypeInfo.PARTIAL_TYPES).create()).create()},
                 {"graphson-v3", true,
-                        (Function<Graph, GraphReader>) g -> g.io(IoCore.graphson()).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().addCustomModule(moduleV3d0).create()).create(),
-                        (Function<Graph, GraphWriter>) g -> g.io(IoCore.graphson()).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().addCustomModule(moduleV3d0).create()).create()},
+                        (Function<Graph, GraphReader>) g -> g.io(IoCore.graphson()).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().addCustomModule(modulev3d0).create()).create(),
+                        (Function<Graph, GraphWriter>) g -> g.io(IoCore.graphson()).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().addCustomModule(modulev3d0).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()},


[22/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-1427
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) {


[05/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-1427
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`


[16/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-1427
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) {


[20/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-1427
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(+)
----------------------------------------------------------------------



[32/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-1427
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: 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-1427
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;
 


[10/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-1427
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
----------------------------------------------------------------------


[29/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-1427
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() {
     }


[06/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-1427
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.
 


[03/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-1427
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(-)
----------------------------------------------------------------------



[27/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-1427
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


[28/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-1427
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());
+        }
     }
 
 


[45/50] [abbrv] tinkerpop git commit: GraphSONRecordReader/Writer can now be configured to use either GraphSON V2 or V3. Added a test case to verfify proper behavior of parser from GraphSON V3 on HDFS.

Posted by sp...@apache.org.
GraphSONRecordReader/Writer can now be configured to use either GraphSON V2 or V3. Added a test case to verfify proper behavior of parser from GraphSON V3 on HDFS.


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

Branch: refs/heads/TINKERPOP-1427
Commit: 1225bd09024db65ae0432cb347c5316fabbb32ae
Parents: 918c14b
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Jul 10 13:42:44 2017 -0600
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 16:25:38 2017 -0400

----------------------------------------------------------------------
 .../io/graphson/grateful-dead-v3d0-typed.json   | 808 +++++++++++++++++++
 .../tinkerpop/gremlin/hadoop/Constants.java     |   1 +
 .../io/graphson/GraphSONRecordReader.java       |   2 +-
 .../io/graphson/GraphSONRecordWriter.java       |   2 +-
 .../gremlin/hadoop/HadoopGraphProvider.java     |   1 +
 .../structure/io/RecordReaderWriterTest.java    |   4 +
 .../GraphSONRecordReaderWriterTest.java         |  48 --
 .../GraphSONV2d0RecordReaderWriterTest.java     |  54 ++
 .../GraphSONV3d0RecordReaderWriterTest.java     |  53 ++
 9 files changed, 923 insertions(+), 50 deletions(-)
----------------------------------------------------------------------



[07/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-1427
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(+)
----------------------------------------------------------------------



[19/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-1427
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: GraphSONRecordReader/Writer can now be configured to use either GraphSON V2 or V3. Added a test case to verfify proper behavior of parser from GraphSON V3 on HDFS.

Posted by sp...@apache.org.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1225bd09/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/grateful-dead-v3d0-typed.json
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/grateful-dead-v3d0-typed.json b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/grateful-dead-v3d0-typed.json
new file mode 100644
index 0000000..5163a63
--- /dev/null
+++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/grateful-dead-v3d0-typed.json
@@ -0,0 +1,808 @@
+{"id":{"@type":"g:Int32","@value":1},"label":"song","inE":{"followedBy":[{"id":{"@type":"g:Int32","@value":3059},"outV":{"@type":"g:Int32","@value":153},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":276},"outV":{"@type":"g:Int32","@value":5},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3704},"outV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4383},"outV":{"@type":"g:Int32","@value":62},"properties":{"weight":{"@type":"g:Int32","@value":1}}}]},"outE":{"followedBy":[{"id":{"@type":"g:Int32","@value":0},"inV":{"@type":"g:Int32","@value":2},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1},"inV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":2},"inV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@ty
 pe":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3},"inV":{"@type":"g:Int32","@value":5},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4},"inV":{"@type":"g:Int32","@value":6},"properties":{"weight":{"@type":"g:Int32","@value":1}}}],"sungBy":[{"id":{"@type":"g:Int32","@value":7612},"inV":{"@type":"g:Int32","@value":340}}],"writtenBy":[{"id":{"@type":"g:Int32","@value":7611},"inV":{"@type":"g:Int32","@value":527}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"HEY BO DIDDLEY"}],"songType":[{"id":{"@type":"g:Int64","@value":2},"value":"cover"}],"performances":[{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":5}}]}}
+{"id":{"@type":"g:Int32","@value":2},"label":"song","inE":{"followedBy":[{"id":{"@type":"g:Int32","@value":0},"outV":{"@type":"g:Int32","@value":1},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":323},"outV":{"@type":"g:Int32","@value":34},"properties":{"weight":{"@type":"g:Int32","@value":1}}}]},"outE":{"followedBy":[{"id":{"@type":"g:Int32","@value":6190},"inV":{"@type":"g:Int32","@value":123},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6191},"inV":{"@type":"g:Int32","@value":50},"properties":{"weight":{"@type":"g:Int32","@value":1}}}],"sungBy":[{"id":{"@type":"g:Int32","@value":7666},"inV":{"@type":"g:Int32","@value":525}}],"writtenBy":[{"id":{"@type":"g:Int32","@value":7665},"inV":{"@type":"g:Int32","@value":525}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":3},"value":"IM A MAN"}],"songType":[{"id":{"@type":"g:Int64","@value":5},"value":"cover"}],"performances":[{"id":{"@type":"
 g:Int64","@value":4},"value":{"@type":"g:Int32","@value":1}}]}}
+{"id":{"@type":"g:Int32","@value":3},"label":"song","inE":{"followedBy":[{"id":{"@type":"g:Int32","@value":1},"outV":{"@type":"g:Int32","@value":1},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":2051},"outV":{"@type":"g:Int32","@value":92},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":1412},"outV":{"@type":"g:Int32","@value":83},"properties":{"weight":{"@type":"g:Int32","@value":6}}},{"id":{"@type":"g:Int32","@value":6669},"outV":{"@type":"g:Int32","@value":12},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":526},"outV":{"@type":"g:Int32","@value":120},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":910},"outV":{"@type":"g:Int32","@value":91},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":1166},"outV":{"@type":"g:Int32","@value":26},"properties":{"weight":{"@type":"g:Int32
 ","@value":4}}},{"id":{"@type":"g:Int32","@value":6286},"outV":{"@type":"g:Int32","@value":49},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":273},"outV":{"@type":"g:Int32","@value":5},"properties":{"weight":{"@type":"g:Int32","@value":40}}},{"id":{"@type":"g:Int32","@value":2194},"outV":{"@type":"g:Int32","@value":235},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1684},"outV":{"@type":"g:Int32","@value":124},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1941},"outV":{"@type":"g:Int32","@value":148},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":3221},"outV":{"@type":"g:Int32","@value":63},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2712},"outV":{"@type":"g:Int32","@value":13},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":
 6425},"outV":{"@type":"g:Int32","@value":134},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5787},"outV":{"@type":"g:Int32","@value":76},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5148},"outV":{"@type":"g:Int32","@value":125},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":6692},"outV":{"@type":"g:Int32","@value":141},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":6310},"outV":{"@type":"g:Int32","@value":123},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6448},"outV":{"@type":"g:Int32","@value":187},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":2225},"outV":{"@type":"g:Int32","@value":226},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5042},"outV":{"@type":"g:Int32","@value":209},
 "properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4789},"outV":{"@type":"g:Int32","@value":114},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":1464},"outV":{"@type":"g:Int32","@value":81},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2232},"outV":{"@type":"g:Int32","@value":215},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4665},"outV":{"@type":"g:Int32","@value":154},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2235},"outV":{"@type":"g:Int32","@value":29},"properties":{"weight":{"@type":"g:Int32","@value":163}}},{"id":{"@type":"g:Int32","@value":6208},"outV":{"@type":"g:Int32","@value":319},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":706},"outV":{"@type":"g:Int32","@value":206},"properties":{"weight":{"@type":"g:Int32","@va
 lue":2}}},{"id":{"@type":"g:Int32","@value":835},"outV":{"@type":"g:Int32","@value":171},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5188},"outV":{"@type":"g:Int32","@value":99},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1862},"outV":{"@type":"g:Int32","@value":94},"properties":{"weight":{"@type":"g:Int32","@value":10}}},{"id":{"@type":"g:Int32","@value":1735},"outV":{"@type":"g:Int32","@value":82},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6343},"outV":{"@type":"g:Int32","@value":21},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4937},"outV":{"@type":"g:Int32","@value":277},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3276},"outV":{"@type":"g:Int32","@value":160},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3149}
 ,"outV":{"@type":"g:Int32","@value":104},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1358},"outV":{"@type":"g:Int32","@value":130},"properties":{"weight":{"@type":"g:Int32","@value":18}}},{"id":{"@type":"g:Int32","@value":4304},"outV":{"@type":"g:Int32","@value":110},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1105},"outV":{"@type":"g:Int32","@value":59},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":722},"outV":{"@type":"g:Int32","@value":80},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4182},"outV":{"@type":"g:Int32","@value":54},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1499},"outV":{"@type":"g:Int32","@value":164},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":2397},"outV":{"@type":"g:Int32","@value":179},"proper
 ties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":351},"outV":{"@type":"g:Int32","@value":178},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6623},"outV":{"@type":"g:Int32","@value":127},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":2018},"outV":{"@type":"g:Int32","@value":149},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":7011},"outV":{"@type":"g:Int32","@value":89},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5348},"outV":{"@type":"g:Int32","@value":165},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2278},"outV":{"@type":"g:Int32","@value":25},"properties":{"weight":{"@type":"g:Int32","@value":7}}},{"id":{"@type":"g:Int32","@value":1255},"outV":{"@type":"g:Int32","@value":27},"properties":{"weight":{"@type":"g:Int32","@value":2}}},
 {"id":{"@type":"g:Int32","@value":3048},"outV":{"@type":"g:Int32","@value":153},"properties":{"weight":{"@type":"g:Int32","@value":13}}},{"id":{"@type":"g:Int32","@value":5867},"outV":{"@type":"g:Int32","@value":96},"properties":{"weight":{"@type":"g:Int32","@value":116}}},{"id":{"@type":"g:Int32","@value":364},"outV":{"@type":"g:Int32","@value":74},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":492},"outV":{"@type":"g:Int32","@value":98},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3948},"outV":{"@type":"g:Int32","@value":138},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":4335},"outV":{"@type":"g:Int32","@value":62},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3312},"outV":{"@type":"g:Int32","@value":252},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5745},"outV":{
 "@type":"g:Int32","@value":129},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4596},"outV":{"@type":"g:Int32","@value":85},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":5367},"outV":{"@type":"g:Int32","@value":132},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":633},"outV":{"@type":"g:Int32","@value":23},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":891},"outV":{"@type":"g:Int32","@value":140},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5375},"outV":{"@type":"g:Int32","@value":69},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6143},"outV":{"@type":"g:Int32","@value":289},"properties":{"weight":{"@type":"g:Int32","@value":3}}}]},"outE":{"followedBy":[{"id":{"@type":"g:Int32","@value":3712},"inV":{"@type":"g:Int32","@value":
 27},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3713},"inV":{"@type":"g:Int32","@value":110},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":3714},"inV":{"@type":"g:Int32","@value":215},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":3715},"inV":{"@type":"g:Int32","@value":127},"properties":{"weight":{"@type":"g:Int32","@value":10}}},{"id":{"@type":"g:Int32","@value":3716},"inV":{"@type":"g:Int32","@value":83},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":3717},"inV":{"@type":"g:Int32","@value":103},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3718},"inV":{"@type":"g:Int32","@value":68},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3719},"inV":{"@type":"g:Int32","@value":134},"properties":{"weight":{"@type":"g:Int32","@value
 ":2}}},{"id":{"@type":"g:Int32","@value":3720},"inV":{"@type":"g:Int32","@value":25},"properties":{"weight":{"@type":"g:Int32","@value":10}}},{"id":{"@type":"g:Int32","@value":3721},"inV":{"@type":"g:Int32","@value":125},"properties":{"weight":{"@type":"g:Int32","@value":54}}},{"id":{"@type":"g:Int32","@value":3722},"inV":{"@type":"g:Int32","@value":130},"properties":{"weight":{"@type":"g:Int32","@value":26}}},{"id":{"@type":"g:Int32","@value":3723},"inV":{"@type":"g:Int32","@value":141},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3724},"inV":{"@type":"g:Int32","@value":145},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3725},"inV":{"@type":"g:Int32","@value":319},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":3726},"inV":{"@type":"g:Int32","@value":12},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3727},"inV
 ":{"@type":"g:Int32","@value":160},"properties":{"weight":{"@type":"g:Int32","@value":37}}},{"id":{"@type":"g:Int32","@value":3728},"inV":{"@type":"g:Int32","@value":70},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3729},"inV":{"@type":"g:Int32","@value":123},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3730},"inV":{"@type":"g:Int32","@value":129},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3731},"inV":{"@type":"g:Int32","@value":30},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3732},"inV":{"@type":"g:Int32","@value":148},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3733},"inV":{"@type":"g:Int32","@value":211},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":3734},"inV":{"@type":"g:Int32","@value":87},"properties":{"weig
 ht":{"@type":"g:Int32","@value":13}}},{"id":{"@type":"g:Int32","@value":3735},"inV":{"@type":"g:Int32","@value":164},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":3736},"inV":{"@type":"g:Int32","@value":64},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3737},"inV":{"@type":"g:Int32","@value":320},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3738},"inV":{"@type":"g:Int32","@value":61},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":3739},"inV":{"@type":"g:Int32","@value":210},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":3740},"inV":{"@type":"g:Int32","@value":50},"properties":{"weight":{"@type":"g:Int32","@value":7}}},{"id":{"@type":"g:Int32","@value":3741},"inV":{"@type":"g:Int32","@value":128},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g
 :Int32","@value":3742},"inV":{"@type":"g:Int32","@value":315},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3743},"inV":{"@type":"g:Int32","@value":261},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3744},"inV":{"@type":"g:Int32","@value":213},"properties":{"weight":{"@type":"g:Int32","@value":13}}},{"id":{"@type":"g:Int32","@value":3745},"inV":{"@type":"g:Int32","@value":72},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3746},"inV":{"@type":"g:Int32","@value":38},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":3747},"inV":{"@type":"g:Int32","@value":204},"properties":{"weight":{"@type":"g:Int32","@value":14}}},{"id":{"@type":"g:Int32","@value":3748},"inV":{"@type":"g:Int32","@value":62},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3749},"inV":{"@type":"g:Int32","@val
 ue":150},"properties":{"weight":{"@type":"g:Int32","@value":8}}},{"id":{"@type":"g:Int32","@value":3750},"inV":{"@type":"g:Int32","@value":309},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3751},"inV":{"@type":"g:Int32","@value":131},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3752},"inV":{"@type":"g:Int32","@value":151},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3753},"inV":{"@type":"g:Int32","@value":321},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3754},"inV":{"@type":"g:Int32","@value":90},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3755},"inV":{"@type":"g:Int32","@value":82},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3756},"inV":{"@type":"g:Int32","@value":120},"properties":{"weight":{"@type":"g:Int32","@v
 alue":1}}},{"id":{"@type":"g:Int32","@value":3757},"inV":{"@type":"g:Int32","@value":46},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":3758},"inV":{"@type":"g:Int32","@value":157},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":3759},"inV":{"@type":"g:Int32","@value":59},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3760},"inV":{"@type":"g:Int32","@value":81},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3761},"inV":{"@type":"g:Int32","@value":86},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":3762},"inV":{"@type":"g:Int32","@value":140},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3763},"inV":{"@type":"g:Int32","@value":201},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3764},"inV"
 :{"@type":"g:Int32","@value":214},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3765},"inV":{"@type":"g:Int32","@value":185},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3766},"inV":{"@type":"g:Int32","@value":216},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3767},"inV":{"@type":"g:Int32","@value":217},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3768},"inV":{"@type":"g:Int32","@value":236},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":3769},"inV":{"@type":"g:Int32","@value":193},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3770},"inV":{"@type":"g:Int32","@value":79},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3771},"inV":{"@type":"g:Int32","@value":84},"properties":{"weigh
 t":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3772},"inV":{"@type":"g:Int32","@value":23},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3773},"inV":{"@type":"g:Int32","@value":31},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3774},"inV":{"@type":"g:Int32","@value":240},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3775},"inV":{"@type":"g:Int32","@value":292},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3776},"inV":{"@type":"g:Int32","@value":9},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3777},"inV":{"@type":"g:Int32","@value":259},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3694},"inV":{"@type":"g:Int32","@value":5},"properties":{"weight":{"@type":"g:Int32","@value":57}}},{"id":{"@type":"g:Int
 32","@value":3695},"inV":{"@type":"g:Int32","@value":114},"properties":{"weight":{"@type":"g:Int32","@value":30}}},{"id":{"@type":"g:Int32","@value":3696},"inV":{"@type":"g:Int32","@value":74},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3697},"inV":{"@type":"g:Int32","@value":78},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":3698},"inV":{"@type":"g:Int32","@value":10},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3699},"inV":{"@type":"g:Int32","@value":26},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":3700},"inV":{"@type":"g:Int32","@value":153},"properties":{"weight":{"@type":"g:Int32","@value":7}}},{"id":{"@type":"g:Int32","@value":3701},"inV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":3702},"inV":{"@type":"g:Int32","@value":317}
 ,"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3703},"inV":{"@type":"g:Int32","@value":13},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":3704},"inV":{"@type":"g:Int32","@value":1},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3705},"inV":{"@type":"g:Int32","@value":21},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3706},"inV":{"@type":"g:Int32","@value":57},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3707},"inV":{"@type":"g:Int32","@value":122},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3708},"inV":{"@type":"g:Int32","@value":318},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3709},"inV":{"@type":"g:Int32","@value":94},"properties":{"weight":{"@type":"g:Int32","@value":26}}},
 {"id":{"@type":"g:Int32","@value":3710},"inV":{"@type":"g:Int32","@value":96},"properties":{"weight":{"@type":"g:Int32","@value":7}}},{"id":{"@type":"g:Int32","@value":3711},"inV":{"@type":"g:Int32","@value":124},"properties":{"weight":{"@type":"g:Int32","@value":15}}}],"sungBy":[{"id":{"@type":"g:Int32","@value":7808},"inV":{"@type":"g:Int32","@value":351}}],"writtenBy":[{"id":{"@type":"g:Int32","@value":7807},"inV":{"@type":"g:Int32","@value":671}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":6},"value":"NOT FADE AWAY"}],"songType":[{"id":{"@type":"g:Int64","@value":8},"value":"cover"}],"performances":[{"id":{"@type":"g:Int64","@value":7},"value":{"@type":"g:Int32","@value":531}}]}}
+{"id":{"@type":"g:Int32","@value":4},"label":"song","inE":{"followedBy":[{"id":{"@type":"g:Int32","@value":128},"outV":{"@type":"g:Int32","@value":97},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1664},"outV":{"@type":"g:Int32","@value":267},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2},"outV":{"@type":"g:Int32","@value":1},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":899},"outV":{"@type":"g:Int32","@value":140},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1667},"outV":{"@type":"g:Int32","@value":124},"properties":{"weight":{"@type":"g:Int32","@value":15}}},{"id":{"@type":"g:Int32","@value":4099},"outV":{"@type":"g:Int32","@value":48},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1156},"outV":{"@type":"g:Int32","@value":26},"properties":{"weight":{"@type":"g:In
 t32","@value":16}}},{"id":{"@type":"g:Int32","@value":773},"outV":{"@type":"g:Int32","@value":122},"properties":{"weight":{"@type":"g:Int32","@value":9}}},{"id":{"@type":"g:Int32","@value":6534},"outV":{"@type":"g:Int32","@value":242},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1032},"outV":{"@type":"g:Int32","@value":73},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6664},"outV":{"@type":"g:Int32","@value":12},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":5129},"outV":{"@type":"g:Int32","@value":222},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5387},"outV":{"@type":"g:Int32","@value":69},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5517},"outV":{"@type":"g:Int32","@value":43},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@val
 ue":5006},"outV":{"@type":"g:Int32","@value":30},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":6030},"outV":{"@type":"g:Int32","@value":204},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":2063},"outV":{"@type":"g:Int32","@value":92},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":915},"outV":{"@type":"g:Int32","@value":91},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":6940},"outV":{"@type":"g:Int32","@value":84},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":2464},"outV":{"@type":"g:Int32","@value":68},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5795},"outV":{"@type":"g:Int32","@value":76},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3620},"outV":{"@type":"g:Int32","@value":24},"pr
 operties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4772},"outV":{"@type":"g:Int32","@value":114},"properties":{"weight":{"@type":"g:Int32","@value":25}}},{"id":{"@type":"g:Int32","@value":2982},"outV":{"@type":"g:Int32","@value":14},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":3367},"outV":{"@type":"g:Int32","@value":184},"properties":{"weight":{"@type":"g:Int32","@value":6}}},{"id":{"@type":"g:Int32","@value":2345},"outV":{"@type":"g:Int32","@value":87},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":2861},"outV":{"@type":"g:Int32","@value":101},"properties":{"weight":{"@type":"g:Int32","@value":6}}},{"id":{"@type":"g:Int32","@value":1840},"outV":{"@type":"g:Int32","@value":275},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5425},"outV":{"@type":"g:Int32","@value":102},"properties":{"weight":{"@type":"g:Int32","@value
 ":1}}},{"id":{"@type":"g:Int32","@value":180},"outV":{"@type":"g:Int32","@value":70},"properties":{"weight":{"@type":"g:Int32","@value":46}}},{"id":{"@type":"g:Int32","@value":2613},"outV":{"@type":"g:Int32","@value":158},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5434},"outV":{"@type":"g:Int32","@value":217},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5562},"outV":{"@type":"g:Int32","@value":162},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":1469},"outV":{"@type":"g:Int32","@value":81},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":446},"outV":{"@type":"g:Int32","@value":38},"properties":{"weight":{"@type":"g:Int32","@value":7}}},{"id":{"@type":"g:Int32","@value":2494},"outV":{"@type":"g:Int32","@value":90},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":3266},"ou
 tV":{"@type":"g:Int32","@value":160},"properties":{"weight":{"@type":"g:Int32","@value":10}}},{"id":{"@type":"g:Int32","@value":326},"outV":{"@type":"g:Int32","@value":34},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":583},"outV":{"@type":"g:Int32","@value":120},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":6855},"outV":{"@type":"g:Int32","@value":64},"properties":{"weight":{"@type":"g:Int32","@value":12}}},{"id":{"@type":"g:Int32","@value":73},"outV":{"@type":"g:Int32","@value":46},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":4425},"outV":{"@type":"g:Int32","@value":212},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1613},"outV":{"@type":"g:Int32","@value":210},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4941},"outV":{"@type":"g:Int32","@value":86},"properties":{
 "weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":6350},"outV":{"@type":"g:Int32","@value":21},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3535},"outV":{"@type":"g:Int32","@value":201},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":980},"outV":{"@type":"g:Int32","@value":11},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":1494},"outV":{"@type":"g:Int32","@value":164},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":5206},"outV":{"@type":"g:Int32","@value":99},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5847},"outV":{"@type":"g:Int32","@value":61},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":6490},"outV":{"@type":"g:Int32","@value":187},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"
 @type":"g:Int32","@value":2781},"outV":{"@type":"g:Int32","@value":15},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":5600},"outV":{"@type":"g:Int32","@value":42},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":353},"outV":{"@type":"g:Int32","@value":74},"properties":{"weight":{"@type":"g:Int32","@value":6}}},{"id":{"@type":"g:Int32","@value":5474},"outV":{"@type":"g:Int32","@value":79},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1891},"outV":{"@type":"g:Int32","@value":103},"properties":{"weight":{"@type":"g:Int32","@value":19}}},{"id":{"@type":"g:Int32","@value":3811},"outV":{"@type":"g:Int32","@value":88},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5989},"outV":{"@type":"g:Int32","@value":50},"properties":{"weight":{"@type":"g:Int32","@value":12}}},{"id":{"@type":"g:Int32","@value":4327},"outV":{"@type":"g
 :Int32","@value":110},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":2538},"outV":{"@type":"g:Int32","@value":57},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":3050},"outV":{"@type":"g:Int32","@value":153},"properties":{"weight":{"@type":"g:Int32","@value":13}}},{"id":{"@type":"g:Int32","@value":4970},"outV":{"@type":"g:Int32","@value":236},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2283},"outV":{"@type":"g:Int32","@value":25},"properties":{"weight":{"@type":"g:Int32","@value":9}}},{"id":{"@type":"g:Int32","@value":236},"outV":{"@type":"g:Int32","@value":145},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6126},"outV":{"@type":"g:Int32","@value":72},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5232},"outV":{"@type":"g:Int32","@value":214},"properties":{"weight":{"@
 type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4594},"outV":{"@type":"g:Int32","@value":85},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1652},"outV":{"@type":"g:Int32","@value":213},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":4084},"outV":{"@type":"g:Int32","@value":109},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":629},"outV":{"@type":"g:Int32","@value":23},"properties":{"weight":{"@type":"g:Int32","@value":10}}},{"id":{"@type":"g:Int32","@value":3701},"outV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":5621},"outV":{"@type":"g:Int32","@value":22},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":7029},"outV":{"@type":"g:Int32","@value":89},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int
 32","@value":5238},"outV":{"@type":"g:Int32","@value":32},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":2684},"outV":{"@type":"g:Int32","@value":13},"properties":{"weight":{"@type":"g:Int32","@value":9}}},{"id":{"@type":"g:Int32","@value":3325},"outV":{"@type":"g:Int32","@value":268},"properties":{"weight":{"@type":"g:Int32","@value":1}}}]},"outE":{"followedBy":[{"id":{"@type":"g:Int32","@value":5120},"inV":{"@type":"g:Int32","@value":40},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":5121},"inV":{"@type":"g:Int32","@value":33},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":5122},"inV":{"@type":"g:Int32","@value":79},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5123},"inV":{"@type":"g:Int32","@value":292},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5071},"inV":{"@ty
 pe":"g:Int32","@value":50},"properties":{"weight":{"@type":"g:Int32","@value":9}}},{"id":{"@type":"g:Int32","@value":5072},"inV":{"@type":"g:Int32","@value":12},"properties":{"weight":{"@type":"g:Int32","@value":26}}},{"id":{"@type":"g:Int32","@value":5073},"inV":{"@type":"g:Int32","@value":18},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":5074},"inV":{"@type":"g:Int32","@value":24},"properties":{"weight":{"@type":"g:Int32","@value":9}}},{"id":{"@type":"g:Int32","@value":5075},"inV":{"@type":"g:Int32","@value":23},"properties":{"weight":{"@type":"g:Int32","@value":63}}},{"id":{"@type":"g:Int32","@value":5076},"inV":{"@type":"g:Int32","@value":13},"properties":{"weight":{"@type":"g:Int32","@value":12}}},{"id":{"@type":"g:Int32","@value":5077},"inV":{"@type":"g:Int32","@value":10},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":5078},"inV":{"@type":"g:Int32","@value":11},"properties":{"weight":{"@typ
 e":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":5079},"inV":{"@type":"g:Int32","@value":26},"properties":{"weight":{"@type":"g:Int32","@value":18}}},{"id":{"@type":"g:Int32","@value":5080},"inV":{"@type":"g:Int32","@value":22},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5081},"inV":{"@type":"g:Int32","@value":16},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5082},"inV":{"@type":"g:Int32","@value":49},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5083},"inV":{"@type":"g:Int32","@value":25},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5084},"inV":{"@type":"g:Int32","@value":51},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5085},"inV":{"@type":"g:Int32","@value":15},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@valu
 e":5086},"inV":{"@type":"g:Int32","@value":112},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":5087},"inV":{"@type":"g:Int32","@value":121},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5088},"inV":{"@type":"g:Int32","@value":32},"properties":{"weight":{"@type":"g:Int32","@value":7}}},{"id":{"@type":"g:Int32","@value":5089},"inV":{"@type":"g:Int32","@value":68},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5090},"inV":{"@type":"g:Int32","@value":120},"properties":{"weight":{"@type":"g:Int32","@value":77}}},{"id":{"@type":"g:Int32","@value":5091},"inV":{"@type":"g:Int32","@value":103},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5092},"inV":{"@type":"g:Int32","@value":42},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":5093},"inV":{"@type":"g:Int32","@value":85},"proper
 ties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":5094},"inV":{"@type":"g:Int32","@value":76},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":5095},"inV":{"@type":"g:Int32","@value":181},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5096},"inV":{"@type":"g:Int32","@value":14},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5097},"inV":{"@type":"g:Int32","@value":122},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5098},"inV":{"@type":"g:Int32","@value":153},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":5099},"inV":{"@type":"g:Int32","@value":96},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5100},"inV":{"@type":"g:Int32","@value":82},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{
 "@type":"g:Int32","@value":5101},"inV":{"@type":"g:Int32","@value":110},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5102},"inV":{"@type":"g:Int32","@value":19},"properties":{"weight":{"@type":"g:Int32","@value":6}}},{"id":{"@type":"g:Int32","@value":5103},"inV":{"@type":"g:Int32","@value":129},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5104},"inV":{"@type":"g:Int32","@value":84},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5105},"inV":{"@type":"g:Int32","@value":88},"properties":{"weight":{"@type":"g:Int32","@value":9}}},{"id":{"@type":"g:Int32","@value":5106},"inV":{"@type":"g:Int32","@value":97},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5107},"inV":{"@type":"g:Int32","@value":114},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5108},"inV":{"@type":"g:Int32
 ","@value":30},"properties":{"weight":{"@type":"g:Int32","@value":8}}},{"id":{"@type":"g:Int32","@value":5109},"inV":{"@type":"g:Int32","@value":31},"properties":{"weight":{"@type":"g:Int32","@value":8}}},{"id":{"@type":"g:Int32","@value":5110},"inV":{"@type":"g:Int32","@value":69},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":5111},"inV":{"@type":"g:Int32","@value":127},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5112},"inV":{"@type":"g:Int32","@value":60},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5113},"inV":{"@type":"g:Int32","@value":39},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5114},"inV":{"@type":"g:Int32","@value":21},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5115},"inV":{"@type":"g:Int32","@value":117},"properties":{"weight":{"@type":"g:Int32",
 "@value":1}}},{"id":{"@type":"g:Int32","@value":5116},"inV":{"@type":"g:Int32","@value":78},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5117},"inV":{"@type":"g:Int32","@value":38},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5118},"inV":{"@type":"g:Int32","@value":169},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5119},"inV":{"@type":"g:Int32","@value":118},"properties":{"weight":{"@type":"g:Int32","@value":1}}}],"sungBy":[{"id":{"@type":"g:Int32","@value":7064},"inV":{"@type":"g:Int32","@value":340}}],"writtenBy":[{"id":{"@type":"g:Int32","@value":7063},"inV":{"@type":"g:Int32","@value":339}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":9},"value":"BERTHA"}],"songType":[{"id":{"@type":"g:Int64","@value":11},"value":"original"}],"performances":[{"id":{"@type":"g:Int64","@value":10},"value":{"@type":"g:Int32","@value":394}}]}}
+{"id":{"@type":"g:Int32","@value":5},"label":"song","inE":{"followedBy":[{"id":{"@type":"g:Int32","@value":194},"outV":{"@type":"g:Int32","@value":70},"properties":{"weight":{"@type":"g:Int32","@value":8}}},{"id":{"@type":"g:Int32","@value":962},"outV":{"@type":"g:Int32","@value":67},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":3},"outV":{"@type":"g:Int32","@value":1},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5446},"outV":{"@type":"g:Int32","@value":231},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":6344},"outV":{"@type":"g:Int32","@value":21},"properties":{"weight":{"@type":"g:Int32","@value":6}}},{"id":{"@type":"g:Int32","@value":1738},"outV":{"@type":"g:Int32","@value":82},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6666},"outV":{"@type":"g:Int32","@value":12},"properties":{"weight":{"@type":"g:Int32
 ","@value":1}}},{"id":{"@type":"g:Int32","@value":1867},"outV":{"@type":"g:Int32","@value":94},"properties":{"weight":{"@type":"g:Int32","@value":15}}},{"id":{"@type":"g:Int32","@value":4300},"outV":{"@type":"g:Int32","@value":110},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":847},"outV":{"@type":"g:Int32","@value":171},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2832},"outV":{"@type":"g:Int32","@value":101},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":6032},"outV":{"@type":"g:Int32","@value":115},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1170},"outV":{"@type":"g:Int32","@value":26},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5330},"outV":{"@type":"g:Int32","@value":238},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@valu
 e":1491},"outV":{"@type":"g:Int32","@value":164},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":1429},"outV":{"@type":"g:Int32","@value":83},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":3033},"outV":{"@type":"g:Int32","@value":14},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6298},"outV":{"@type":"g:Int32","@value":49},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1373},"outV":{"@type":"g:Int32","@value":130},"properties":{"weight":{"@type":"g:Int32","@value":11}}},{"id":{"@type":"g:Int32","@value":4447},"outV":{"@type":"g:Int32","@value":113},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5151},"outV":{"@type":"g:Int32","@value":125},"properties":{"weight":{"@type":"g:Int32","@value":6}}},{"id":{"@type":"g:Int32","@value":5343},"outV":{"@type":"g:Int32","@value":165
 },"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":6431},"outV":{"@type":"g:Int32","@value":134},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":1953},"outV":{"@type":"g:Int32","@value":148},"properties":{"weight":{"@type":"g:Int32","@value":10}}},{"id":{"@type":"g:Int32","@value":1634},"outV":{"@type":"g:Int32","@value":210},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2274},"outV":{"@type":"g:Int32","@value":25},"properties":{"weight":{"@type":"g:Int32","@value":8}}},{"id":{"@type":"g:Int32","@value":100},"outV":{"@type":"g:Int32","@value":46},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":933},"outV":{"@type":"g:Int32","@value":91},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2021},"outV":{"@type":"g:Int32","@value":149},"properties":{"weight":{"@type":"g:Int32","@val
 ue":1}}},{"id":{"@type":"g:Int32","@value":6694},"outV":{"@type":"g:Int32","@value":141},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4009},"outV":{"@type":"g:Int32","@value":225},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":682},"outV":{"@type":"g:Int32","@value":219},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3694},"outV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Int32","@value":57}}},{"id":{"@type":"g:Int32","@value":4718},"outV":{"@type":"g:Int32","@value":186},"properties":{"weight":{"@type":"g:Int32","@value":6}}},{"id":{"@type":"g:Int32","@value":3055},"outV":{"@type":"g:Int32","@value":153},"properties":{"weight":{"@type":"g:Int32","@value":9}}},{"id":{"@type":"g:Int32","@value":2480},"outV":{"@type":"g:Int32","@value":68},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2736}
 ,"outV":{"@type":"g:Int32","@value":13},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":5426},"outV":{"@type":"g:Int32","@value":102},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6899},"outV":{"@type":"g:Int32","@value":147},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5879},"outV":{"@type":"g:Int32","@value":96},"properties":{"weight":{"@type":"g:Int32","@value":22}}},{"id":{"@type":"g:Int32","@value":6201},"outV":{"@type":"g:Int32","@value":319},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5370},"outV":{"@type":"g:Int32","@value":132},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":700},"outV":{"@type":"g:Int32","@value":206},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2236},"outV":{"@type":"g:Int32","@value":29},"proper
 ties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":4604},"outV":{"@type":"g:Int32","@value":85},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5759},"outV":{"@type":"g:Int32","@value":129},"properties":{"weight":{"@type":"g:Int32","@value":6}}}]},"outE":{"followedBy":[{"id":{"@type":"g:Int32","@value":273},"inV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Int32","@value":40}}},{"id":{"@type":"g:Int32","@value":274},"inV":{"@type":"g:Int32","@value":26},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":275},"inV":{"@type":"g:Int32","@value":114},"properties":{"weight":{"@type":"g:Int32","@value":40}}},{"id":{"@type":"g:Int32","@value":276},"inV":{"@type":"g:Int32","@value":1},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":277},"inV":{"@type":"g:Int32","@value":74},"properties":{"weight":{"@type":"g:Int32","
 @value":3}}},{"id":{"@type":"g:Int32","@value":278},"inV":{"@type":"g:Int32","@value":122},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":279},"inV":{"@type":"g:Int32","@value":133},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":280},"inV":{"@type":"g:Int32","@value":83},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":281},"inV":{"@type":"g:Int32","@value":153},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":282},"inV":{"@type":"g:Int32","@value":159},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":283},"inV":{"@type":"g:Int32","@value":13},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":284},"inV":{"@type":"g:Int32","@value":25},"properties":{"weight":{"@type":"g:Int32","@value":19}}},{"id":{"@type":"g:Int32","@value":285},"inV":{"@
 type":"g:Int32","@value":96},"properties":{"weight":{"@type":"g:Int32","@value":10}}},{"id":{"@type":"g:Int32","@value":286},"inV":{"@type":"g:Int32","@value":160},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":287},"inV":{"@type":"g:Int32","@value":32},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":288},"inV":{"@type":"g:Int32","@value":120},"properties":{"weight":{"@type":"g:Int32","@value":16}}},{"id":{"@type":"g:Int32","@value":289},"inV":{"@type":"g:Int32","@value":50},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":290},"inV":{"@type":"g:Int32","@value":116},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":291},"inV":{"@type":"g:Int32","@value":127},"properties":{"weight":{"@type":"g:Int32","@value":6}}},{"id":{"@type":"g:Int32","@value":292},"inV":{"@type":"g:Int32","@value":65},"properties":{"weight":{"@type"
 :"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":293},"inV":{"@type":"g:Int32","@value":130},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":294},"inV":{"@type":"g:Int32","@value":125},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":295},"inV":{"@type":"g:Int32","@value":70},"properties":{"weight":{"@type":"g:Int32","@value":13}}},{"id":{"@type":"g:Int32","@value":296},"inV":{"@type":"g:Int32","@value":134},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":297},"inV":{"@type":"g:Int32","@value":161},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":298},"inV":{"@type":"g:Int32","@value":162},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":299},"inV":{"@type":"g:Int32","@value":124},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":
 300},"inV":{"@type":"g:Int32","@value":38},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":301},"inV":{"@type":"g:Int32","@value":29},"properties":{"weight":{"@type":"g:Int32","@value":11}}},{"id":{"@type":"g:Int32","@value":302},"inV":{"@type":"g:Int32","@value":163},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":303},"inV":{"@type":"g:Int32","@value":94},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":304},"inV":{"@type":"g:Int32","@value":85},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":305},"inV":{"@type":"g:Int32","@value":164},"properties":{"weight":{"@type":"g:Int32","@value":6}}},{"id":{"@type":"g:Int32","@value":306},"inV":{"@type":"g:Int32","@value":64},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":307},"inV":{"@type":"g:Int32","@value":150},"properties":{"weig
 ht":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":308},"inV":{"@type":"g:Int32","@value":165},"properties":{"weight":{"@type":"g:Int32","@value":7}}},{"id":{"@type":"g:Int32","@value":309},"inV":{"@type":"g:Int32","@value":92},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":310},"inV":{"@type":"g:Int32","@value":140},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":311},"inV":{"@type":"g:Int32","@value":166},"properties":{"weight":{"@type":"g:Int32","@value":1}}}],"sungBy":[{"id":{"@type":"g:Int32","@value":7582},"inV":{"@type":"g:Int32","@value":340}}],"writtenBy":[{"id":{"@type":"g:Int32","@value":7581},"inV":{"@type":"g:Int32","@value":446}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":12},"value":"GOING DOWN THE ROAD FEELING BAD"}],"songType":[{"id":{"@type":"g:Int64","@value":14},"value":"cover"}],"performances":[{"id":{"@type":"g:Int64","@value":13},"value":{"@t
 ype":"g:Int32","@value":293}}]}}
+{"id":{"@type":"g:Int32","@value":6},"label":"song","inE":{"followedBy":[{"id":{"@type":"g:Int32","@value":4},"outV":{"@type":"g:Int32","@value":1},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2023},"outV":{"@type":"g:Int32","@value":282},"properties":{"weight":{"@type":"g:Int32","@value":1}}}]},"outE":{"followedBy":[{"id":{"@type":"g:Int32","@value":2406},"inV":{"@type":"g:Int32","@value":293},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2407},"inV":{"@type":"g:Int32","@value":96},"properties":{"weight":{"@type":"g:Int32","@value":1}}}],"sungBy":[{"id":{"@type":"g:Int32","@value":7782},"inV":{"@type":"g:Int32","@value":351}}],"writtenBy":[{"id":{"@type":"g:Int32","@value":7781},"inV":{"@type":"g:Int32","@value":527}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":15},"value":"MONA"}],"songType":[{"id":{"@type":"g:Int64","@value":17},"value":"cover"}],"performances":[{"id":{"@type":"
 g:Int64","@value":16},"value":{"@type":"g:Int32","@value":1}}]}}
+{"id":{"@type":"g:Int32","@value":7},"label":"song","inE":{"followedBy":[{"id":{"@type":"g:Int32","@value":2607},"outV":{"@type":"g:Int32","@value":295},"properties":{"weight":{"@type":"g:Int32","@value":1}}}]},"outE":{"followedBy":[{"id":{"@type":"g:Int32","@value":5},"inV":{"@type":"g:Int32","@value":8},"properties":{"weight":{"@type":"g:Int32","@value":1}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":18},"value":"WHERE HAVE THE HEROES GONE"}],"songType":[{"id":{"@type":"g:Int64","@value":20},"value":""}],"performances":[{"id":{"@type":"g:Int64","@value":19},"value":{"@type":"g:Int32","@value":0}}]}}
+{"id":{"@type":"g:Int32","@value":8},"label":"song","inE":{"followedBy":[{"id":{"@type":"g:Int32","@value":4705},"outV":{"@type":"g:Int32","@value":111},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5},"outV":{"@type":"g:Int32","@value":7},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5901},"outV":{"@type":"g:Int32","@value":96},"properties":{"weight":{"@type":"g:Int32","@value":1}}}]},"outE":{"followedBy":[{"id":{"@type":"g:Int32","@value":2976},"inV":{"@type":"g:Int32","@value":302},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2977},"inV":{"@type":"g:Int32","@value":96},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2978},"inV":{"@type":"g:Int32","@value":72},"properties":{"weight":{"@type":"g:Int32","@value":1}}}],"sungBy":[{"id":{"@type":"g:Int32","@value":7814},"inV":{"@type":"g:Int32","@value":351}}],"wr
 ittenBy":[{"id":{"@type":"g:Int32","@value":7813},"inV":{"@type":"g:Int32","@value":674}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":21},"value":"OH BOY"}],"songType":[{"id":{"@type":"g:Int64","@value":23},"value":"cover"}],"performances":[{"id":{"@type":"g:Int64","@value":22},"value":{"@type":"g:Int32","@value":2}}]}}
+{"id":{"@type":"g:Int32","@value":9},"label":"song","inE":{"followedBy":[{"id":{"@type":"g:Int32","@value":3776},"outV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":65},"outV":{"@type":"g:Int32","@value":46},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":1923},"outV":{"@type":"g:Int32","@value":103},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":5956},"outV":{"@type":"g:Int32","@value":50},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3077},"outV":{"@type":"g:Int32","@value":153},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5832},"outV":{"@type":"g:Int32","@value":76},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1161},"outV":{"@type":"g:Int32","@value":26},"properties":{"weight":{"@type":"g:I
 nt32","@value":8}}},{"id":{"@type":"g:Int32","@value":2699},"outV":{"@type":"g:Int32","@value":13},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":6539},"outV":{"@type":"g:Int32","@value":55},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6667},"outV":{"@type":"g:Int32","@value":12},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":2578},"outV":{"@type":"g:Int32","@value":57},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":787},"outV":{"@type":"g:Int32","@value":122},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":3542},"outV":{"@type":"g:Int32","@value":201},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2775},"outV":{"@type":"g:Int32","@value":15},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@valu
 e":2840},"outV":{"@type":"g:Int32","@value":101},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4953},"outV":{"@type":"g:Int32","@value":86},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":1572},"outV":{"@type":"g:Int32","@value":18},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":229},"outV":{"@type":"g:Int32","@value":70},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4264},"outV":{"@type":"g:Int32","@value":10},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4969},"outV":{"@type":"g:Int32","@value":236},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":3498},"outV":{"@type":"g:Int32","@value":58},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":5226},"outV":{"@type":"g:Int32","@value":216},"p
 roperties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5548},"outV":{"@type":"g:Int32","@value":166},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2990},"outV":{"@type":"g:Int32","@value":14},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":3950},"outV":{"@type":"g:Int32","@value":138},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2488},"outV":{"@type":"g:Int32","@value":68},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6776},"outV":{"@type":"g:Int32","@value":39},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3641},"outV":{"@type":"g:Int32","@value":24},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":1532},"outV":{"@type":"g:Int32","@value":164},"properties":{"weight":{"@type":"g:Int32","@value":
 2}}},{"id":{"@type":"g:Int32","@value":1853},"outV":{"@type":"g:Int32","@value":94},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":638},"outV":{"@type":"g:Int32","@value":23},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":6335},"outV":{"@type":"g:Int32","@value":21},"properties":{"weight":{"@type":"g:Int32","@value":1}}}]},"outE":{"followedBy":[{"id":{"@type":"g:Int32","@value":6},"inV":{"@type":"g:Int32","@value":10},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":7},"inV":{"@type":"g:Int32","@value":11},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":8},"inV":{"@type":"g:Int32","@value":12},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":9},"inV":{"@type":"g:Int32","@value":13},"properties":{"weight":{"@type":"g:Int32","@value":6}}},{"id":{"@type":"g:Int32","@value":10},"i
 nV":{"@type":"g:Int32","@value":14},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":11},"inV":{"@type":"g:Int32","@value":15},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":12},"inV":{"@type":"g:Int32","@value":16},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":13},"inV":{"@type":"g:Int32","@value":17},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":14},"inV":{"@type":"g:Int32","@value":18},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":15},"inV":{"@type":"g:Int32","@value":19},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":16},"inV":{"@type":"g:Int32","@value":20},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":17},"inV":{"@type":"g:Int32","@value":21},"properties":{"weight":{"@type":"g:In
 t32","@value":1}}},{"id":{"@type":"g:Int32","@value":18},"inV":{"@type":"g:Int32","@value":22},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":19},"inV":{"@type":"g:Int32","@value":23},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":20},"inV":{"@type":"g:Int32","@value":24},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":21},"inV":{"@type":"g:Int32","@value":25},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":22},"inV":{"@type":"g:Int32","@value":26},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":23},"inV":{"@type":"g:Int32","@value":27},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":24},"inV":{"@type":"g:Int32","@value":28},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":25},"inV":{"@type":"
 g:Int32","@value":29},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":26},"inV":{"@type":"g:Int32","@value":30},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":27},"inV":{"@type":"g:Int32","@value":31},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":28},"inV":{"@type":"g:Int32","@value":32},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":29},"inV":{"@type":"g:Int32","@value":33},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":30},"inV":{"@type":"g:Int32","@value":34},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":31},"inV":{"@type":"g:Int32","@value":35},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":32},"inV":{"@type":"g:Int32","@value":36},"properties":{"weight":{"@type":"g:Int32","@value":
 2}}},{"id":{"@type":"g:Int32","@value":33},"inV":{"@type":"g:Int32","@value":37},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":34},"inV":{"@type":"g:Int32","@value":38},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":35},"inV":{"@type":"g:Int32","@value":39},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":36},"inV":{"@type":"g:Int32","@value":40},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":37},"inV":{"@type":"g:Int32","@value":41},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":38},"inV":{"@type":"g:Int32","@value":42},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":39},"inV":{"@type":"g:Int32","@value":43},"properties":{"weight":{"@type":"g:Int32","@value":1}}}],"sungBy":[{"id":{"@type":"g:Int32","@value":7190},"inV":{"@type":"g
 :Int32","@value":340}}],"writtenBy":[{"id":{"@type":"g:Int32","@value":7189},"inV":{"@type":"g:Int32","@value":339}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":24},"value":"HERE COMES SUNSHINE"}],"songType":[{"id":{"@type":"g:Int64","@value":26},"value":"original"}],"performances":[{"id":{"@type":"g:Int64","@value":25},"value":{"@type":"g:Int32","@value":65}}]}}
+{"id":{"@type":"g:Int32","@value":10},"label":"song","inE":{"followedBy":[{"id":{"@type":"g:Int32","@value":3841},"outV":{"@type":"g:Int32","@value":60},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1027},"outV":{"@type":"g:Int32","@value":73},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":6},"outV":{"@type":"g:Int32","@value":9},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":3335},"outV":{"@type":"g:Int32","@value":155},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4103},"outV":{"@type":"g:Int32","@value":48},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":6279},"outV":{"@type":"g:Int32","@value":49},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4233},"outV":{"@type":"g:Int32","@value":52},"properties":{"weight":{"@type":"g:In
 t32","@value":1}}},{"id":{"@type":"g:Int32","@value":4878},"outV":{"@type":"g:Int32","@value":100},"properties":{"weight":{"@type":"g:Int32","@value":19}}},{"id":{"@type":"g:Int32","@value":5264},"outV":{"@type":"g:Int32","@value":32},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":2196},"outV":{"@type":"g:Int32","@value":75},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":151},"outV":{"@type":"g:Int32","@value":108},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":1571},"outV":{"@type":"g:Int32","@value":18},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":3619},"outV":{"@type":"g:Int32","@value":24},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3237},"outV":{"@type":"g:Int32","@value":63},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@valu
 e":4647},"outV":{"@type":"g:Int32","@value":154},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4521},"outV":{"@type":"g:Int32","@value":105},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":1195},"outV":{"@type":"g:Int32","@value":26},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6444},"outV":{"@type":"g:Int32","@value":187},"properties":{"weight":{"@type":"g:Int32","@value":9}}},{"id":{"@type":"g:Int32","@value":6956},"outV":{"@type":"g:Int32","@value":84},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":687},"outV":{"@type":"g:Int32","@value":157},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4784},"outV":{"@type":"g:Int32","@value":114},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6064},"outV":{"@type":"g:Int32","@value":115}
 ,"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1714},"outV":{"@type":"g:Int32","@value":82},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":3890},"outV":{"@type":"g:Int32","@value":51},"properties":{"weight":{"@type":"g:Int32","@value":9}}},{"id":{"@type":"g:Int32","@value":55},"outV":{"@type":"g:Int32","@value":46},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5175},"outV":{"@type":"g:Int32","@value":71},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1337},"outV":{"@type":"g:Int32","@value":31},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1083},"outV":{"@type":"g:Int32","@value":59},"properties":{"weight":{"@type":"g:Int32","@value":10}}},{"id":{"@type":"g:Int32","@value":4155},"outV":{"@type":"g:Int32","@value":54},"properties":{"weight":{"@type":"g:Int32","@value":6
 }}},{"id":{"@type":"g:Int32","@value":6077},"outV":{"@type":"g:Int32","@value":72},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":5441},"outV":{"@type":"g:Int32","@value":239},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1987},"outV":{"@type":"g:Int32","@value":152},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":1860},"outV":{"@type":"g:Int32","@value":94},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2116},"outV":{"@type":"g:Int32","@value":17},"properties":{"weight":{"@type":"g:Int32","@value":7}}},{"id":{"@type":"g:Int32","@value":3269},"outV":{"@type":"g:Int32","@value":160},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":454},"outV":{"@type":"g:Int32","@value":38},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3142},"outV"
 :{"@type":"g:Int32","@value":104},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":2505},"outV":{"@type":"g:Int32","@value":57},"properties":{"weight":{"@type":"g:Int32","@value":12}}},{"id":{"@type":"g:Int32","@value":6603},"outV":{"@type":"g:Int32","@value":127},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":6859},"outV":{"@type":"g:Int32","@value":64},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":717},"outV":{"@type":"g:Int32","@value":80},"properties":{"weight":{"@type":"g:Int32","@value":9}}},{"id":{"@type":"g:Int32","@value":1360},"outV":{"@type":"g:Int32","@value":130},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3026},"outV":{"@type":"g:Int32","@value":14},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5972},"outV":{"@type":"g:Int32","@value":50},"properties":{"w
 eight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5077},"outV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":2392},"outV":{"@type":"g:Int32","@value":87},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1250},"outV":{"@type":"g:Int32","@value":27},"properties":{"weight":{"@type":"g:Int32","@value":10}}},{"id":{"@type":"g:Int32","@value":4706},"outV":{"@type":"g:Int32","@value":111},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":6755},"outV":{"@type":"g:Int32","@value":53},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":485},"outV":{"@type":"g:Int32","@value":98},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":2917},"outV":{"@type":"g:Int32","@value":78},"properties":{"weight":{"@type":"g:Int32","@value":10}}},{"id":{"@ty
 pe":"g:Int32","@value":3559},"outV":{"@type":"g:Int32","@value":56},"properties":{"weight":{"@type":"g:Int32","@value":16}}},{"id":{"@type":"g:Int32","@value":3436},"outV":{"@type":"g:Int32","@value":58},"properties":{"weight":{"@type":"g:Int32","@value":10}}},{"id":{"@type":"g:Int32","@value":3820},"outV":{"@type":"g:Int32","@value":88},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4463},"outV":{"@type":"g:Int32","@value":202},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":880},"outV":{"@type":"g:Int32","@value":189},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":6256},"outV":{"@type":"g:Int32","@value":117},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3698},"outV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2035},"outV":{"@type":"g:I
 nt32","@value":180},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2291},"outV":{"@type":"g:Int32","@value":25},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3317},"outV":{"@type":"g:Int32","@value":252},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2806},"outV":{"@type":"g:Int32","@value":15},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":2427},"outV":{"@type":"g:Int32","@value":68},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":6782},"outV":{"@type":"g:Int32","@value":39},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":4351},"outV":{"@type":"g:Int32","@value":62},"properties":{"weight":{"@type":"g:Int32","@value":2}}}]},"outE":{"followedBy":[{"id":{"@type":"g:Int32","@value":4235},"inV":{"@type":"g:Int32","@value":56},"propert
 ies":{"weight":{"@type":"g:Int32","@value":13}}},{"id":{"@type":"g:Int32","@value":4236},"inV":{"@type":"g:Int32","@value":27},"properties":{"weight":{"@type":"g:Int32","@value":7}}},{"id":{"@type":"g:Int32","@value":4237},"inV":{"@type":"g:Int32","@value":58},"properties":{"weight":{"@type":"g:Int32","@value":11}}},{"id":{"@type":"g:Int32","@value":4238},"inV":{"@type":"g:Int32","@value":80},"properties":{"weight":{"@type":"g:Int32","@value":6}}},{"id":{"@type":"g:Int32","@value":4239},"inV":{"@type":"g:Int32","@value":59},"properties":{"weight":{"@type":"g:Int32","@value":9}}},{"id":{"@type":"g:Int32","@value":4240},"inV":{"@type":"g:Int32","@value":100},"properties":{"weight":{"@type":"g:Int32","@value":21}}},{"id":{"@type":"g:Int32","@value":4241},"inV":{"@type":"g:Int32","@value":104},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":4242},"inV":{"@type":"g:Int32","@value":50},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":
 {"@type":"g:Int32","@value":4243},"inV":{"@type":"g:Int32","@value":48},"properties":{"weight":{"@type":"g:Int32","@value":8}}},{"id":{"@type":"g:Int32","@value":4244},"inV":{"@type":"g:Int32","@value":54},"properties":{"weight":{"@type":"g:Int32","@value":13}}},{"id":{"@type":"g:Int32","@value":4245},"inV":{"@type":"g:Int32","@value":19},"properties":{"weight":{"@type":"g:Int32","@value":9}}},{"id":{"@type":"g:Int32","@value":4246},"inV":{"@type":"g:Int32","@value":72},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":4247},"inV":{"@type":"g:Int32","@value":14},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4248},"inV":{"@type":"g:Int32","@value":122},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4249},"inV":{"@type":"g:Int32","@value":235},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4250},"inV":{"@type":"g:Int3
 2","@value":218},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4251},"inV":{"@type":"g:Int32","@value":252},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4252},"inV":{"@type":"g:Int32","@value":89},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":4253},"inV":{"@type":"g:Int32","@value":57},"properties":{"weight":{"@type":"g:Int32","@value":12}}},{"id":{"@type":"g:Int32","@value":4254},"inV":{"@type":"g:Int32","@value":49},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":4255},"inV":{"@type":"g:Int32","@value":94},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":4256},"inV":{"@type":"g:Int32","@value":153},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4257},"inV":{"@type":"g:Int32","@value":13},"properties":{"weight":{"@type":"g:Int3
 2","@value":1}}},{"id":{"@type":"g:Int32","@value":4258},"inV":{"@type":"g:Int32","@value":160},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4259},"inV":{"@type":"g:Int32","@value":51},"properties":{"weight":{"@type":"g:Int32","@value":10}}},{"id":{"@type":"g:Int32","@value":4260},"inV":{"@type":"g:Int32","@value":18},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":4261},"inV":{"@type":"g:Int32","@value":202},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":4262},"inV":{"@type":"g:Int32","@value":17},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":4263},"inV":{"@type":"g:Int32","@value":46},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4264},"inV":{"@type":"g:Int32","@value":9},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4265},
 "inV":{"@type":"g:Int32","@value":55},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4266},"inV":{"@type":"g:Int32","@value":125},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4267},"inV":{"@type":"g:Int32","@value":69},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4268},"inV":{"@type":"g:Int32","@value":98},"properties":{"weight":{"@type":"g:Int32","@value":8}}},{"id":{"@type":"g:Int32","@value":4269},"inV":{"@type":"g:Int32","@value":82},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":4270},"inV":{"@type":"g:Int32","@value":154},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4271},"inV":{"@type":"g:Int32","@value":105},"properties":{"weight":{"@type":"g:Int32","@value":7}}},{"id":{"@type":"g:Int32","@value":4272},"inV":{"@type":"g:Int32","@value":112},"properties":{"we
 ight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4273},"inV":{"@type":"g:Int32","@value":109},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4274},"inV":{"@type":"g:Int32","@value":42},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4275},"inV":{"@type":"g:Int32","@value":121},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4276},"inV":{"@type":"g:Int32","@value":73},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":4277},"inV":{"@type":"g:Int32","@value":106},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4278},"inV":{"@type":"g:Int32","@value":116},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4279},"inV":{"@type":"g:Int32","@value":68},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"
 g:Int32","@value":4280},"inV":{"@type":"g:Int32","@value":152},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4281},"inV":{"@type":"g:Int32","@value":23},"properties":{"weight":{"@type":"g:Int32","@value":6}}},{"id":{"@type":"g:Int32","@value":4282},"inV":{"@type":"g:Int32","@value":88},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4283},"inV":{"@type":"g:Int32","@value":39},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":4284},"inV":{"@type":"g:Int32","@value":12},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4285},"inV":{"@type":"g:Int32","@value":111},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4286},"inV":{"@type":"g:Int32","@value":99},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4287},"inV":{"@type":"g:Int32","@value"
 :87},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4288},"inV":{"@type":"g:Int32","@value":108},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4289},"inV":{"@type":"g:Int32","@value":53},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":4290},"inV":{"@type":"g:Int32","@value":26},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":4291},"inV":{"@type":"g:Int32","@value":117},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4292},"inV":{"@type":"g:Int32","@value":115},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4293},"inV":{"@type":"g:Int32","@value":63},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":4294},"inV":{"@type":"g:Int32","@value":103},"properties":{"weight":{"@type":"g:Int32","@value"
 :1}}}],"sungBy":[{"id":{"@type":"g:Int32","@value":7460},"inV":{"@type":"g:Int32","@value":351}}],"writtenBy":[{"id":{"@type":"g:Int32","@value":7459},"inV":{"@type":"g:Int32","@value":471}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":27},"value":"BEAT IT ON DOWN THE LINE"}],"songType":[{"id":{"@type":"g:Int64","@value":29},"value":"cover"}],"performances":[{"id":{"@type":"g:Int64","@value":28},"value":{"@type":"g:Int32","@value":325}}]}}
+{"id":{"@type":"g:Int32","@value":11},"label":"song","inE":{"followedBy":[{"id":{"@type":"g:Int32","@value":1088},"outV":{"@type":"g:Int32","@value":59},"properties":{"weight":{"@type":"g:Int32","@value":14}}},{"id":{"@type":"g:Int32","@value":6273},"outV":{"@type":"g:Int32","@value":49},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":1989},"outV":{"@type":"g:Int32","@value":152},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":7},"outV":{"@type":"g:Int32","@value":9},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":4552},"outV":{"@type":"g:Int32","@value":105},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":521},"outV":{"@type":"g:Int32","@value":205},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":714},"outV":{"@type":"g:Int32","@value":80},"properties":{"weight":{"@type":"g:I
 nt32","@value":5}}},{"id":{"@type":"g:Int32","@value":3146},"outV":{"@type":"g:Int32","@value":104},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":4876},"outV":{"@type":"g:Int32","@value":100},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":2190},"outV":{"@type":"g:Int32","@value":235},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4496},"outV":{"@type":"g:Int32","@value":202},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2513},"outV":{"@type":"g:Int32","@value":57},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":4053},"outV":{"@type":"g:Int32","@value":173},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5078},"outV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@v
 alue":1309},"outV":{"@type":"g:Int32","@value":27},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":4769},"outV":{"@type":"g:Int32","@value":114},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":5025},"outV":{"@type":"g:Int32","@value":30},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3554},"outV":{"@type":"g:Int32","@value":56},"properties":{"weight":{"@type":"g:Int32","@value":7}}},{"id":{"@type":"g:Int32","@value":1064},"outV":{"@type":"g:Int32","@value":73},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":2920},"outV":{"@type":"g:Int32","@value":78},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":6056},"outV":{"@type":"g:Int32","@value":115},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":41},"outV":{"@type":"g:Int32","@value":46},"
 properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":3434},"outV":{"@type":"g:Int32","@value":58},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":6442},"outV":{"@type":"g:Int32","@value":187},"properties":{"weight":{"@type":"g:Int32","@value":7}}},{"id":{"@type":"g:Int32","@value":1775},"outV":{"@type":"g:Int32","@value":234},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":3888},"outV":{"@type":"g:Int32","@value":51},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":626},"outV":{"@type":"g:Int32","@value":23},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":1396},"outV":{"@type":"g:Int32","@value":190},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":4020},"outV":{"@type":"g:Int32","@value":191},"properties":{"weight":{"@type":"g:Int32","@value"
 :1}}},{"id":{"@type":"g:Int32","@value":6772},"outV":{"@type":"g:Int32","@value":39},"properties":{"weight":{"@type":"g:Int32","@value":1}}},{"id":{"@type":"g:Int32","@value":3637},"outV":{"@type":"g:Int32","@value":24},"properties":{"weight":{"@type":"g:Int32","@value":2}}},{"id":{"@type":"g:Int32","@value":6072},"outV":{"@type":"g:Int32","@value":72},"properties":{"weight":{"@type":"g:Int32","@value":5}}},{"id":{"@type":"g:Int32","@value":4157},"outV":{"@type":"g:Int32","@value":54},"properties":{"weight":{"@type":"g:Int32","@value":2}}}]},"outE":{"followedBy":[{"id":{"@type":"g:Int32","@value":972},"inV":{"@type":"g:Int32","@value":57},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":973},"inV":{"@type":"g:Int32","@value":59},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":974},"inV":{"@type":"g:Int32","@value":53},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@v
 alue":975},"inV":{"@type":"g:Int32","@value":54},"properties":{"weight":{"@type":"g:Int32","@value":15}}},{"id":{"@type":"g:Int32","@value":976},"inV":{"@type":"g:Int32","@value":56},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":977},"inV":{"@type":"g:Int32","@value":48},"properties":{"weight":{"@type":"g:Int32","@value":3}}},{"id":{"@type":"g:Int32","@value":978},"inV":{"@type":"g:Int32","@value":72},"properties":{"weight":{"@type":"g:Int32","@value":4}}},{"id":{"@type":"g:Int32","@value":979},"inV":{"@type":"g:Int32","@value":19},"properties":{"weight":{"@type":"g:Int32","@value":9}}},{"id":{"@type":"g:Int32","@valu

<TRUNCATED>

[43/50] [abbrv] tinkerpop git commit: GraphSONRecordReader/Writer can now be configured to use either GraphSON V2 or V3. Added a test case to verfify proper behavior of parser from GraphSON V3 on HDFS.

Posted by sp...@apache.org.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1225bd09/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/Constants.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/Constants.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/Constants.java
index 3ff8e2a..1e378f2 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/Constants.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/Constants.java
@@ -40,6 +40,7 @@ public final class Constants {
     public static final String GREMLIN_HADOOP_GRAPH_FILTER = "gremlin.hadoop.graphFilter";
     public static final String GREMLIN_HADOOP_DEFAULT_GRAPH_COMPUTER = "gremlin.hadoop.defaultGraphComputer";
     public static final String GREMLIN_HADOOP_VERTEX_PROGRAM_INTERCEPTOR = "gremlin.hadoop.vertexProgramInterceptor";
+    public static final String GREMLIN_HADOOP_GRAPHSON_VERSION = "gremlin.hadoop.graphSONVersion";
 
     public static final String GREMLIN_HADOOP_JARS_IN_DISTRIBUTED_CACHE = "gremlin.hadoop.jarsInDistributedCache";
     public static final String HIDDEN_G = Graph.Hidden.hide("g");

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1225bd09/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReader.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReader.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReader.java
index 07bd303..1b8cb3c 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReader.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReader.java
@@ -58,7 +58,7 @@ public final class GraphSONRecordReader extends RecordReader<NullWritable, Verte
         this.hasEdges = context.getConfiguration().getBoolean(Constants.GREMLIN_HADOOP_GRAPH_READER_HAS_EDGES, true);
         this.graphsonReader = GraphSONReader.build().mapper(
                 GraphSONMapper.build().
-                        version(GraphSONVersion.V2_0).
+                        version(GraphSONVersion.valueOf(context.getConfiguration().get(Constants.GREMLIN_HADOOP_GRAPHSON_VERSION, "V3_0"))).
                         typeInfo(TypeInfo.PARTIAL_TYPES).
                         addRegistries(IoRegistryHelper.createRegistries(ConfUtil.makeApacheConfiguration(context.getConfiguration()))).create()).create();
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1225bd09/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordWriter.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordWriter.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordWriter.java
index 5ea058f..a5687de 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordWriter.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordWriter.java
@@ -60,7 +60,7 @@ public final class GraphSONRecordWriter extends RecordWriter<NullWritable, Verte
         this.hasEdges = configuration.getBoolean(Constants.GREMLIN_HADOOP_GRAPH_WRITER_HAS_EDGES, true);
         this.graphsonWriter = GraphSONWriter.build().mapper(
                 GraphSONMapper.build().
-                        version(GraphSONVersion.V2_0).
+                        version(GraphSONVersion.valueOf(configuration.get(Constants.GREMLIN_HADOOP_GRAPHSON_VERSION, "V3_0"))).
                         typeInfo(TypeInfo.PARTIAL_TYPES).
                         addRegistries(IoRegistryHelper.createRegistries(ConfUtil.makeApacheConfiguration(configuration))).create()).create();
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1225bd09/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGraphProvider.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGraphProvider.java b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGraphProvider.java
index 2c51524..346b731 100644
--- a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGraphProvider.java
+++ b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGraphProvider.java
@@ -87,6 +87,7 @@ public class HadoopGraphProvider extends AbstractGraphProvider {
             final List<String> graphsonResources = Arrays.asList(
                     "tinkerpop-modern-v2d0-typed.json",
                     "grateful-dead-v2d0-typed.json",
+                    "grateful-dead-v3d0-typed.json",
                     "tinkerpop-classic-v2d0-typed.json",
                     "tinkerpop-crew-v2d0-typed.json");
             for (final String fileName : graphsonResources) {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1225bd09/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/RecordReaderWriterTest.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/RecordReaderWriterTest.java b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/RecordReaderWriterTest.java
index f3c079b..d2d2316 100644
--- a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/RecordReaderWriterTest.java
+++ b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/RecordReaderWriterTest.java
@@ -56,6 +56,9 @@ import static org.junit.Assert.assertTrue;
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
 public abstract class RecordReaderWriterTest {
+    // extra configurations that a extending class can add prior to test execution
+    protected Configuration configuration = new Configuration();
+
     private static final Logger logger = LoggerFactory.getLogger(RecordReaderWriterTest.class);
 
     protected abstract String getInputFilename();
@@ -74,6 +77,7 @@ public abstract class RecordReaderWriterTest {
             final Class<? extends OutputFormat<NullWritable, VertexWritable>> outputFormatClass = getOutputFormat();
             final File outputDirectory = TestHelper.makeTestDataPath(inputFormatClass, "hadoop-record-reader-writer-test");
             final Configuration config = configure(outputDirectory);
+            config.addResource(this.configuration);
             validateFileSplits(splits, config, inputFormatClass, Optional.of(outputFormatClass));
         }
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1225bd09/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReaderWriterTest.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReaderWriterTest.java b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReaderWriterTest.java
deleted file mode 100644
index 903bef5..0000000
--- a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReaderWriterTest.java
+++ /dev/null
@@ -1,48 +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.hadoop.structure.io.graphson;
-
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.mapreduce.InputFormat;
-import org.apache.hadoop.mapreduce.OutputFormat;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.RecordReaderWriterTest;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @author Daniel Kuppitz (http://gremlin.guru)
- */
-public class GraphSONRecordReaderWriterTest extends RecordReaderWriterTest {
-
-    @Override
-    protected String getInputFilename() {
-        return "grateful-dead-v2d0-typed.json";
-    }
-
-    @Override
-    protected Class<? extends InputFormat<NullWritable, VertexWritable>> getInputFormat() {
-        return GraphSONInputFormat.class;
-    }
-
-    @Override
-    protected Class<? extends OutputFormat<NullWritable, VertexWritable>> getOutputFormat() {
-        return GraphSONOutputFormat.class;
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1225bd09/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONV2d0RecordReaderWriterTest.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONV2d0RecordReaderWriterTest.java b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONV2d0RecordReaderWriterTest.java
new file mode 100644
index 0000000..eca34a5
--- /dev/null
+++ b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONV2d0RecordReaderWriterTest.java
@@ -0,0 +1,54 @@
+/*
+ * 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.hadoop.structure.io.graphson;
+
+import org.apache.hadoop.io.NullWritable;
+import org.apache.hadoop.mapreduce.InputFormat;
+import org.apache.hadoop.mapreduce.OutputFormat;
+import org.apache.tinkerpop.gremlin.hadoop.Constants;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.RecordReaderWriterTest;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
+import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONVersion;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ * @author Daniel Kuppitz (http://gremlin.guru)
+ */
+public class GraphSONV2d0RecordReaderWriterTest extends RecordReaderWriterTest {
+
+    public GraphSONV2d0RecordReaderWriterTest() {
+        super.configuration.set(Constants.GREMLIN_HADOOP_GRAPHSON_VERSION, GraphSONVersion.V2_0.name());
+    }
+
+    @Override
+    protected String getInputFilename() {
+        return "grateful-dead-v2d0-typed.json";
+    }
+
+    @Override
+    protected Class<? extends InputFormat<NullWritable, VertexWritable>> getInputFormat() {
+        return GraphSONInputFormat.class;
+    }
+
+    @Override
+    protected Class<? extends OutputFormat<NullWritable, VertexWritable>> getOutputFormat() {
+        return GraphSONOutputFormat.class;
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1225bd09/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONV3d0RecordReaderWriterTest.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONV3d0RecordReaderWriterTest.java b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONV3d0RecordReaderWriterTest.java
new file mode 100644
index 0000000..1783fd9
--- /dev/null
+++ b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONV3d0RecordReaderWriterTest.java
@@ -0,0 +1,53 @@
+/*
+ *  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.hadoop.structure.io.graphson;
+
+import org.apache.hadoop.io.NullWritable;
+import org.apache.hadoop.mapreduce.InputFormat;
+import org.apache.hadoop.mapreduce.OutputFormat;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.RecordReaderWriterTest;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class GraphSONV3d0RecordReaderWriterTest extends RecordReaderWriterTest {
+
+    public GraphSONV3d0RecordReaderWriterTest() {
+        // should be default
+        // super.configuration.set(Constants.GREMLIN_HADOOP_GRAPHSON_VERSION, GraphSONVersion.V3_0.name());
+    }
+
+    @Override
+    protected String getInputFilename() {
+        return "grateful-dead-v3d0-typed.json";
+    }
+
+    @Override
+    protected Class<? extends InputFormat<NullWritable, VertexWritable>> getInputFormat() {
+        return GraphSONInputFormat.class;
+    }
+
+    @Override
+    protected Class<? extends OutputFormat<NullWritable, VertexWritable>> getOutputFormat() {
+        return GraphSONOutputFormat.class;
+    }
+}
+


[41/50] [abbrv] tinkerpop git commit: 99 percent complete GraphSON 3.0 working with Gremlin-Python. Extended test suite to support both GraphSON 2.0 and GraphSON 3.0 testing. There is one last requirement to do on the code -- a version flag on GraphSONMe

Posted by sp...@apache.org.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdd1bc3f/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py b/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py
new file mode 100644
index 0000000..65425e4
--- /dev/null
+++ b/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py
@@ -0,0 +1,287 @@
+'''
+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.
+'''
+
+__author__ = 'Marko A. Rodriguez (http://markorodriguez.com)'
+
+import json
+from mock import Mock
+
+import six
+
+from gremlin_python.statics import *
+from gremlin_python.structure.graph import Vertex, Edge, Property, VertexProperty
+from gremlin_python.structure.graph import Path
+from gremlin_python.structure.io.graphsonV3d0 import GraphSONWriter, GraphSONReader, GraphSONUtil
+import gremlin_python.structure.io.graphsonV3d0
+from gremlin_python.process.traversal import P
+from gremlin_python.process.strategies import SubgraphStrategy
+from gremlin_python.process.graph_traversal import __
+
+class TestGraphSONReader(object):
+    graphson_reader = GraphSONReader()
+
+    def test_number_input(self):
+        x = self.graphson_reader.readObject(json.dumps({
+            "@type": "g:Int32",
+            "@value": 31
+        }))
+        assert isinstance(x, int)
+        assert 31 == x
+        ##
+        x = self.graphson_reader.readObject(json.dumps({
+            "@type": "g:Int64",
+            "@value": 31
+        }))
+        assert isinstance(x, long)
+        assert long(31) == x
+        ##
+        x = self.graphson_reader.readObject(json.dumps({
+            "@type": "g:Float",
+            "@value": 31.3
+        }))
+        assert isinstance(x, float)
+        assert 31.3 == x
+        ##
+        x = self.graphson_reader.readObject(json.dumps({
+            "@type": "g:Double",
+            "@value": 31.2
+        }))
+        assert isinstance(x, float)
+        assert 31.2 == x
+
+    def test_graph(self):
+        vertex = self.graphson_reader.readObject("""
+        {"@type":"g:Vertex", "@value":{"id":{"@type":"g:Int32","@value":1},"label":"person","outE":{"created":[{"id":{"@type":"g:Int32","@value":9},"inV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Double","@value":0.4}}}],"knows":[{"id":{"@type":"g:Int32","@value":7},"inV":{"@type":"g:Int32","@value":2},"properties":{"weight":{"@type":"g:Double","@value":0.5}}},{"id":{"@type":"g:Int32","@value":8},"inV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@type":"g:Double","@value":1.0}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"marko"}],"age":[{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29}}]}}}""")
+        assert isinstance(vertex, Vertex)
+        assert "person" == vertex.label
+        assert 1 == vertex.id
+        assert isinstance(vertex.id, int)
+        assert vertex == Vertex(1)
+        ##
+        vertex = self.graphson_reader.readObject("""
+        {"@type":"g:Vertex", "@value":{"id":{"@type":"g:Float","@value":45.23}}}""")
+        assert isinstance(vertex, Vertex)
+        assert 45.23 == vertex.id
+        assert isinstance(vertex.id, FloatType)
+        assert "vertex" == vertex.label
+        assert vertex == Vertex(45.23)
+        ##
+        vertex_property = self.graphson_reader.readObject("""
+        {"@type":"g:VertexProperty", "@value":{"id":"anId","label":"aKey","value":true,"vertex":{"@type":"g:Int32","@value":9}}}""")
+        assert isinstance(vertex_property, VertexProperty)
+        assert "anId" == vertex_property.id
+        assert "aKey" == vertex_property.label
+        assert vertex_property.value
+        assert vertex_property.vertex == Vertex(9)
+        ##
+        vertex_property = self.graphson_reader.readObject("""
+        {"@type":"g:VertexProperty", "@value":{"id":{"@type":"g:Int32","@value":1},"label":"name","value":"marko"}}""")
+        assert isinstance(vertex_property, VertexProperty)
+        assert 1 == vertex_property.id
+        assert "name" == vertex_property.label
+        assert "marko" == vertex_property.value
+        assert vertex_property.vertex is None
+        ##
+        edge = self.graphson_reader.readObject("""
+        {"@type":"g:Edge", "@value":{"id":{"@type":"g:Int64","@value":17},"label":"knows","inV":"x","outV":"y","inVLabel":"xLab","properties":{"aKey":"aValue","bKey":true}}}""")
+        # print edge
+        assert isinstance(edge, Edge)
+        assert 17 == edge.id
+        assert "knows" == edge.label
+        assert edge.inV == Vertex("x", "xLabel")
+        assert edge.outV == Vertex("y", "vertex")
+        ##
+        property = self.graphson_reader.readObject("""
+        {"@type":"g:Property", "@value":{"key":"aKey","value":{"@type":"g:Int64","@value":17},"element":{"@type":"g:Edge","@value":{"id":{"@type":"g:Int64","@value":122},"label":"knows","inV":"x","outV":"y","inVLabel":"xLab"}}}}""")
+        # print property
+        assert isinstance(property, Property)
+        assert "aKey" == property.key
+        assert 17 == property.value
+        assert Edge(122, Vertex("x"), "knows", Vertex("y")) == property.element
+
+    def test_path(self):
+        path = self.graphson_reader.readObject(
+            """{"@type":"g:Path","@value":{"labels":[["a"],["b","c"],[]],"objects":[{"@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":1},"label":"person","properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":0},"value":"marko","label":"name"}}],"age":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29},"label":"age"}}]}}},{"@type":"g:Vertex","@value":{"id":{"@type":"g:Int32","@value":3},"label":"software","properties":{"name":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":4},"value":"lop","label":"name"}}],"lang":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":5},"value":"java","label":"lang"}}]}}},"lop"]}}"""
+        )
+        assert isinstance(path, Path)
+        if six.PY3:
+            assert "[v[1], v[3], 'lop']" == str(path)
+        else:
+            assert "[v[1], v[3], u'lop']" == str(path)
+        assert Vertex(1) == path[0]
+        assert Vertex(1) == path["a"]
+        assert "lop" == path[2]
+        assert 3 == len(path)
+
+    def test_custom_mapping(self):
+
+        # extended mapping
+        class X(object):
+            pass
+
+        type_string = "test:Xtype"
+        override_string = "g:Int64"
+        serdes = Mock()
+
+        reader = GraphSONReader(deserializer_map={type_string: serdes})
+        assert type_string in reader.deserializers
+
+        # base dicts are not modified
+        assert type_string not in gremlin_python.structure.io.graphsonV3d0._deserializers
+
+        x = X()
+        o = reader.toObject({GraphSONUtil.TYPE_KEY: type_string, GraphSONUtil.VALUE_KEY: x})
+        serdes.objectify.assert_called_once_with(x, reader)
+        assert o is serdes.objectify()
+
+        # overridden mapping
+        type_string = "g:Int64"
+        serdes = Mock()
+        reader = GraphSONReader(deserializer_map={type_string: serdes, override_string: serdes})
+        assert gremlin_python.structure.io.graphsonV3d0._deserializers[type_string] is not reader.deserializers[
+            type_string]
+
+        value = 3
+        o = reader.toObject({GraphSONUtil.TYPE_KEY: type_string, GraphSONUtil.VALUE_KEY: value})
+        serdes.objectify.assert_called_once_with(value, reader)
+        assert o is serdes.objectify()
+
+
+class TestGraphSONWriter(object):
+    graphson_writer = GraphSONWriter()
+
+    def test_collections(self):
+        assert {"@type": "g:List", "@value": [{"@type": "g:Int32", "@value": 1},
+                                              {"@type": "g:Int32", "@value": 2},
+                                              {"@type": "g:Int32", "@value": 3}]} == json.loads(
+            self.graphson_writer.writeObject([1, 2, 3]))
+        assert {"@type": "g:Set", "@value": [{"@type": "g:Int32", "@value": 1},
+                                             {"@type": "g:Int32", "@value": 2},
+                                             {"@type": "g:Int32", "@value": 3}]} == json.loads(
+            self.graphson_writer.writeObject(set([1, 2, 3, 3])))
+        assert {"@type": "g:Map",
+                "@value": ['a', {"@type": "g:Int32", "@value": 1},
+                           'b', {"@type": "g:Int32", "@value": 2}]} == json.loads(
+            self.graphson_writer.writeObject({'a': 1, 'b': 2}))
+
+    def test_number_output(self):
+        assert {"@type": "g:Int64", "@value": 2} == json.loads(self.graphson_writer.writeObject(long(2)))
+        assert {"@type": "g:Int32", "@value": 1} == json.loads(self.graphson_writer.writeObject(1))
+        assert {"@type": "g:Double", "@value": 3.2} == json.loads(self.graphson_writer.writeObject(3.2))
+        assert """true""" == self.graphson_writer.writeObject(True)
+
+    def test_numbers(self):
+        assert {"@type": "g:Int64", "@value": 2} == json.loads(self.graphson_writer.writeObject(long(2)))
+        assert {"@type": "g:Int32", "@value": 1} == json.loads(self.graphson_writer.writeObject(1))
+        assert {"@type": "g:Double", "@value": 3.2} == json.loads(self.graphson_writer.writeObject(3.2))
+        assert """true""" == self.graphson_writer.writeObject(True)
+
+    def test_P(self):
+        result = {'@type': 'g:P',
+                  '@value': {
+                      'predicate': 'and',
+                      'value': [{
+                          '@type': 'g:P',
+                          '@value': {
+                              'predicate': 'or',
+                              'value': [{
+                                  '@type': 'g:P',
+                                  '@value': {'predicate': 'lt', 'value': 'b'}
+                              },
+                                  {'@type': 'g:P', '@value': {'predicate': 'gt', 'value': 'c'}}
+                              ]
+                          }
+                      },
+                          {'@type': 'g:P', '@value': {'predicate': 'neq', 'value': 'd'}}]}}
+
+        assert result == json.loads(
+            self.graphson_writer.writeObject(P.lt("b").or_(P.gt("c")).and_(P.neq("d"))))
+
+        result = {'@type': 'g:P', '@value': {'predicate':'within','value': {'@type': 'g:List', '@value':[{"@type": "g:Int32", "@value": 1},{"@type": "g:Int32", "@value": 2}]}}}
+        assert result == json.loads(self.graphson_writer.writeObject(P.within([1,2])))
+
+    def test_strategies(self):
+        # we have a proxy model for now given that we don't want to have to have g:XXX all registered on the Gremlin traversal machine (yet)
+        assert {"@type": "g:SubgraphStrategy", "@value": {}} == json.loads(
+            self.graphson_writer.writeObject(SubgraphStrategy))
+        assert {"@type": "g:SubgraphStrategy", "@value": {
+            "vertices": {"@type": "g:Bytecode", "@value": {"step": [["has", "name", "marko"]]}}}} == json.loads(
+            self.graphson_writer.writeObject(SubgraphStrategy(vertices=__.has("name", "marko"))))
+
+    def test_graph(self):
+        # TODO: this assert is not compatible with python 3 and now that we test with both 2 and 3 it fails
+        assert {"@type": "g:Vertex",
+                "@value": {"id": {"@type": "g:Int64", "@value": 12}, "label": "person"}} == json.loads(
+            self.graphson_writer.writeObject(Vertex(long(12), "person")))
+
+        assert {"@type": "g:Edge", "@value": {"id": {"@type": "g:Int32", "@value": 7},
+                                              "outV": {"@type": "g:Int32", "@value": 0},
+                                              "outVLabel": "person",
+                                              "label": "knows",
+                                              "inV": {"@type": "g:Int32", "@value": 1},
+                                              "inVLabel": "dog"}} == json.loads(
+            self.graphson_writer.writeObject(Edge(7, Vertex(0, "person"), "knows", Vertex(1, "dog"))))
+        assert {"@type": "g:VertexProperty", "@value": {"id": "blah", "label": "keyA", "value": True,
+                                                        "vertex": "stephen"}} == json.loads(
+            self.graphson_writer.writeObject(VertexProperty("blah", "keyA", True, Vertex("stephen"))))
+
+        assert {"@type": "g:Property",
+                "@value": {"key": "name", "value": "marko", "element": {"@type": "g:VertexProperty",
+                                                                        "@value": {
+                                                                            "vertex": "vertexId",
+                                                                            "id": {"@type": "g:Int32", "@value": 1234},
+                                                                            "label": "aKey"}}}} == json.loads(
+            self.graphson_writer.writeObject(
+                Property("name", "marko", VertexProperty(1234, "aKey", 21345, Vertex("vertexId")))))
+
+    def test_custom_mapping(self):
+        # extended mapping
+        class X(object):
+            pass
+
+        serdes = Mock()
+        writer = GraphSONWriter(serializer_map={X: serdes})
+        assert X in writer.serializers
+
+        # base dicts are not modified
+        assert X not in gremlin_python.structure.io.graphsonV3d0._serializers
+
+        obj = X()
+        d = writer.toDict(obj)
+        serdes.dictify.assert_called_once_with(obj, writer)
+        assert d is serdes.dictify()
+
+        # overridden mapping
+        serdes = Mock()
+        writer = GraphSONWriter(serializer_map={int: serdes})
+        assert gremlin_python.structure.io.graphsonV3d0._serializers[int] is not writer.serializers[int]
+
+        value = 3
+        d = writer.toDict(value)
+        serdes.dictify.assert_called_once_with(value, writer)
+        assert d is serdes.dictify()
+
+    def test_write_long(self):
+        mapping = self.graphson_writer.toDict(1)
+        assert mapping['@type'] == 'g:Int32'
+        assert mapping['@value'] == 1
+
+        mapping = self.graphson_writer.toDict(long(1))
+        assert mapping['@type'] == 'g:Int64'
+        assert mapping['@value'] == 1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdd1bc3f/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonScriptEngineSetup.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonScriptEngineSetup.java b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonScriptEngineSetup.java
index a4fe1ed..bfbd8c4 100644
--- a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonScriptEngineSetup.java
+++ b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonScriptEngineSetup.java
@@ -49,9 +49,12 @@ public class JythonScriptEngineSetup {
             jythonEngine.eval("from gremlin_python.structure.graph import Edge");
             jythonEngine.eval("from gremlin_python.structure.graph import VertexProperty");
             jythonEngine.eval("from gremlin_python.structure.graph import Property");
-            jythonEngine.eval("from gremlin_python.structure.io.graphson import GraphSONReader, GraphSONWriter");
-            jythonEngine.eval("graphson_reader = GraphSONReader()");
-            jythonEngine.eval("graphson_writer = GraphSONWriter()");
+            jythonEngine.eval("import gremlin_python.structure.io.graphsonV2d0");
+            jythonEngine.eval("import gremlin_python.structure.io.graphsonV3d0");
+            jythonEngine.eval("graphsonV2d0_reader = gremlin_python.structure.io.graphsonV2d0.GraphSONReader()");
+            jythonEngine.eval("graphsonV2d0_writer = gremlin_python.structure.io.graphsonV2d0.GraphSONWriter()");
+            jythonEngine.eval("graphsonV3d0_reader = gremlin_python.structure.io.graphsonV3d0.GraphSONReader()");
+            jythonEngine.eval("graphsonV3d0_writer = gremlin_python.structure.io.graphsonV3d0.GraphSONWriter()");
             return jythonEngine;
         } catch (final ScriptException e) {
             throw new IllegalStateException(e.getMessage(), e);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdd1bc3f/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonGraphSONJavaTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonGraphSONJavaTranslator.java b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonGraphSONJavaTranslator.java
index 9f6dfbd..6c77867 100644
--- a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonGraphSONJavaTranslator.java
+++ b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonGraphSONJavaTranslator.java
@@ -52,16 +52,24 @@ final class PythonGraphSONJavaTranslator<S extends TraversalSource, T extends Tr
     private final boolean IS_TESTING = Boolean.valueOf(System.getProperty("is.testing", "false"));
     private final PythonTranslator pythonTranslator;
     private final JavaTranslator<S, T> javaTranslator;
-    private final GraphSONReader reader = GraphSONReader.build().mapper(
-            GraphSONMapper.build().addCustomModule(GraphSONXModuleV2d0.build().create(false))
-                    .version(GraphSONVersion.V2_0).create()).create();
-    private final GraphSONWriter writer = GraphSONWriter.build().mapper(
-            GraphSONMapper.build().addCustomModule(GraphSONXModuleV2d0.build().create(false))
-                    .version(GraphSONVersion.V2_0).create()).create();
+    private final GraphSONReader reader;
+    private final GraphSONWriter writer;
+    private final GraphSONVersion version;
 
-    public PythonGraphSONJavaTranslator(final PythonTranslator pythonTranslator, final JavaTranslator<S, T> javaTranslator) {
+    public PythonGraphSONJavaTranslator(final PythonTranslator pythonTranslator, final JavaTranslator<S, T> javaTranslator, final GraphSONVersion version) {
         this.pythonTranslator = pythonTranslator;
         this.javaTranslator = javaTranslator;
+        this.version = version;
+        this.reader = GraphSONReader.build().mapper(
+                GraphSONMapper.build().addCustomModule(version.equals(GraphSONVersion.V2_0) ?
+                        GraphSONXModuleV2d0.build().create(false) :
+                        GraphSONXModuleV3d0.build().create(false))
+                        .version(version).create()).create();
+        this.writer = GraphSONWriter.build().mapper(
+                GraphSONMapper.build().addCustomModule(version.equals(GraphSONVersion.V2_0) ?
+                        GraphSONXModuleV2d0.build().create(false) :
+                        GraphSONXModuleV3d0.build().create(false))
+                        .version(version).create()).create();
     }
 
     @Override
@@ -82,7 +90,10 @@ final class PythonGraphSONJavaTranslator<S extends TraversalSource, T extends Tr
             bindings.putAll(jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE));
             bindings.put(this.pythonTranslator.getTraversalSource(), jythonEngine.eval("Graph().traversal()"));
             bindings.putAll(bytecode.getBindings());
-            final String translatedGraphSONBytecode = jythonEngine.eval("graphson_writer.writeObject(" + this.pythonTranslator.translate(bytecode) + ")", bindings).toString();
+            final String translatedGraphSONBytecode = jythonEngine.eval((this.version.equals(GraphSONVersion.V2_0) ?
+                    "graphsonV2d0_writer" :
+                    "graphsonV3d0_writer") +
+                    ".writeObject(" + this.pythonTranslator.translate(bytecode) + ")", bindings).toString();
             if (IS_TESTING) {
                 // verify that the GraphSON sent to Python is the same as the GraphSON returned by Python
                 final ByteArrayOutputStream output = new ByteArrayOutputStream();
@@ -91,6 +102,7 @@ final class PythonGraphSONJavaTranslator<S extends TraversalSource, T extends Tr
                 this.writer.writeObject(output, bytecode);
                 final String originalGraphSONBytecode = new String(output.toByteArray());
                 final ObjectMapper mapper = new ObjectMapper(new JsonFactory());
+                // System.out.println(originalGraphSONBytecode + "\n" + translatedGraphSONBytecode + "\n\n");
                 final Map<String, Object> original = mapper.readValue(originalGraphSONBytecode, Map.class);
                 final Map<String, Object> translated = mapper.readValue(translatedGraphSONBytecode, Map.class);
                 assertEquals(originalGraphSONBytecode.length(), translatedGraphSONBytecode.length());
@@ -98,7 +110,6 @@ final class PythonGraphSONJavaTranslator<S extends TraversalSource, T extends Tr
             }
             return this.javaTranslator.translate(this.reader.readObject(new ByteArrayInputStream(translatedGraphSONBytecode.getBytes()), Bytecode.class));
 
-
         } catch (final Exception e) {
             throw new IllegalArgumentException(e.getMessage(), e);
         }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdd1bc3f/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonProvider.java b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonProvider.java
index 4a6dc4d..e745fe5 100644
--- a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonProvider.java
+++ b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonProvider.java
@@ -33,6 +33,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventS
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategy;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONVersion;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerEdge;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerElement;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
@@ -54,8 +55,10 @@ import java.util.Set;
  */
 public class PythonProvider extends AbstractGraphProvider {
 
+    private static final Random RANDOM = new Random();
     protected static final boolean IMPORT_STATICS = new Random().nextBoolean();
 
+
     static {
         JythonScriptEngineSetup.setup();
     }
@@ -147,7 +150,11 @@ public class PythonProvider extends AbstractGraphProvider {
                 throw new IllegalStateException(e.getMessage(), e);
             }
             final GraphTraversalSource g = graph.traversal();
-            return g.withStrategies(new TranslationStrategy(g, new PythonGraphSONJavaTranslator<>(PythonTranslator.of("g", IMPORT_STATICS), JavaTranslator.of(g))));
+            return g.withStrategies(new TranslationStrategy(g,
+                    new PythonGraphSONJavaTranslator<>(
+                            PythonTranslator.of("g", IMPORT_STATICS),
+                            JavaTranslator.of(g),
+                            RANDOM.nextBoolean() ? GraphSONVersion.V2_0 : GraphSONVersion.V3_0)));
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdd1bc3f/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/structure/io/graphson/GraphSONReaderTest.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/structure/io/graphson/GraphSONReaderTest.java b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/structure/io/graphson/GraphSONReaderTest.java
index 86bdd21..48d2e80 100644
--- a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/structure/io/graphson/GraphSONReaderTest.java
+++ b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/structure/io/graphson/GraphSONReaderTest.java
@@ -39,9 +39,11 @@ import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
 import java.math.BigInteger;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
@@ -51,83 +53,98 @@ import static org.junit.Assert.assertTrue;
  */
 public class GraphSONReaderTest {
 
-    private static final ScriptEngine jythonEngine = JythonScriptEngineSetup.setup((PyScriptEngine) new ScriptEngineManager().getEngineByName("jython"));
-    private static final ObjectMapper mapper = GraphSONMapper.build().version(GraphSONVersion.V2_0).create().createMapper();
+    private static final Set<GraphSONVersion> VERSIONS = new HashSet<>(Arrays.asList(GraphSONVersion.V2_0, GraphSONVersion.V3_0));
     private static final GraphTraversalSource g = TinkerFactory.createModern().traversal();
 
-
     @Test
     public void shouldDeserializeGraphObjects() throws Exception {
-        final Vertex vertex = g.V(1).next();
-        jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(vertex));
-        assertEquals(vertex.toString(), jythonEngine.eval("str(graphson_reader.readObject(x))"));
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),Vertex)"));
-        //
-        final Edge edge = g.V(1).outE("created").next();
-        jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(edge));
-        assertEquals(edge.toString(), jythonEngine.eval("str(graphson_reader.readObject(x))"));
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),Edge)"));
-        //
-        final VertexProperty vertexProperty = (VertexProperty) g.V(1).properties("name").next();
-        jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(vertexProperty));
-        assertEquals(vertexProperty.toString(), jythonEngine.eval("str(graphson_reader.readObject(x))"));
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),VertexProperty)"));
-        //
-        final Property property = g.V(1).outE("created").properties("weight").next();
-        jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(property));
-        assertEquals(property.toString(), jythonEngine.eval("str(graphson_reader.readObject(x))"));
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),Property)"));
-        //
-        final Traverser<Vertex> traverser = new DefaultRemoteTraverser<>(vertex, 3L);
-        jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(traverser));
-        assertEquals(traverser.toString(), jythonEngine.eval("str(graphson_reader.readObject(x))"));
-        assertEquals(BigInteger.valueOf(3L), jythonEngine.eval("graphson_reader.readObject(x).bulk")); // jython uses big integer in Java
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x).object,Vertex)"));
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),Traverser)"));
+        for (final GraphSONVersion version : VERSIONS) {
+            final ScriptEngine jythonEngine = JythonScriptEngineSetup.setup((PyScriptEngine) new ScriptEngineManager().getEngineByName("jython"));
+            jythonEngine.eval("graphson_reader = " + (version.equals(GraphSONVersion.V2_0) ? "graphsonV2d0_reader" : "graphsonV3d0_reader"));
+            final ObjectMapper mapper = GraphSONMapper.build().version(version).create().createMapper();
+            //
+            final Vertex vertex = g.V(1).next();
+            jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(vertex));
+            assertEquals(vertex.toString(), jythonEngine.eval("str(graphson_reader.readObject(x))"));
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),Vertex)"));
+            //
+            final Edge edge = g.V(1).outE("created").next();
+            jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(edge));
+            assertEquals(edge.toString(), jythonEngine.eval("str(graphson_reader.readObject(x))"));
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),Edge)"));
+            //
+            final VertexProperty vertexProperty = (VertexProperty) g.V(1).properties("name").next();
+            jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(vertexProperty));
+            assertEquals(vertexProperty.toString(), jythonEngine.eval("str(graphson_reader.readObject(x))"));
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),VertexProperty)"));
+            //
+            final Property property = g.V(1).outE("created").properties("weight").next();
+            jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(property));
+            assertEquals(property.toString(), jythonEngine.eval("str(graphson_reader.readObject(x))"));
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),Property)"));
+            //
+            final Traverser<Vertex> traverser = new DefaultRemoteTraverser<>(vertex, 3L);
+            jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(traverser));
+            assertEquals(traverser.toString(), jythonEngine.eval("str(graphson_reader.readObject(x))"));
+            assertEquals(BigInteger.valueOf(3L), jythonEngine.eval("graphson_reader.readObject(x).bulk")); // jython uses big integer in Java
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x).object,Vertex)"));
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),Traverser)"));
+        }
     }
 
     @Test
     public void shouldDeserializeNumbers() throws Exception {
-        jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(1));
-        assertEquals("1", jythonEngine.eval("str(graphson_reader.readObject(x))"));
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),int)"));
-        //
-        jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(1L));
-        assertEquals("1", jythonEngine.eval("str(graphson_reader.readObject(x))"));
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),long)"));
-        //
-        jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(1.2f));
-        assertEquals("1.2", jythonEngine.eval("str(graphson_reader.readObject(x))"));
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),float)"));
-        //
-        jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(1.3d));
-        assertEquals("1.3", jythonEngine.eval("str(graphson_reader.readObject(x))"));
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),float)"));
+        for (final GraphSONVersion version : VERSIONS) {
+            final ScriptEngine jythonEngine = JythonScriptEngineSetup.setup((PyScriptEngine) new ScriptEngineManager().getEngineByName("jython"));
+            jythonEngine.eval("graphson_reader = " + (version.equals(GraphSONVersion.V2_0) ? "graphsonV2d0_reader" : "graphsonV3d0_reader"));
+            final ObjectMapper mapper = GraphSONMapper.build().version(version).create().createMapper();
+            //
+            jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(1));
+            assertEquals("1", jythonEngine.eval("str(graphson_reader.readObject(x))"));
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),int)"));
+            //
+            jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(1L));
+            assertEquals("1", jythonEngine.eval("str(graphson_reader.readObject(x))"));
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),long)"));
+            //
+            jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(1.2f));
+            assertEquals("1.2", jythonEngine.eval("str(graphson_reader.readObject(x))"));
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),float)"));
+            //
+            jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(1.3d));
+            assertEquals("1.3", jythonEngine.eval("str(graphson_reader.readObject(x))"));
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x),float)"));
+        }
     }
 
     @Test
     public void shouldDeserializeCollections() throws Exception {
-        final Map<String, Number> map = new LinkedHashMap<>();
-        map.put("a", 2);
-        map.put("b", 2.3d);
-        jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(map));
-        assertEquals("{u'a': 2, u'b': 2.3}", jythonEngine.eval("str(graphson_reader.readObject(x))"));
-        assertEquals(2, jythonEngine.eval("graphson_reader.readObject(x)['a']"));
-        assertEquals(2.3d, jythonEngine.eval("graphson_reader.readObject(x)['b']")); // jython is smart about double
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x)['a'],int)"));
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x)['b'],float)"));
-        //
-        final List<Object> list = Arrays.asList(g.V(1).next(), "hello", map, true);
-        jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(list));
-        assertEquals("[v[1], u'hello', {u'a': 2, u'b': 2.3}, True]", jythonEngine.eval("str(graphson_reader.readObject(x))"));
-        assertEquals(g.V(1).next().toString(), jythonEngine.eval("str(graphson_reader.readObject(x)[0])"));
-        assertEquals("hello", jythonEngine.eval("graphson_reader.readObject(x)[1]"));
-        assertEquals("{u'a': 2, u'b': 2.3}", jythonEngine.eval("str(graphson_reader.readObject(x)[2])"));
-        assertTrue((Boolean) jythonEngine.eval("graphson_reader.readObject(x)[3]"));
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x)[0],Vertex)"));
-        // assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x)[1],str)")); // its python unicode jython object
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x)[2],dict)"));
-        assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x)[3],bool)"));
+        for (final GraphSONVersion version : VERSIONS) {
+            final ScriptEngine jythonEngine = JythonScriptEngineSetup.setup((PyScriptEngine) new ScriptEngineManager().getEngineByName("jython"));
+            jythonEngine.eval("graphson_reader = " + (version.equals(GraphSONVersion.V2_0) ? "graphsonV2d0_reader" : "graphsonV3d0_reader"));
+            final ObjectMapper mapper = GraphSONMapper.build().version(version).create().createMapper();
+            //
+            final Map<String, Number> map = new LinkedHashMap<>();
+            map.put("a", 2);
+            map.put("b", 2.3d);
+            jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(map));
+            assertEquals("{u'a': 2, u'b': 2.3}", jythonEngine.eval("str(graphson_reader.readObject(x))"));
+            assertEquals(2, jythonEngine.eval("graphson_reader.readObject(x)['a']"));
+            assertEquals(2.3d, jythonEngine.eval("graphson_reader.readObject(x)['b']")); // jython is smart about double
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x)['a'],int)"));
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x)['b'],float)"));
+            //
+            final List<Object> list = Arrays.asList(g.V(1).next(), "hello", map, true);
+            jythonEngine.getBindings(ScriptContext.ENGINE_SCOPE).put("x", mapper.writeValueAsString(list));
+            assertEquals("[v[1], u'hello', {u'a': 2, u'b': 2.3}, True]", jythonEngine.eval("str(graphson_reader.readObject(x))"));
+            assertEquals(g.V(1).next().toString(), jythonEngine.eval("str(graphson_reader.readObject(x)[0])"));
+            assertEquals("hello", jythonEngine.eval("graphson_reader.readObject(x)[1]"));
+            assertEquals("{u'a': 2, u'b': 2.3}", jythonEngine.eval("str(graphson_reader.readObject(x)[2])"));
+            assertTrue((Boolean) jythonEngine.eval("graphson_reader.readObject(x)[3]"));
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x)[0],Vertex)"));
+            // assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x)[1],str)")); // its python unicode jython object
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x)[2],dict)"));
+            assertTrue((Boolean) jythonEngine.eval("isinstance(graphson_reader.readObject(x)[3],bool)"));
+        }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fdd1bc3f/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/structure/io/graphson/GraphSONWriterTest.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/structure/io/graphson/GraphSONWriterTest.java b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/structure/io/graphson/GraphSONWriterTest.java
index 2ad1964..3ae4e55 100644
--- a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/structure/io/graphson/GraphSONWriterTest.java
+++ b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/structure/io/graphson/GraphSONWriterTest.java
@@ -39,9 +39,11 @@ import org.python.jsr223.PyScriptEngine;
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
@@ -51,81 +53,109 @@ import static org.junit.Assert.assertTrue;
  */
 public class GraphSONWriterTest {
 
-    private static final ScriptEngine jythonEngine = JythonScriptEngineSetup.setup((PyScriptEngine) new ScriptEngineManager().getEngineByName("jython"));
-    private static final ObjectMapper mapper = GraphSONMapper.build().version(GraphSONVersion.V2_0).create().createMapper();
+    private static final Set<GraphSONVersion> VERSIONS = new HashSet<>(Arrays.asList(GraphSONVersion.V2_0, GraphSONVersion.V3_0));
 
     @Test
     public void shouldSerializeNumbers() throws Exception {
-        assertEquals(1, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(1)").toString(), Object.class));
-        assertEquals(mapper.writeValueAsString(1), jythonEngine.eval("graphson_writer.writeObject(1)").toString().replace(" ", ""));
-        //
-        assertEquals(2L, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(2L)").toString(), Object.class));
-        assertEquals(mapper.writeValueAsString(2L), jythonEngine.eval("graphson_writer.writeObject(2L)").toString().replace(" ", ""));
-        //
-        assertEquals(3.4, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(3.4)").toString(), Object.class));
-        assertEquals(mapper.writeValueAsString(3.4), jythonEngine.eval("graphson_writer.writeObject(3.4)").toString().replace(" ", ""));
+        for (final GraphSONVersion version : VERSIONS) {
+            final ScriptEngine jythonEngine = JythonScriptEngineSetup.setup((PyScriptEngine) new ScriptEngineManager().getEngineByName("jython"));
+            jythonEngine.eval("graphson_writer = " + (version.equals(GraphSONVersion.V2_0) ? "graphsonV2d0_writer" : "graphsonV3d0_writer"));
+            final ObjectMapper mapper = GraphSONMapper.build().version(version).create().createMapper();
+            //
+            assertEquals(1, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(1)").toString(), Object.class));
+            assertEquals(mapper.writeValueAsString(1), jythonEngine.eval("graphson_writer.writeObject(1)").toString().replace(" ", ""));
+            //
+            assertEquals(2L, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(2L)").toString(), Object.class));
+            assertEquals(mapper.writeValueAsString(2L), jythonEngine.eval("graphson_writer.writeObject(2L)").toString().replace(" ", ""));
+            //
+            assertEquals(3.4, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(3.4)").toString(), Object.class));
+            assertEquals(mapper.writeValueAsString(3.4), jythonEngine.eval("graphson_writer.writeObject(3.4)").toString().replace(" ", ""));
+        }
     }
 
     @Test
     public void shouldSerializeCollections() throws Exception {
-        final Map<String, Number> map = new LinkedHashMap<>();
-        map.put("a", 2);
-        map.put("b", 2.3);
-        assertEquals(map, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject({'a':2,'b':2.3})").toString(), Object.class));
-        //
-        final List<Object> list = Arrays.asList(new DefaultRemoteTraverser<>("hello", 3L), "hello", map, true);
-        assertTrue((Boolean) jythonEngine.eval("isinstance([Traverser('hello',3L),'hello',{'a':2,'b':2.3},True],list)"));
-        assertEquals(list, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject([Traverser('hello',3L),'hello',{'a':2,'b':2.3},True])").toString(), Object.class));
+        for (final GraphSONVersion version : VERSIONS) {
+            final ScriptEngine jythonEngine = JythonScriptEngineSetup.setup((PyScriptEngine) new ScriptEngineManager().getEngineByName("jython"));
+            jythonEngine.eval("graphson_writer = " + (version.equals(GraphSONVersion.V2_0) ? "graphsonV2d0_writer" : "graphsonV3d0_writer"));
+            final ObjectMapper mapper = GraphSONMapper.build().version(version).create().createMapper();
+            //
+            final Map<String, Number> map = new LinkedHashMap<>();
+            map.put("a", 2);
+            map.put("b", 2.3);
+            assertEquals(map, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject({'a':2,'b':2.3})").toString(), Object.class));
+            //
+            final List<Object> list = Arrays.asList(new DefaultRemoteTraverser<>("hello", 3L), "hello", map, true);
+            assertTrue((Boolean) jythonEngine.eval("isinstance([Traverser('hello',3L),'hello',{'a':2,'b':2.3},True],list)"));
+            assertEquals(list, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject([Traverser('hello',3L),'hello',{'a':2,'b':2.3},True])").toString(), Object.class));
+        }
     }
 
     @Test
     public void shouldSerializeTraverser() throws Exception {
-        assertEquals(
-                new DefaultRemoteTraverser<>("hello", 3L),
-                mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Traverser('hello',3L))").toString(), Object.class));
-        assertEquals(3L, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Traverser('hello',3L))").toString(), Traverser.class).bulk());
-        assertEquals("hello", mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Traverser('hello',3L))").toString(), Traverser.class).get());
+        for (final GraphSONVersion version : VERSIONS) {
+            final ScriptEngine jythonEngine = JythonScriptEngineSetup.setup((PyScriptEngine) new ScriptEngineManager().getEngineByName("jython"));
+            jythonEngine.eval("graphson_writer = " + (version.equals(GraphSONVersion.V2_0) ? "graphsonV2d0_writer" : "graphsonV3d0_writer"));
+            final ObjectMapper mapper = GraphSONMapper.build().version(version).create().createMapper();
+            //
+            assertEquals(
+                    new DefaultRemoteTraverser<>("hello", 3L),
+                    mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Traverser('hello',3L))").toString(), Object.class));
+            assertEquals(3L, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Traverser('hello',3L))").toString(), Traverser.class).bulk());
+            assertEquals("hello", mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Traverser('hello',3L))").toString(), Traverser.class).get());
+        }
     }
 
     @Test
     public void shouldSerializeBytecode() throws Exception {
-        assertEquals(P.eq(7L), mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(P.eq(7L))").toString(), Object.class));
-        // TODO: assertEquals(mapper.writeValueAsString(P.between(1, 2).and(P.eq(7L))), jythonEngine.eval("graphson_writer.writeObject(P.eq(7L)._and(P.between(1,2)))").toString().replace(" ",""));
-        assertEquals(AndP.class, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(P.eq(7L).and_(P.between(1,2)))").toString(), Object.class).getClass());
-        //
-        assertEquals(new Bytecode.Binding<>("a", 5L), mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Binding('a',5L))").toString(), Object.class));
-        //
-        for (final Column t : Column.values()) {
-            assertEquals(t, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Column." + t.name() + ")").toString(), Object.class));
+        for (final GraphSONVersion version : VERSIONS) {
+            final ScriptEngine jythonEngine = JythonScriptEngineSetup.setup((PyScriptEngine) new ScriptEngineManager().getEngineByName("jython"));
+            jythonEngine.eval("graphson_writer = " + (version.equals(GraphSONVersion.V2_0) ? "graphsonV2d0_writer" : "graphsonV3d0_writer"));
+            final ObjectMapper mapper = GraphSONMapper.build().version(version).create().createMapper();
+            //
+            assertEquals(P.eq(7L), mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(P.eq(7L))").toString(), Object.class));
+            // TODO: assertEquals(mapper.writeValueAsString(P.between(1, 2).and(P.eq(7L))), jythonEngine.eval("graphson_writer.writeObject(P.eq(7L)._and(P.between(1,2)))").toString().replace(" ",""));
+            assertEquals(AndP.class, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(P.eq(7L).and_(P.between(1,2)))").toString(), Object.class).getClass());
+            //
+            assertEquals(new Bytecode.Binding<>("a", 5L), mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Binding('a',5L))").toString(), Object.class));
+            //
+            for (final Column t : Column.values()) {
+                assertEquals(t, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Column." + t.name() + ")").toString(), Object.class));
+            }
+            for (final T t : T.values()) {
+                assertEquals(t, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(T." + t.name() + ")").toString(), Object.class));
+            }
+            assertEquals(Pop.first, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Pop.first)").toString(), Object.class));
+            assertEquals(Pop.last, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Pop.last)").toString(), Object.class));
+            assertEquals(Pop.all, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Pop.all_)").toString(), Object.class));
+            assertEquals(Pop.mixed, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Pop.mixed)").toString(), Object.class));
+            assertEquals(Scope.global, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Scope.global_)").toString(), Object.class));
+            assertEquals(Scope.local, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Scope.local)").toString(), Object.class));
         }
-        for (final T t : T.values()) {
-            assertEquals(t, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(T." + t.name() + ")").toString(), Object.class));
-        }
-        assertEquals(Pop.first, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Pop.first)").toString(), Object.class));
-        assertEquals(Pop.last, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Pop.last)").toString(), Object.class));
-        assertEquals(Pop.all, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Pop.all_)").toString(), Object.class));
-        assertEquals(Pop.mixed, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Pop.mixed)").toString(), Object.class));
-        assertEquals(Scope.global, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Scope.global_)").toString(), Object.class));
-        assertEquals(Scope.local, mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(Scope.local)").toString(), Object.class));
     }
 
     @Test
     public void shouldSerializeLambda() throws Exception {
-        assertEquals(
-                Lambda.function("lambda z : 1+2", "gremlin-python"),
-                mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(lambda : 'z : 1+2')").toString(), Object.class));
-        assertEquals(
-                Lambda.function("lambda z : z+ 7", "gremlin-python"),
-                mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(lambda : 'lambda z : z+ 7')").toString(), Object.class));
-        assertEquals(
-                Lambda.supplier("lambda : 23", "gremlin-python"),
-                mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(lambda : 'lambda : 23')").toString(), Object.class));
-        assertEquals(
-                Lambda.consumer("lambda z : z + 23", "gremlin-python"),
-                mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(lambda : 'lambda z : z + 23')").toString(), Object.class));
-        assertEquals(
-                Lambda.biFunction("lambda z,y : z - y + 2", "gremlin-python"),
-                mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(lambda : 'lambda z,y : z - y + 2')").toString(), Object.class));
+        for (final GraphSONVersion version : VERSIONS) {
+            final ScriptEngine jythonEngine = JythonScriptEngineSetup.setup((PyScriptEngine) new ScriptEngineManager().getEngineByName("jython"));
+            jythonEngine.eval("graphson_writer = " + (version.equals(GraphSONVersion.V2_0) ? "graphsonV2d0_writer" : "graphsonV3d0_writer"));
+            final ObjectMapper mapper = GraphSONMapper.build().version(version).create().createMapper();
+            //
+            assertEquals(
+                    Lambda.function("lambda z : 1+2", "gremlin-python"),
+                    mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(lambda : 'z : 1+2')").toString(), Object.class));
+            assertEquals(
+                    Lambda.function("lambda z : z+ 7", "gremlin-python"),
+                    mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(lambda : 'lambda z : z+ 7')").toString(), Object.class));
+            assertEquals(
+                    Lambda.supplier("lambda : 23", "gremlin-python"),
+                    mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(lambda : 'lambda : 23')").toString(), Object.class));
+            assertEquals(
+                    Lambda.consumer("lambda z : z + 23", "gremlin-python"),
+                    mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(lambda : 'lambda z : z + 23')").toString(), Object.class));
+            assertEquals(
+                    Lambda.biFunction("lambda z,y : z - y + 2", "gremlin-python"),
+                    mapper.readValue(jythonEngine.eval("graphson_writer.writeObject(lambda : 'lambda z,y : z - y + 2')").toString(), Object.class));
+        }
     }
-
 }


[36/50] [abbrv] tinkerpop git commit: TINKERPOP-1427 Make GraphSON 3.0 serializers equivalent to 2.0

Posted by sp...@apache.org.
TINKERPOP-1427 Make GraphSON 3.0 serializers equivalent to 2.0

There were some internal changes to GraphSON 2.0 deserializers that improved performance. Migrated all that to 3.0.


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

Branch: refs/heads/TINKERPOP-1427
Commit: 42a05a7dc48a6d8251301e7839f7eeaf2d765e1d
Parents: 5554fea
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jun 30 12:34:52 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 16:22:19 2017 -0400

----------------------------------------------------------------------
 .../io/graphson/GraphSONSerializersV3d0.java    | 204 +++++++++++++++----
 1 file changed, 163 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/42a05a7d/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java
index b62094e..6f6e011 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java
@@ -35,6 +35,7 @@ import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.Comparators;
 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.DetachedProperty;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty;
@@ -43,18 +44,22 @@ import org.apache.tinkerpop.shaded.jackson.core.JsonGenerationException;
 import org.apache.tinkerpop.shaded.jackson.core.JsonGenerator;
 import org.apache.tinkerpop.shaded.jackson.core.JsonParser;
 import org.apache.tinkerpop.shaded.jackson.core.JsonProcessingException;
+import org.apache.tinkerpop.shaded.jackson.core.JsonToken;
 import org.apache.tinkerpop.shaded.jackson.databind.DeserializationContext;
+import org.apache.tinkerpop.shaded.jackson.databind.JavaType;
+import org.apache.tinkerpop.shaded.jackson.databind.JsonNode;
 import org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider;
 import org.apache.tinkerpop.shaded.jackson.databind.deser.std.StdDeserializer;
 import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer;
+import org.apache.tinkerpop.shaded.jackson.databind.node.ArrayNode;
 import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdKeySerializer;
 import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdScalarSerializer;
 import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdSerializer;
+import org.apache.tinkerpop.shaded.jackson.databind.type.TypeFactory;
 import org.javatuples.Pair;
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -239,8 +244,6 @@ class GraphSONSerializersV3d0 {
 
             jsonGenerator.writeEndObject();
         }
-
-
     }
 
     final static class PathJacksonSerializer extends StdScalarSerializer<Path> {
@@ -254,8 +257,10 @@ class GraphSONSerializersV3d0 {
                 throws IOException, JsonGenerationException {
             jsonGenerator.writeStartObject();
 
-            jsonGenerator.writeObjectField(GraphSONTokens.LABELS, path.labels());
-            jsonGenerator.writeObjectField(GraphSONTokens.OBJECTS, path.objects());
+            // paths shouldn't serialize with properties if the path contains graph elements
+            final Path p = DetachedFactory.detach(path, false);
+            jsonGenerator.writeObjectField(GraphSONTokens.LABELS, p.labels());
+            jsonGenerator.writeObjectField(GraphSONTokens.OBJECTS, p.objects());
 
             jsonGenerator.writeEndObject();
         }
@@ -417,89 +422,191 @@ class GraphSONSerializersV3d0 {
 
     //////////////////////////// DESERIALIZERS ///////////////////////////
 
-
-    static class VertexJacksonDeserializer extends AbstractObjectDeserializer<Vertex> {
+    static class VertexJacksonDeserializer extends StdDeserializer<Vertex> {
 
         public VertexJacksonDeserializer() {
             super(Vertex.class);
         }
 
+        public Vertex deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            final DetachedVertex.Builder v = DetachedVertex.build();
+            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
+                if (jsonParser.getCurrentName().equals(GraphSONTokens.ID)) {
+                    jsonParser.nextToken();
+                    v.setId(deserializationContext.readValue(jsonParser, Object.class));
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.LABEL)) {
+                    jsonParser.nextToken();
+                    v.setLabel(jsonParser.getText());
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.PROPERTIES)) {
+                    jsonParser.nextToken();
+                    while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
+                        jsonParser.nextToken();
+                        while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
+                            v.addProperty((DetachedVertexProperty) deserializationContext.readValue(jsonParser, VertexProperty.class));
+                        }
+                    }
+                }
+            }
+
+            return v.create();
+        }
+
         @Override
-        public Vertex createObject(final Map<String, Object> vertexData) {
-            return new DetachedVertex(
-                    vertexData.get(GraphSONTokens.ID),
-                    vertexData.get(GraphSONTokens.LABEL).toString(),
-                    (Map<String, Object>) vertexData.get(GraphSONTokens.PROPERTIES)
-            );
+        public boolean isCachable() {
+            return true;
         }
     }
 
-    static class EdgeJacksonDeserializer extends AbstractObjectDeserializer<Edge> {
+    static class EdgeJacksonDeserializer extends StdDeserializer<Edge> {
 
         public EdgeJacksonDeserializer() {
             super(Edge.class);
         }
 
         @Override
-        public Edge createObject(final Map<String, Object> edgeData) {
-            return new DetachedEdge(
-                    edgeData.get(GraphSONTokens.ID),
-                    edgeData.get(GraphSONTokens.LABEL).toString(),
-                    (Map) edgeData.get(GraphSONTokens.PROPERTIES),
-                    Pair.with(edgeData.get(GraphSONTokens.OUT), edgeData.get(GraphSONTokens.OUT_LABEL).toString()),
-                    Pair.with(edgeData.get(GraphSONTokens.IN), edgeData.get(GraphSONTokens.IN_LABEL).toString())
-            );
+        public Edge deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            final DetachedEdge.Builder e = DetachedEdge.build();
+            final DetachedVertex.Builder inV = DetachedVertex.build();
+            final DetachedVertex.Builder outV = DetachedVertex.build();
+            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
+                if (jsonParser.getCurrentName().equals(GraphSONTokens.ID)) {
+                    jsonParser.nextToken();
+                    e.setId(deserializationContext.readValue(jsonParser, Object.class));
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.LABEL)) {
+                    jsonParser.nextToken();
+                    e.setLabel(jsonParser.getText());
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.OUT)) {
+                    jsonParser.nextToken();
+                    outV.setId(deserializationContext.readValue(jsonParser, Object.class));
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.OUT_LABEL)) {
+                    jsonParser.nextToken();
+                    outV.setLabel(jsonParser.getText());
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.IN)) {
+                    jsonParser.nextToken();
+                    inV.setId(deserializationContext.readValue(jsonParser, Object.class));
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.IN_LABEL)) {
+                    jsonParser.nextToken();
+                    inV.setLabel(jsonParser.getText());
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.PROPERTIES)) {
+                    jsonParser.nextToken();
+                    while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
+                        jsonParser.nextToken();
+                        e.addProperty(deserializationContext.readValue(jsonParser, Property.class));
+                    }
+                }
+            }
+
+            e.setInV(inV.create());
+            e.setOutV(outV.create());
+
+            return e.create();
+        }
+
+        @Override
+        public boolean isCachable() {
+            return true;
         }
     }
 
-    static class PropertyJacksonDeserializer extends AbstractObjectDeserializer<Property> {
+    static class PropertyJacksonDeserializer extends StdDeserializer<Property> {
 
         public PropertyJacksonDeserializer() {
             super(Property.class);
         }
 
         @Override
-        public Property createObject(final Map<String, Object> propData) {
-            return new DetachedProperty(
-                    (String) propData.get(GraphSONTokens.KEY),
-                    propData.get(GraphSONTokens.VALUE));
+        public Property deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            String key = null;
+            Object value = null;
+            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
+                if (jsonParser.getCurrentName().equals(GraphSONTokens.KEY)) {
+                    jsonParser.nextToken();
+                    key = jsonParser.getText();
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.VALUE)) {
+                    jsonParser.nextToken();
+                    value = deserializationContext.readValue(jsonParser, Object.class);
+                }
+            }
+
+            return new DetachedProperty<>(key, value);
+        }
+
+        @Override
+        public boolean isCachable() {
+            return true;
         }
     }
 
-    static class PathJacksonDeserializer extends AbstractObjectDeserializer<Path> {
+    static class PathJacksonDeserializer extends StdDeserializer<Path> {
+        private static final JavaType setType = TypeFactory.defaultInstance().constructCollectionType(HashSet.class, String.class);
 
         public PathJacksonDeserializer() {
             super(Path.class);
         }
 
         @Override
-        public Path createObject(final Map<String, Object> pathData) {
+        public Path deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            final JsonNode n = jsonParser.readValueAsTree();
             final Path p = MutablePath.make();
 
-            final List labels = (List) pathData.get(GraphSONTokens.LABELS);
-            final List objects = (List) pathData.get(GraphSONTokens.OBJECTS);
+            final ArrayNode labels = (ArrayNode) n.get(GraphSONTokens.LABELS);
+            final ArrayNode objects = (ArrayNode) n.get(GraphSONTokens.OBJECTS);
 
             for (int i = 0; i < objects.size(); i++) {
-                p.extend(objects.get(i), new HashSet((List) labels.get(i)));
+                final JsonParser po = objects.get(i).traverse();
+                po.nextToken();
+                final JsonParser pl = labels.get(i).traverse();
+                pl.nextToken();
+                p.extend(deserializationContext.readValue(po, Object.class), deserializationContext.readValue(pl, setType));
             }
+
             return p;
         }
+
+        @Override
+        public boolean isCachable() {
+            return true;
+        }
     }
 
-    static class VertexPropertyJacksonDeserializer extends AbstractObjectDeserializer<VertexProperty> {
+    static class VertexPropertyJacksonDeserializer extends StdDeserializer<VertexProperty> {
+        private static final JavaType propertiesType = TypeFactory.defaultInstance().constructMapType(HashMap.class, String.class, Object.class);
 
         protected VertexPropertyJacksonDeserializer() {
             super(VertexProperty.class);
         }
 
         @Override
-        public VertexProperty createObject(final Map<String, Object> propData) {
-            return new DetachedVertexProperty(
-                    propData.get(GraphSONTokens.ID),
-                    (String) propData.get(GraphSONTokens.LABEL),
-                    propData.get(GraphSONTokens.VALUE),
-                    (Map) propData.get(GraphSONTokens.PROPERTIES)
-            );
+        public VertexProperty deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            final DetachedVertexProperty.Builder vp = DetachedVertexProperty.build();
+
+            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
+                if (jsonParser.getCurrentName().equals(GraphSONTokens.ID)) {
+                    jsonParser.nextToken();
+                    vp.setId(deserializationContext.readValue(jsonParser, Object.class));
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.LABEL)) {
+                    jsonParser.nextToken();
+                    vp.setLabel(jsonParser.getText());
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.VALUE)) {
+                    jsonParser.nextToken();
+                    vp.setValue(deserializationContext.readValue(jsonParser, Object.class));
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.PROPERTIES)) {
+                    jsonParser.nextToken();
+                    while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
+                        final String key = jsonParser.getCurrentName();
+                        jsonParser.nextToken();
+                        final Object val = deserializationContext.readValue(jsonParser, Object.class);
+                        vp.addProperty(new DetachedProperty(key, val));
+                    }
+                }
+            }
+
+            return vp.create();
+        }
+
+        @Override
+        public boolean isCachable() {
+            return true;
         }
     }
 
@@ -556,6 +663,11 @@ class GraphSONSerializersV3d0 {
             }
             return t;
         }
+
+        @Override
+        public boolean isCachable() {
+            return true;
+        }
     }
 
     static class IntegerJackonsDeserializer extends StdDeserializer<Integer> {
@@ -568,6 +680,11 @@ class GraphSONSerializersV3d0 {
         public Integer deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
             return jsonParser.getIntValue();
         }
+
+        @Override
+        public boolean isCachable() {
+            return true;
+        }
     }
 
     static class DoubleJackonsDeserializer extends StdDeserializer<Double> {
@@ -580,5 +697,10 @@ class GraphSONSerializersV3d0 {
         public Double deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
             return jsonParser.getDoubleValue();
         }
+
+        @Override
+        public boolean isCachable() {
+            return true;
+        }
     }
-}
\ No newline at end of file
+}


[15/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-1427
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
----------------------------------------------------------------------


[24/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);


[37/50] [abbrv] tinkerpop git commit: TINKERPOP-1427 Added g:Map for GraphSON 3.0

Posted by sp...@apache.org.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java
index 66bab80..b65f5c7 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java
@@ -43,7 +43,12 @@ import java.time.YearMonth;
 import java.time.ZoneOffset;
 import java.time.ZonedDateTime;
 import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
+import static org.hamcrest.CoreMatchers.any;
+import static org.hamcrest.Matchers.either;
 import static org.hamcrest.core.StringStartsWith.startsWith;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assume.assumeThat;
@@ -61,6 +66,9 @@ public class GraphSONMapperEmbeddedTypeTest extends AbstractGraphSONTest {
                 {"v2", GraphSONMapper.build().version(GraphSONVersion.V2_0)
                         .addCustomModule(GraphSONXModuleV2d0.build().create(false))
                         .typeInfo(TypeInfo.PARTIAL_TYPES).create().createMapper()},
+                {"v3", GraphSONMapper.build().version(GraphSONVersion.V3_0)
+                        .addCustomModule(GraphSONXModuleV3d0.build().create(false))
+                        .typeInfo(TypeInfo.PARTIAL_TYPES).create().createMapper()}
         });
     }
 
@@ -72,8 +80,23 @@ public class GraphSONMapperEmbeddedTypeTest extends AbstractGraphSONTest {
     public String version;
 
     @Test
+    public void shouldHandleMap() throws Exception {
+        assumeThat(version, startsWith("v3"));
+
+        final Map<Object,Object> o = new HashMap<>();
+        o.put("string key", "string value");
+        o.put(1, 1);
+        o.put(1L, 1L);
+
+        final List<Object> l = Arrays.asList("test", 1, 5L);
+        o.put(l, "crazy");
+
+        assertEquals(o, serializeDeserialize(mapper, o, Map.class));
+    }
+
+    @Test
     public void shouldHandleBiFunctionLambda() throws Exception {
-        assumeThat(version, startsWith("v2"));
+        assumeThat(version, either(startsWith("v2")).or(startsWith("v3")));
 
         final Lambda o = (Lambda) Lambda.biFunction("x,y -> 'test'");
         assertEquals(o, serializeDeserialize(mapper, o, Lambda.class));
@@ -81,7 +104,7 @@ public class GraphSONMapperEmbeddedTypeTest extends AbstractGraphSONTest {
 
     @Test
     public void shouldHandleComparatorLambda() throws Exception {
-        assumeThat(version, startsWith("v2"));
+        assumeThat(version, either(startsWith("v2")).or(startsWith("v3")));
 
         final Lambda o = (Lambda) Lambda.comparator("x,y -> x <=> y");
         assertEquals(o, serializeDeserialize(mapper, o, Lambda.class));
@@ -89,7 +112,7 @@ public class GraphSONMapperEmbeddedTypeTest extends AbstractGraphSONTest {
 
     @Test
     public void shouldHandleConsumerLambda() throws Exception {
-        assumeThat(version, startsWith("v2"));
+        assumeThat(version, either(startsWith("v2")).or(startsWith("v3")));
 
         final Lambda o = (Lambda) Lambda.consumer("x -> x");
         assertEquals(o, serializeDeserialize(mapper, o, Lambda.class));
@@ -97,7 +120,7 @@ public class GraphSONMapperEmbeddedTypeTest extends AbstractGraphSONTest {
 
     @Test
     public void shouldHandleFunctionLambda() throws Exception {
-        assumeThat(version, startsWith("v2"));
+        assumeThat(version, either(startsWith("v2")).or(startsWith("v3")));
 
         final Lambda o = (Lambda) Lambda.function("x -> x");
         assertEquals(o, serializeDeserialize(mapper, o, Lambda.class));
@@ -105,7 +128,7 @@ public class GraphSONMapperEmbeddedTypeTest extends AbstractGraphSONTest {
 
     @Test
     public void shouldHandlePredicateLambda() throws Exception {
-        assumeThat(version, startsWith("v2"));
+        assumeThat(version, either(startsWith("v2")).or(startsWith("v3")));
 
         final Lambda o = (Lambda) Lambda.predicate("x -> true");
         assertEquals(o, serializeDeserialize(mapper, o, Lambda.class));
@@ -113,7 +136,7 @@ public class GraphSONMapperEmbeddedTypeTest extends AbstractGraphSONTest {
 
     @Test
     public void shouldHandleSupplierLambda() throws Exception {
-        assumeThat(version, startsWith("v2"));
+        assumeThat(version, either(startsWith("v2")).or(startsWith("v3")));
 
         final Lambda o = (Lambda) Lambda.supplier("'test'");
         assertEquals(o, serializeDeserialize(mapper, o, Lambda.class));
@@ -121,7 +144,7 @@ public class GraphSONMapperEmbeddedTypeTest extends AbstractGraphSONTest {
 
     @Test
     public void shouldHandleBytecodeBinding() throws Exception {
-        assumeThat(version, startsWith("v2"));
+        assumeThat(version, either(startsWith("v2")).or(startsWith("v3")));
 
         final Bytecode.Binding<String> o = new Bytecode.Binding<>("test", "testing");
         assertEquals(o, serializeDeserialize(mapper, o, Bytecode.Binding.class));
@@ -129,7 +152,7 @@ public class GraphSONMapperEmbeddedTypeTest extends AbstractGraphSONTest {
 
     @Test
     public void shouldHandleTraverser() throws Exception {
-        assumeThat(version, startsWith("v2"));
+        assumeThat(version, either(startsWith("v2")).or(startsWith("v3")));
 
         final Traverser<String> o = new DefaultRemoteTraverser<>("test", 100);
         assertEquals(o, serializeDeserialize(mapper, o, Traverser.class));

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperPartialEmbeddedTypeTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperPartialEmbeddedTypeTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperPartialEmbeddedTypeTest.java
new file mode 100644
index 0000000..de4cc58
--- /dev/null
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperPartialEmbeddedTypeTest.java
@@ -0,0 +1,297 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.structure.io.graphson;
+
+import org.apache.tinkerpop.gremlin.process.remote.traversal.DefaultRemoteTraverser;
+import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.time.Instant;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.StringContains.containsString;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.fail;
+
+/**
+ * Tests automatic typed serialization/deserialization for GraphSON 2.0+.
+ *
+ * @author Kevin Gallardo (https://kgdo.me)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+@RunWith(Parameterized.class)
+public class GraphSONMapperPartialEmbeddedTypeTest extends AbstractGraphSONTest {
+
+    @Parameterized.Parameters(name = "{0}")
+    public static Iterable<Object[]> data() {
+        return Arrays.asList(new Object[][]{
+                {"v2", GraphSONMapper.build().version(GraphSONVersion.V2_0)
+                        .addCustomModule(GraphSONXModuleV2d0.build().create(false))
+                        .typeInfo(TypeInfo.PARTIAL_TYPES).create().createMapper()},
+                {"v3", GraphSONMapper.build().version(GraphSONVersion.V3_0)
+                        .addCustomModule(GraphSONXModuleV3d0.build().create(false))
+                        .typeInfo(TypeInfo.PARTIAL_TYPES).create().createMapper()}
+        });
+    }
+
+    @Parameterized.Parameter(1)
+    public ObjectMapper mapper;
+
+
+    @Parameterized.Parameter(0)
+    public String version;
+
+    @Test
+    public void shouldSerializeDeserializeNestedCollectionsAndMapAndTypedValuesCorrectly() throws Exception {
+        // Trying to fail the TypeDeserializer type detection
+        final UUID uuid = UUID.randomUUID();
+        final List<Object> myList = new ArrayList<>();
+
+        final List<Object> myList2 = new ArrayList<>();
+        myList2.add(UUID.randomUUID());
+        myList2.add(33L);
+        myList2.add(84);
+        final Map<String,Object> map2 = new HashMap<>();
+        map2.put("eheh", UUID.randomUUID());
+        map2.put("normal", "normal");
+        myList2.add(map2);
+
+        final Map<String, Object> map1 = new HashMap<>();
+        map1.put("hello", "world");
+        map1.put("test", uuid);
+        map1.put("hehe", myList2);
+        myList.add(map1);
+
+        myList.add("kjkj");
+        myList.add(UUID.randomUUID());
+        assertEquals(myList, serializeDeserializeAuto(mapper, myList));
+
+        // no "@value" property
+        String s = "{\""+GraphSONTokens.VALUETYPE+"\":\"" + GraphSONTokens.GREMLIN_TYPE_NAMESPACE + ":UUID\", \"test\":2}";
+        Map<String,Object> map = new LinkedHashMap<>();
+        map.put(GraphSONTokens.VALUETYPE, GraphSONTokens.GREMLIN_TYPE_NAMESPACE + ":UUID");
+        map.put("test", 2);
+        Object res = mapper.readValue(s, Object.class);
+        assertEquals(map, res);
+
+        // "@value" and "@type" property reversed
+        s = "{\""+GraphSONTokens.VALUEPROP+"\":2, \"" + GraphSONTokens.VALUETYPE + "\":\"" + GraphSONTokens.GREMLIN_TYPE_NAMESPACE + ":Int64\"}";
+        res = mapper.readValue(s, Object.class);
+        assertEquals(res, 2L);
+        assertEquals(res.getClass(), Long.class);
+
+        // no "@type" property.
+        s = "{\""+GraphSONTokens.VALUEPROP + "\":2, \"id\":2}";
+        map = new LinkedHashMap<>();
+        map.put(GraphSONTokens.VALUEPROP, 2);
+        map.put("id", 2);
+        res = mapper.readValue(s, Object.class);
+        assertEquals(res, map);
+    }
+
+    @Test
+    public void shouldFailIfMoreThanTwoPropertiesInATypePattern() {
+        String s = "{\"" + GraphSONTokens.VALUEPROP + "\":2, \"" + GraphSONTokens.VALUETYPE + "\":\""+GraphSONTokens.GREMLIN_TYPE_NAMESPACE +":Int64\", \"hello\": \"world\"}";
+        try {
+            mapper.readValue(s, Object.class);
+            fail("Should have failed deserializing because there's more than properties in the type.");
+        } catch (IOException e) {
+            assertThat(e.getMessage(), containsString("Detected the type pattern in the JSON payload but the map containing the types and values contains other fields. This is not allowed by the deserializer."));
+        }
+        s = "{\"" + GraphSONTokens.VALUETYPE + "\":\""+GraphSONTokens.GREMLIN_TYPE_NAMESPACE +":Int64\",\"" + GraphSONTokens.VALUEPROP + "\":2, \"hello\": \"world\"}";
+        try {
+            mapper.readValue(s, Object.class);
+            fail("Should have failed deserializing because there's more than properties in the type.");
+        } catch (IOException e) {
+            assertThat(e.getMessage(), containsString("Detected the type pattern in the JSON payload but the map containing the types and values contains other fields. This is not allowed by the deserializer."));
+        }
+    }
+
+    @Test
+    public void shouldFailIfTypeSpecifiedIsNotSameTypeInPayload() {
+        final ZoneOffset o = ZonedDateTime.now().getOffset();
+        final ByteArrayOutputStream stream = new ByteArrayOutputStream();
+        try {
+            mapper.writeValue(stream, o);
+            final InputStream inputStream = new ByteArrayInputStream(stream.toByteArray());
+            // What has been serialized is a ZoneOffset with the type, but the user explicitly requires another type.
+            mapper.readValue(inputStream, Instant.class);
+            fail("Should have failed decoding the value");
+        } catch (Exception e) {
+            assertThat(e.getMessage(), containsString("Could not deserialize the JSON value as required. Nested exception: java.lang.InstantiationException: Cannot deserialize the value with the detected type contained in the JSON ('" + GraphSONTokens.GREMLINX_TYPE_NAMESPACE + ":ZoneOffset') to the type specified in parameter to the object mapper (class java.time.Instant). Those types are incompatible."));
+        }
+    }
+
+    @Test
+    public void shouldHandleRawPOJOs() throws Exception {
+        final FunObject funObject = new FunObject();
+        funObject.setVal("test");
+        assertEquals(funObject.toString(), serializeDeserialize(mapper, funObject, FunObject.class).toString());
+        assertEquals(funObject.getClass(), serializeDeserialize(mapper, funObject, FunObject.class).getClass());
+    }
+
+    @Test
+    public void shouldHandleMapWithTypesUsingEmbedTypeSettingV2d0() throws Exception {
+        final ObjectMapper mapper = GraphSONMapper.build()
+                .version(GraphSONVersion.V2_0)
+                .typeInfo(TypeInfo.PARTIAL_TYPES)
+                .create()
+                .createMapper();
+
+        final Map<String,Object> m = new HashMap<>();
+        m.put("test", 100L);
+
+        final String json = mapper.writeValueAsString(m);
+        final Map read = mapper.readValue(json, HashMap.class);
+
+        assertEquals(100L, read.get("test"));
+    }
+
+    @Test
+    public void shouldNotHandleMapWithTypesUsingEmbedTypeSettingV2d0() throws Exception {
+        final ObjectMapper mapper = GraphSONMapper.build()
+                .version(GraphSONVersion.V2_0)
+                .typeInfo(TypeInfo.NO_TYPES)
+                .create()
+                .createMapper();
+
+        final Map<String,Object> m = new HashMap<>();
+        m.put("test", 100L);
+
+        final String json = mapper.writeValueAsString(m);
+        final Map read = mapper.readValue(json, HashMap.class);
+
+        assertEquals(100, read.get("test"));
+    }
+
+    @Test
+    public void shouldHandleMapWithTypesUsingEmbedTypeSettingV1d0() throws Exception {
+        final ObjectMapper mapper = GraphSONMapper.build()
+                .version(GraphSONVersion.V1_0)
+                .typeInfo(TypeInfo.PARTIAL_TYPES)
+                .create()
+                .createMapper();
+
+        final Map<String,Object> m = new HashMap<>();
+        m.put("test", 100L);
+
+        final String json = mapper.writeValueAsString(m);
+        final Map read = mapper.readValue(json, HashMap.class);
+
+        assertEquals(100L, read.get("test"));
+    }
+
+    @Test
+    public void shouldNotHandleMapWithTypesUsingEmbedTypeSettingV1d0() throws Exception {
+        final ObjectMapper mapper = GraphSONMapper.build()
+                .version(GraphSONVersion.V1_0)
+                .typeInfo(TypeInfo.NO_TYPES)
+                .create()
+                .createMapper();
+
+        final Map<String,Object> m = new HashMap<>();
+        m.put("test", 100L);
+
+        final String json = mapper.writeValueAsString(m);
+        final Map read = mapper.readValue(json, HashMap.class);
+
+        assertEquals(100, read.get("test"));
+    }
+
+    @Test
+    public void shouldLooseTypesInfoWithGraphSONNoType() throws Exception {
+        final ObjectMapper mapper = GraphSONMapper.build()
+                .version(GraphSONVersion.V2_0)
+                .typeInfo(TypeInfo.NO_TYPES)
+                .create()
+                .createMapper();
+
+        final UUID uuid = UUID.randomUUID();
+        final List<Object> myList = new ArrayList<>();
+
+        final List<Object> myList2 = new ArrayList<>();
+        myList2.add(UUID.randomUUID());
+        myList2.add(33L);
+        myList2.add(84);
+        final Map<String,Object> map2 = new HashMap<>();
+        map2.put("eheh", UUID.randomUUID());
+        map2.put("normal", "normal");
+        myList2.add(map2);
+
+        final Map<String, Object> map1 = new HashMap<>();
+        map1.put("hello", "world");
+        map1.put("test", uuid);
+        map1.put("hehe", myList2);
+        myList.add(map1);
+
+        myList.add("kjkj");
+        myList.add(UUID.randomUUID());
+
+        final String json = mapper.writeValueAsString(myList);
+        final Object read = mapper.readValue(json, Object.class);
+
+        // Not equals because of type loss
+        assertNotEquals(myList, read);
+    }
+
+    @Test
+    public void shouldHandleDefaultRemoteTraverser() throws Exception {
+        final DefaultRemoteTraverser<String> o = new DefaultRemoteTraverser<>("test", 100);
+        assertEquals(o, serializeDeserialize(mapper, o, Traverser.class));
+    }
+
+    // Class needs to be defined as statics as it's a nested class.
+    public static class FunObject {
+        private String val;
+
+        public FunObject() {
+        }
+
+        public String getVal() {
+            return this.val;
+        }
+
+        public void setVal(String s) {
+            this.val = s;
+        }
+
+        public String toString() {
+            return this.val;
+        }
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperTest.java
index 96bd9d6..e76b32e 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperTest.java
@@ -48,6 +48,9 @@ import static org.junit.Assert.assertEquals;
 @RunWith(Parameterized.class)
 public class GraphSONMapperTest {
 
+    /**
+     * No need to test V3 as it does not have an option to be constructed without types
+     */
     @Parameterized.Parameters(name = "{0}")
     public static Iterable<Object[]> data() {
         return Arrays.asList(new Object[][]{

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperV2d0PartialEmbeddedTypeTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperV2d0PartialEmbeddedTypeTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperV2d0PartialEmbeddedTypeTest.java
deleted file mode 100644
index 45bb2b1..0000000
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperV2d0PartialEmbeddedTypeTest.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.structure.io.graphson;
-
-import org.apache.tinkerpop.gremlin.process.remote.traversal.DefaultRemoteTraverser;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper;
-import org.junit.Test;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.time.Instant;
-import java.time.ZoneOffset;
-import java.time.ZonedDateTime;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.StringContains.containsString;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.fail;
-
-/**
- * Tests automatic typed serialization/deserialization for GraphSON 2.0.
- */
-public class GraphSONMapperV2d0PartialEmbeddedTypeTest extends AbstractGraphSONTest {
-
-    private final ObjectMapper mapper = GraphSONMapper.build()
-            .version(GraphSONVersion.V2_0)
-            .addCustomModule(GraphSONXModuleV2d0.build().create(false))
-            .typeInfo(TypeInfo.PARTIAL_TYPES)
-            .create()
-            .createMapper();
-
-    @Test
-    public void shouldSerializeDeserializeNestedCollectionsAndMapAndTypedValuesCorrectly() throws Exception {
-        // Trying to fail the TypeDeserializer type detection
-        final UUID uuid = UUID.randomUUID();
-        final List<Object> myList = new ArrayList<>();
-
-        final List<Object> myList2 = new ArrayList<>();
-        myList2.add(UUID.randomUUID());
-        myList2.add(33L);
-        myList2.add(84);
-        final Map<String,Object> map2 = new HashMap<>();
-        map2.put("eheh", UUID.randomUUID());
-        map2.put("normal", "normal");
-        myList2.add(map2);
-
-        final Map<String, Object> map1 = new HashMap<>();
-        map1.put("hello", "world");
-        map1.put("test", uuid);
-        map1.put("hehe", myList2);
-        myList.add(map1);
-
-        myList.add("kjkj");
-        myList.add(UUID.randomUUID());
-        assertEquals(myList, serializeDeserializeAuto(mapper, myList));
-
-        // no "@value" property
-        String s = "{\""+GraphSONTokens.VALUETYPE+"\":\"" + GraphSONTokens.GREMLIN_TYPE_NAMESPACE + ":UUID\", \"test\":2}";
-        Map<String,Object> map = new LinkedHashMap<>();
-        map.put(GraphSONTokens.VALUETYPE, GraphSONTokens.GREMLIN_TYPE_NAMESPACE + ":UUID");
-        map.put("test", 2);
-        Object res = mapper.readValue(s, Object.class);
-        assertEquals(map, res);
-
-        // "@value" and "@type" property reversed
-        s = "{\""+GraphSONTokens.VALUEPROP+"\":2, \"" + GraphSONTokens.VALUETYPE + "\":\"" + GraphSONTokens.GREMLIN_TYPE_NAMESPACE + ":Int64\"}";
-        res = mapper.readValue(s, Object.class);
-        assertEquals(res, 2L);
-        assertEquals(res.getClass(), Long.class);
-
-        // no "@type" property.
-        s = "{\""+GraphSONTokens.VALUEPROP + "\":2, \"id\":2}";
-        map = new LinkedHashMap<>();
-        map.put(GraphSONTokens.VALUEPROP, 2);
-        map.put("id", 2);
-        res = mapper.readValue(s, Object.class);
-        assertEquals(res, map);
-    }
-
-    @Test
-    public void shouldFailIfMoreThanTwoPropertiesInATypePattern() {
-        String s = "{\"" + GraphSONTokens.VALUEPROP + "\":2, \"" + GraphSONTokens.VALUETYPE + "\":\""+GraphSONTokens.GREMLIN_TYPE_NAMESPACE +":Int64\", \"hello\": \"world\"}";
-        try {
-            mapper.readValue(s, Object.class);
-            fail("Should have failed deserializing because there's more than properties in the type.");
-        } catch (IOException e) {
-            assertThat(e.getMessage(), containsString("Detected the type pattern in the JSON payload but the map containing the types and values contains other fields. This is not allowed by the deserializer."));
-        }
-        s = "{\"" + GraphSONTokens.VALUETYPE + "\":\""+GraphSONTokens.GREMLIN_TYPE_NAMESPACE +":Int64\",\"" + GraphSONTokens.VALUEPROP + "\":2, \"hello\": \"world\"}";
-        try {
-            mapper.readValue(s, Object.class);
-            fail("Should have failed deserializing because there's more than properties in the type.");
-        } catch (IOException e) {
-            assertThat(e.getMessage(), containsString("Detected the type pattern in the JSON payload but the map containing the types and values contains other fields. This is not allowed by the deserializer."));
-        }
-    }
-
-    @Test
-    public void shouldFailIfTypeSpecifiedIsNotSameTypeInPayload() {
-        final ZoneOffset o = ZonedDateTime.now().getOffset();
-        final ByteArrayOutputStream stream = new ByteArrayOutputStream();
-        try {
-            mapper.writeValue(stream, o);
-            final InputStream inputStream = new ByteArrayInputStream(stream.toByteArray());
-            // What has been serialized is a ZoneOffset with the type, but the user explicitly requires another type.
-            mapper.readValue(inputStream, Instant.class);
-            fail("Should have failed decoding the value");
-        } catch (Exception e) {
-            assertThat(e.getMessage(), containsString("Could not deserialize the JSON value as required. Nested exception: java.lang.InstantiationException: Cannot deserialize the value with the detected type contained in the JSON ('" + GraphSONTokens.GREMLINX_TYPE_NAMESPACE + ":ZoneOffset') to the type specified in parameter to the object mapper (class java.time.Instant). Those types are incompatible."));
-        }
-    }
-
-    @Test
-    public void shouldHandleRawPOJOs() throws Exception {
-        final FunObject funObject = new FunObject();
-        funObject.setVal("test");
-        assertEquals(funObject.toString(), serializeDeserialize(mapper, funObject, FunObject.class).toString());
-        assertEquals(funObject.getClass(), serializeDeserialize(mapper, funObject, FunObject.class).getClass());
-    }
-
-    @Test
-    public void shouldHandleMapWithTypesUsingEmbedTypeSettingV2d0() throws Exception {
-        final ObjectMapper mapper = GraphSONMapper.build()
-                .version(GraphSONVersion.V2_0)
-                .typeInfo(TypeInfo.PARTIAL_TYPES)
-                .create()
-                .createMapper();
-
-        final Map<String,Object> m = new HashMap<>();
-        m.put("test", 100L);
-
-        final String json = mapper.writeValueAsString(m);
-        final Map read = mapper.readValue(json, HashMap.class);
-
-        assertEquals(100L, read.get("test"));
-    }
-
-    @Test
-    public void shouldNotHandleMapWithTypesUsingEmbedTypeSettingV2d0() throws Exception {
-        final ObjectMapper mapper = GraphSONMapper.build()
-                .version(GraphSONVersion.V2_0)
-                .typeInfo(TypeInfo.NO_TYPES)
-                .create()
-                .createMapper();
-
-        final Map<String,Object> m = new HashMap<>();
-        m.put("test", 100L);
-
-        final String json = mapper.writeValueAsString(m);
-        final Map read = mapper.readValue(json, HashMap.class);
-
-        assertEquals(100, read.get("test"));
-    }
-
-    @Test
-    public void shouldHandleMapWithTypesUsingEmbedTypeSettingV1d0() throws Exception {
-        final ObjectMapper mapper = GraphSONMapper.build()
-                .version(GraphSONVersion.V1_0)
-                .typeInfo(TypeInfo.PARTIAL_TYPES)
-                .create()
-                .createMapper();
-
-        final Map<String,Object> m = new HashMap<>();
-        m.put("test", 100L);
-
-        final String json = mapper.writeValueAsString(m);
-        final Map read = mapper.readValue(json, HashMap.class);
-
-        assertEquals(100L, read.get("test"));
-    }
-
-    @Test
-    public void shouldNotHandleMapWithTypesUsingEmbedTypeSettingV1d0() throws Exception {
-        final ObjectMapper mapper = GraphSONMapper.build()
-                .version(GraphSONVersion.V1_0)
-                .typeInfo(TypeInfo.NO_TYPES)
-                .create()
-                .createMapper();
-
-        final Map<String,Object> m = new HashMap<>();
-        m.put("test", 100L);
-
-        final String json = mapper.writeValueAsString(m);
-        final Map read = mapper.readValue(json, HashMap.class);
-
-        assertEquals(100, read.get("test"));
-    }
-
-    @Test
-    public void shouldLooseTypesInfoWithGraphSONNoType() throws Exception {
-        final ObjectMapper mapper = GraphSONMapper.build()
-                .version(GraphSONVersion.V2_0)
-                .typeInfo(TypeInfo.NO_TYPES)
-                .create()
-                .createMapper();
-
-        final UUID uuid = UUID.randomUUID();
-        final List<Object> myList = new ArrayList<>();
-
-        final List<Object> myList2 = new ArrayList<>();
-        myList2.add(UUID.randomUUID());
-        myList2.add(33L);
-        myList2.add(84);
-        final Map<String,Object> map2 = new HashMap<>();
-        map2.put("eheh", UUID.randomUUID());
-        map2.put("normal", "normal");
-        myList2.add(map2);
-
-        final Map<String, Object> map1 = new HashMap<>();
-        map1.put("hello", "world");
-        map1.put("test", uuid);
-        map1.put("hehe", myList2);
-        myList.add(map1);
-
-        myList.add("kjkj");
-        myList.add(UUID.randomUUID());
-
-        final String json = mapper.writeValueAsString(myList);
-        final Object read = mapper.readValue(json, Object.class);
-
-        // Not equals because of type loss
-        assertNotEquals(myList, read);
-    }
-
-    @Test
-    public void shouldHandleDefaultRemoteTraverser() throws Exception {
-        final DefaultRemoteTraverser<String> o = new DefaultRemoteTraverser<>("test", 100);
-        assertEquals(o, serializeDeserialize(mapper, o, Traverser.class));
-    }
-
-    // Class needs to be defined as statics as it's a nested class.
-    public static class FunObject {
-        private String val;
-
-        public FunObject() {
-        }
-
-        public String getVal() {
-            return this.val;
-        }
-
-        public void setVal(String s) {
-            this.val = s;
-        }
-
-        public String toString() {
-            return this.val;
-        }
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV3d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV3d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV3d0Test.java
index c1e43b5..b4f49d7 100644
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV3d0Test.java
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV3d0Test.java
@@ -34,7 +34,6 @@ import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 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.jackson.databind.util.StdDateFormat;
 import org.junit.Test;
 
 import java.util.ArrayList;
@@ -132,15 +131,15 @@ public class GraphSONMessageSerializerV3d0Test {
         final ResponseMessage response = convert(IteratorUtils.asList(map.entrySet()));
         assertCommon(response);
 
-        final List<Map<String, Object>> deserializedEntries = (List<Map<String, Object>>) response.getResult().getData();
+        final List<Map.Entry<Object, Object>> deserializedEntries = (List<Map.Entry<Object, Object>>) response.getResult().getData();
         assertEquals(3, deserializedEntries.size());
         deserializedEntries.forEach(e -> {
-            if (e.containsKey("x"))
-                assertEquals(1, e.get("x"));
-            else if (e.containsKey(v1.id().toString()))
-                assertEquals(100, e.get(v1.id().toString()));
-            else if (e.containsKey(StdDateFormat.instance.format(d)))
-                assertEquals("test", e.get(StdDateFormat.instance.format(d)));
+            if (e.getKey().equals("x"))
+                assertEquals(1, e.getValue());
+            else if (e.getKey() instanceof Vertex && e.getKey().equals(v1))
+                assertEquals(100, e.getValue());
+            else if (e.getKey() instanceof Date)
+                assertEquals("test", e.getValue());
             else
                 fail("Map entries contains a key that is not part of what was serialized");
         });
@@ -246,17 +245,15 @@ public class GraphSONMessageSerializerV3d0Test {
         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 Vertex v1 = g.V().has("name", "marko").next();
+        map.put(v1, 1000);
 
         final ResponseMessage response = convert(map);
         assertCommon(response);
 
-        final Map<String, Integer> deserializedMap = (Map<String, Integer>) response.getResult().getData();
+        final Map<Vertex, Integer> deserializedMap = (Map<Vertex, Integer>) response.getResult().getData();
         assertEquals(1, deserializedMap.size());
-
-        // with no embedded types the key (which is a vertex) simply serializes out to an id
-        // {"result":{"1":1000},"code":200,"requestId":"2d62161b-9544-4f39-af44-62ec49f9a595","type":0}
-        assertEquals(new Integer(1000), deserializedMap.get("1"));
+        assertEquals(new Integer(1000), deserializedMap.get(v1));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonGraphSONJavaTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonGraphSONJavaTranslator.java b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonGraphSONJavaTranslator.java
index df3bb9d..9f6dfbd 100644
--- a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonGraphSONJavaTranslator.java
+++ b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonGraphSONJavaTranslator.java
@@ -31,6 +31,7 @@ import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONReader;
 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.GraphSONXModuleV2d0;
+import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONXModuleV3d0;
 import org.apache.tinkerpop.shaded.jackson.core.JsonFactory;
 import org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper;
 
@@ -53,10 +54,10 @@ final class PythonGraphSONJavaTranslator<S extends TraversalSource, T extends Tr
     private final JavaTranslator<S, T> javaTranslator;
     private final GraphSONReader reader = GraphSONReader.build().mapper(
             GraphSONMapper.build().addCustomModule(GraphSONXModuleV2d0.build().create(false))
-                    .version(GraphSONVersion.V3_0).create()).create();
+                    .version(GraphSONVersion.V2_0).create()).create();
     private final GraphSONWriter writer = GraphSONWriter.build().mapper(
             GraphSONMapper.build().addCustomModule(GraphSONXModuleV2d0.build().create(false))
-                    .version(GraphSONVersion.V3_0).create()).create();
+                    .version(GraphSONVersion.V2_0).create()).create();
 
     public PythonGraphSONJavaTranslator(final PythonTranslator pythonTranslator, final JavaTranslator<S, T> javaTranslator) {
         this.pythonTranslator = pythonTranslator;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/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 efed270..cdc3808 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
@@ -800,6 +800,40 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
     }
 
     @Test
+    public void shouldWorkWithGraphSONV3Serialization() throws Exception {
+        final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON_V3D0).create();
+        final Client client = cluster.connect();
+
+        final List<Result> r = client.submit("TinkerFactory.createModern().traversal().V(1)").all().join();
+        assertEquals(1, r.size());
+
+        final Vertex v = r.get(0).get(DetachedVertex.class);
+        assertEquals(1, v.id());
+        assertEquals("person", v.label());
+
+        assertEquals(2, IteratorUtils.count(v.properties()));
+        assertEquals("marko", v.value("name"));
+        assertEquals(29, Integer.parseInt(v.value("age").toString()));
+
+        cluster.close();
+    }
+
+    @Test
+    public void shouldWorkWithGraphSONExtendedV3Serialization() throws Exception {
+        final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON_V3D0).create();
+        final Client client = cluster.connect();
+
+        final Instant now = Instant.now();
+        final List<Result> r = client.submit("java.time.Instant.ofEpochMilli(" + now.toEpochMilli() + ")").all().join();
+        assertEquals(1, r.size());
+
+        final Instant then = r.get(0).get(Instant.class);
+        assertEquals(now, then);
+
+        cluster.close();
+    }
+
+    @Test
     @org.junit.Ignore("Can't seem to make this test pass consistently")
     public void shouldHandleRequestSentThatNeverReturns() throws Exception {
         final Cluster cluster = TestClientFactory.open();

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
index 5d90f9c..bcce801 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
@@ -23,6 +23,8 @@ import org.apache.http.client.methods.HttpGet;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.util.EntityUtils;
+import org.apache.log4j.Appender;
+import org.apache.log4j.LogManager;
 import org.apache.log4j.Logger;
 import org.apache.log4j.spi.LoggingEvent;
 import static org.apache.log4j.Level.INFO;
@@ -336,6 +338,11 @@ public class GremlinServerAuditLogIntegrateTest extends AbstractGremlinServerInt
             cluster.close();
             cluster2.close();
         }
+
+        // for some reason a pause here helps the server "catch-up" logging messages.  hopefully this reduces the
+        // number of failed tests here
+        Thread.sleep(3000);
+
         final List<LoggingEvent> log = recordingAppender.getEvents();
         final Stream<LoggingEvent> auditEvents = log.stream().filter(event -> event.getLoggerName().equals(AUDIT_LOGGER_NAME));
         final Iterator<LoggingEvent> authEvents = auditEvents

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
index ec878de..643657f 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
@@ -749,7 +749,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
             assertEquals(true, node.get("result").get("data").get(0).isObject());
-            assertEquals(1, node.get("result").get("data").get(0).get("y").get("@value").asInt());
+            assertEquals(1, node.get("result").get("data").get(0).get("@value").get(1).get("@value").asInt());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
index 90076d5..105e19d 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
@@ -809,7 +809,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
 
     @Test
     public void shouldReceiveFailureOnBadGraphSONSerialization() throws Exception {
-        final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON_V2D0).create();
+        final Cluster cluster = TestClientFactory.build().serializer(Serializers.GRAPHSON_V3D0).create();
         final Client client = cluster.connect();
 
         try {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/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 90934af..705874d 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
@@ -59,7 +59,8 @@ public class IoCustomTest extends AbstractGremlinTest {
         final SimpleModule moduleV1d0 = new SimpleModule();
         moduleV1d0.addSerializer(CustomId.class, new CustomId.CustomIdJacksonSerializerV1d0());
 
-        final SimpleModule moduleV2d0 = new CustomId.CustomIdTinkerPopJacksonModule();
+        final SimpleModule moduleV2d0 = new CustomId.CustomIdTinkerPopJacksonModuleV2d0();
+        final SimpleModule modulev3d0 = new CustomId.CustomIdTinkerPopJacksonModuleV3d0();
 
         return Arrays.asList(new Object[][]{
                 {"graphson-v1-embedded", true,
@@ -69,8 +70,8 @@ public class IoCustomTest extends AbstractGremlinTest {
                         (Function<Graph, GraphReader>) g -> g.io(IoCore.graphson()).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().addCustomModule(moduleV2d0).typeInfo(TypeInfo.PARTIAL_TYPES).create()).create(),
                         (Function<Graph, GraphWriter>) g -> g.io(IoCore.graphson()).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V2_0)).mapper().addCustomModule(moduleV2d0).typeInfo(TypeInfo.PARTIAL_TYPES).create()).create()},
                 {"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()},
+                        (Function<Graph, GraphReader>) g -> g.io(IoCore.graphson()).reader().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().addCustomModule(moduleV3d0).create()).create(),
+                        (Function<Graph, GraphWriter>) g -> g.io(IoCore.graphson()).writer().mapper(g.io(GraphSONIo.build(GraphSONVersion.V3_0)).mapper().addCustomModule(moduleV3d0).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()},

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
index 7434f1f..bc0bf0a 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
@@ -597,7 +597,7 @@ public class IoTest {
             final UUID id = UUID.fromString("AF4B5965-B176-4552-B3C1-FBBE2F52C305");
             graph.addVertex(T.id, new CustomId("vertex", id));
 
-            final SimpleModule module = new CustomId.CustomIdTinkerPopJacksonModule();
+            final SimpleModule module = new CustomId.CustomIdTinkerPopJacksonModuleV2d0();
             final GraphWriter writer = graph.io(graphson).writer().mapper(
                     graph.io(graphson).mapper().version(GraphSONVersion.V2_0).addCustomModule(module).create()).create();
 
@@ -720,7 +720,7 @@ public class IoTest {
             final UUID id = UUID.fromString("AF4B5965-B176-4552-B3C1-FBBE2F52C305");
             graph.addVertex(T.id, new CustomId("vertex", id));
 
-            final SimpleModule module = new CustomId.CustomIdTinkerPopJacksonModule();
+            final SimpleModule module = new CustomId.CustomIdTinkerPopJacksonModuleV3d0();
             final GraphWriter writer = graph.io(graphson).writer().mapper(
                     graph.io(graphson).mapper().version(GraphSONVersion.V3_0).addCustomModule(module).create()).create();
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/util/CustomId.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/util/CustomId.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/util/CustomId.java
index 2277247..d503ae8 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/util/CustomId.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/util/CustomId.java
@@ -23,9 +23,13 @@ import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.TinkerPopJacksonModule;
 import org.apache.tinkerpop.shaded.jackson.core.JsonGenerationException;
 import org.apache.tinkerpop.shaded.jackson.core.JsonGenerator;
+import org.apache.tinkerpop.shaded.jackson.core.JsonParser;
 import org.apache.tinkerpop.shaded.jackson.core.JsonProcessingException;
+import org.apache.tinkerpop.shaded.jackson.databind.DeserializationContext;
 import org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider;
+import org.apache.tinkerpop.shaded.jackson.databind.deser.std.StdDeserializer;
 import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer;
+import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdScalarSerializer;
 import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdSerializer;
 
 import java.io.IOException;
@@ -136,14 +140,14 @@ public class CustomId {
         }
     }
 
-    public static class CustomIdTinkerPopJacksonModule extends TinkerPopJacksonModule {
+    public static class CustomIdTinkerPopJacksonModuleV2d0 extends TinkerPopJacksonModule {
 
         private static final Map<Class, String> TYPE_DEFINITIONS = Collections.unmodifiableMap(
                 new LinkedHashMap<Class, String>() {{
                     put(CustomId.class, "id");
                 }});
 
-        public CustomIdTinkerPopJacksonModule() {
+        public CustomIdTinkerPopJacksonModuleV2d0() {
             super("custom");
             addSerializer(CustomId.class, new CustomIdJacksonSerializerV2d0());
             addDeserializer(CustomId.class, new CustomIdJacksonDeserializerV2d0());
@@ -159,4 +163,60 @@ public class CustomId {
             return "simple";
         }
     }
+
+    public static class CustomIdJacksonSerializerV3d0 extends StdScalarSerializer<CustomId> {
+        public CustomIdJacksonSerializerV3d0() {
+            super(CustomId.class);
+        }
+
+        @Override
+        public void serialize(final CustomId customId, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
+                throws IOException, JsonGenerationException {
+            final Map<String, Object> m = new HashMap<>();
+            m.put("cluster", customId.getCluster());
+            m.put("elementId", customId.getElementId());
+            jsonGenerator.writeObject(m);
+        }
+    }
+
+    public static class CustomIdJacksonDeserializerV3d0 extends StdDeserializer<CustomId> {
+        public CustomIdJacksonDeserializerV3d0() {
+            super(CustomId.class);
+        }
+
+        @Override
+        public CustomId deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            final Map<String, Object> data = deserializationContext.readValue(jsonParser, Map.class);
+            return new CustomId((String) data.get("cluster"), (UUID) data.get("elementId"));
+        }
+
+        @Override
+        public boolean isCachable() {
+            return true;
+        }
+    }
+
+    public static class CustomIdTinkerPopJacksonModuleV3d0 extends TinkerPopJacksonModule {
+
+        private static final Map<Class, String> TYPE_DEFINITIONS = Collections.unmodifiableMap(
+                new LinkedHashMap<Class, String>() {{
+                    put(CustomId.class, "id");
+                }});
+
+        public CustomIdTinkerPopJacksonModuleV3d0() {
+            super("custom");
+            addSerializer(CustomId.class, new CustomIdJacksonSerializerV3d0());
+            addDeserializer(CustomId.class, new CustomIdJacksonDeserializerV3d0());
+        }
+
+        @Override
+        public Map<Class, String> getTypeDefinitions() {
+            return TYPE_DEFINITIONS;
+        }
+
+        @Override
+        public String getTypeNamespace() {
+            return "simple";
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-tools/gremlin-io-test/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypedCompatibilityTest.java
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypedCompatibilityTest.java b/gremlin-tools/gremlin-io-test/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypedCompatibilityTest.java
index bf87d89..b2c63da 100644
--- a/gremlin-tools/gremlin-io-test/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypedCompatibilityTest.java
+++ b/gremlin-tools/gremlin-io-test/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypedCompatibilityTest.java
@@ -21,6 +21,7 @@ package org.apache.tinkerpop.gremlin.structure.io.graphson;
 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.jackson.databind.ObjectMapper;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -41,9 +42,9 @@ public class GraphSONTypedCompatibilityTest extends AbstractTypedCompatibilityTe
             version(GraphSONVersion.V2_0).create().createMapper();
 
     private static ObjectMapper mapperV3 = GraphSONMapper.build().
-            addRegistry(TinkerIoRegistryV2d0.instance()).
-            addCustomModule(GraphSONXModuleV2d0.build().create(false)).
-            addCustomModule(new org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV2d0.GremlinServerModule()).
+            addRegistry(TinkerIoRegistryV3d0.instance()).
+            addCustomModule(GraphSONXModuleV3d0.build().create(false)).
+            addCustomModule(new org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0.GremlinServerModule()).
             version(GraphSONVersion.V3_0).create().createMapper();
 
     @Parameterized.Parameters(name = "expect({0})")

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/authenticationchallenge-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/authenticationchallenge-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/authenticationchallenge-v3d0.json
index 8c5b82c..d1734c6 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/authenticationchallenge-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/authenticationchallenge-v3d0.json
@@ -3,10 +3,16 @@
   "status" : {
     "message" : "",
     "code" : 407,
-    "attributes" : { }
+    "attributes" : {
+      "@type" : "g:Map",
+      "@value" : [ ]
+    }
   },
   "result" : {
     "data" : null,
-    "meta" : { }
+    "meta" : {
+      "@type" : "g:Map",
+      "@value" : [ ]
+    }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/authenticationresponse-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/authenticationresponse-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/authenticationresponse-v3d0.json
index 838e1fd..daceca2 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/authenticationresponse-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/authenticationresponse-v3d0.json
@@ -3,7 +3,7 @@
   "op" : "authentication",
   "processor" : "",
   "args" : {
-    "saslMechanism" : "PLAIN",
-    "sasl" : "AHN0ZXBocGhlbgBwYXNzd29yZA=="
+    "@type" : "g:Map",
+    "@value" : [ "saslMechanism", "PLAIN", "sasl", "AHN0ZXBocGhlbgBwYXNzd29yZA==" ]
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/metrics-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/metrics-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/metrics-v3d0.json
index 7b1e964..b4f86cd 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/metrics-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/metrics-v3d0.json
@@ -1,54 +1,49 @@
 {
   "@type" : "g:Metrics",
   "@value" : {
-    "dur" : {
+    "@type" : "g:Map",
+    "@value" : [ "dur", {
       "@type" : "g:Double",
       "@value" : 100.0
-    },
-    "counts" : {
-      "traverserCount" : {
+    }, "counts", {
+      "@type" : "g:Map",
+      "@value" : [ "traverserCount", {
         "@type" : "g:Int64",
         "@value" : 4
-      },
-      "elementCount" : {
+      }, "elementCount", {
         "@type" : "g:Int64",
         "@value" : 4
-      }
-    },
-    "name" : "TinkerGraphStep(vertex,[~label.eq(person)])",
-    "annotations" : {
-      "percentDur" : {
+      } ]
+    }, "name", "TinkerGraphStep(vertex,[~label.eq(person)])", "annotations", {
+      "@type" : "g:Map",
+      "@value" : [ "percentDur", {
         "@type" : "g:Double",
         "@value" : 25.0
-      }
-    },
-    "id" : "7.0.0()",
-    "metrics" : [ {
+      } ]
+    }, "id", "7.0.0()", "metrics", [ {
       "@type" : "g:Metrics",
       "@value" : {
-        "dur" : {
+        "@type" : "g:Map",
+        "@value" : [ "dur", {
           "@type" : "g:Double",
           "@value" : 100.0
-        },
-        "counts" : {
-          "traverserCount" : {
+        }, "counts", {
+          "@type" : "g:Map",
+          "@value" : [ "traverserCount", {
             "@type" : "g:Int64",
             "@value" : 7
-          },
-          "elementCount" : {
+          }, "elementCount", {
             "@type" : "g:Int64",
             "@value" : 7
-          }
-        },
-        "name" : "VertexStep(OUT,vertex)",
-        "annotations" : {
-          "percentDur" : {
+          } ]
+        }, "name", "VertexStep(OUT,vertex)", "annotations", {
+          "@type" : "g:Map",
+          "@value" : [ "percentDur", {
             "@type" : "g:Double",
             "@value" : 25.0
-          }
-        },
-        "id" : "3.0.0()"
+          } ]
+        }, "id", "3.0.0()" ]
       }
-    } ]
+    } ] ]
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/path-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/path-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/path-v3d0.json
index 54ff76d..9ccaa00 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/path-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/path-v3d0.json
@@ -9,97 +9,7 @@
           "@type" : "g:Int32",
           "@value" : 1
         },
-        "label" : "person",
-        "properties" : {
-          "name" : [ {
-            "@type" : "g:VertexProperty",
-            "@value" : {
-              "id" : {
-                "@type" : "g:Int64",
-                "@value" : 0
-              },
-              "value" : "marko",
-              "label" : "name"
-            }
-          } ],
-          "location" : [ {
-            "@type" : "g:VertexProperty",
-            "@value" : {
-              "id" : {
-                "@type" : "g:Int64",
-                "@value" : 6
-              },
-              "value" : "san diego",
-              "label" : "location",
-              "properties" : {
-                "startTime" : {
-                  "@type" : "g:Int32",
-                  "@value" : 1997
-                },
-                "endTime" : {
-                  "@type" : "g:Int32",
-                  "@value" : 2001
-                }
-              }
-            }
-          }, {
-            "@type" : "g:VertexProperty",
-            "@value" : {
-              "id" : {
-                "@type" : "g:Int64",
-                "@value" : 7
-              },
-              "value" : "santa cruz",
-              "label" : "location",
-              "properties" : {
-                "startTime" : {
-                  "@type" : "g:Int32",
-                  "@value" : 2001
-                },
-                "endTime" : {
-                  "@type" : "g:Int32",
-                  "@value" : 2004
-                }
-              }
-            }
-          }, {
-            "@type" : "g:VertexProperty",
-            "@value" : {
-              "id" : {
-                "@type" : "g:Int64",
-                "@value" : 8
-              },
-              "value" : "brussels",
-              "label" : "location",
-              "properties" : {
-                "startTime" : {
-                  "@type" : "g:Int32",
-                  "@value" : 2004
-                },
-                "endTime" : {
-                  "@type" : "g:Int32",
-                  "@value" : 2005
-                }
-              }
-            }
-          }, {
-            "@type" : "g:VertexProperty",
-            "@value" : {
-              "id" : {
-                "@type" : "g:Int64",
-                "@value" : 9
-              },
-              "value" : "santa fe",
-              "label" : "location",
-              "properties" : {
-                "startTime" : {
-                  "@type" : "g:Int32",
-                  "@value" : 2005
-                }
-              }
-            }
-          } ]
-        }
+        "label" : "person"
       }
     }, {
       "@type" : "g:Vertex",
@@ -108,20 +18,7 @@
           "@type" : "g:Int32",
           "@value" : 10
         },
-        "label" : "software",
-        "properties" : {
-          "name" : [ {
-            "@type" : "g:VertexProperty",
-            "@value" : {
-              "id" : {
-                "@type" : "g:Int64",
-                "@value" : 4
-              },
-              "value" : "gremlin",
-              "label" : "name"
-            }
-          } ]
-        }
+        "label" : "software"
       }
     }, {
       "@type" : "g:Vertex",
@@ -130,20 +27,7 @@
           "@type" : "g:Int32",
           "@value" : 11
         },
-        "label" : "software",
-        "properties" : {
-          "name" : [ {
-            "@type" : "g:VertexProperty",
-            "@value" : {
-              "id" : {
-                "@type" : "g:Int64",
-                "@value" : 5
-              },
-              "value" : "tinkergraph",
-              "label" : "name"
-            }
-          } ]
-        }
+        "label" : "software"
       }
     } ]
   }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionclose-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionclose-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionclose-v3d0.json
index cc4386b..870c586 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionclose-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionclose-v3d0.json
@@ -3,9 +3,10 @@
   "op" : "close",
   "processor" : "session",
   "args" : {
-    "session" : {
+    "@type" : "g:Map",
+    "@value" : [ "session", {
       "@type" : "g:UUID",
       "@value" : "41d2e28a-20a4-4ab0-b379-d810dede3786"
-    }
+    } ]
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessioneval-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessioneval-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessioneval-v3d0.json
index 900e1ab..a62f70c 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessioneval-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessioneval-v3d0.json
@@ -3,17 +3,16 @@
   "op" : "eval",
   "processor" : "session",
   "args" : {
-    "gremlin" : "g.V(x)",
-    "language" : "gremlin-groovy",
-    "session" : {
+    "@type" : "g:Map",
+    "@value" : [ "gremlin", "g.V(x)", "language", "gremlin-groovy", "session", {
       "@type" : "g:UUID",
       "@value" : "41d2e28a-20a4-4ab0-b379-d810dede3786"
-    },
-    "bindings" : {
-      "x" : {
+    }, "bindings", {
+      "@type" : "g:Map",
+      "@value" : [ "x", {
         "@type" : "g:Int32",
         "@value" : 1
-      }
-    }
+      } ]
+    } ]
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionevalaliased-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionevalaliased-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionevalaliased-v3d0.json
index 924bf77..240a6ef 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionevalaliased-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionevalaliased-v3d0.json
@@ -3,20 +3,19 @@
   "op" : "eval",
   "processor" : "session",
   "args" : {
-    "gremlin" : "social.V(x)",
-    "language" : "gremlin-groovy",
-    "aliases" : {
-      "g" : "social"
-    },
-    "session" : {
+    "@type" : "g:Map",
+    "@value" : [ "gremlin", "social.V(x)", "language", "gremlin-groovy", "aliases", {
+      "@type" : "g:Map",
+      "@value" : [ "g", "social" ]
+    }, "session", {
       "@type" : "g:UUID",
       "@value" : "41d2e28a-20a4-4ab0-b379-d810dede3786"
-    },
-    "bindings" : {
-      "x" : {
+    }, "bindings", {
+      "@type" : "g:Map",
+      "@value" : [ "x", {
         "@type" : "g:Int32",
         "@value" : 1
-      }
-    }
+      } ]
+    } ]
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionlesseval-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionlesseval-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionlesseval-v3d0.json
index 81e2f6c..dc8c8e6 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionlesseval-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionlesseval-v3d0.json
@@ -3,13 +3,13 @@
   "op" : "eval",
   "processor" : "",
   "args" : {
-    "gremlin" : "g.V(x)",
-    "language" : "gremlin-groovy",
-    "bindings" : {
-      "x" : {
+    "@type" : "g:Map",
+    "@value" : [ "gremlin", "g.V(x)", "language", "gremlin-groovy", "bindings", {
+      "@type" : "g:Map",
+      "@value" : [ "x", {
         "@type" : "g:Int32",
         "@value" : 1
-      }
-    }
+      } ]
+    } ]
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionlessevalaliased-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionlessevalaliased-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionlessevalaliased-v3d0.json
index 0f6a54e..fc03a37 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionlessevalaliased-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/sessionlessevalaliased-v3d0.json
@@ -3,16 +3,16 @@
   "op" : "eval",
   "processor" : "",
   "args" : {
-    "gremlin" : "social.V(x)",
-    "language" : "gremlin-groovy",
-    "aliases" : {
-      "g" : "social"
-    },
-    "bindings" : {
-      "x" : {
+    "@type" : "g:Map",
+    "@value" : [ "gremlin", "social.V(x)", "language", "gremlin-groovy", "aliases", {
+      "@type" : "g:Map",
+      "@value" : [ "g", "social" ]
+    }, "bindings", {
+      "@type" : "g:Map",
+      "@value" : [ "x", {
         "@type" : "g:Int32",
         "@value" : 1
-      }
-    }
+      } ]
+    } ]
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/standardresult-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/standardresult-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/standardresult-v3d0.json
index 857c6db..0be6d51 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/standardresult-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/standardresult-v3d0.json
@@ -3,7 +3,10 @@
   "status" : {
     "message" : "",
     "code" : 200,
-    "attributes" : { }
+    "attributes" : {
+      "@type" : "g:Map",
+      "@value" : [ ]
+    }
   },
   "result" : {
     "data" : [ {
@@ -106,6 +109,9 @@
         }
       }
     } ],
-    "meta" : { }
+    "meta" : {
+      "@type" : "g:Map",
+      "@value" : [ ]
+    }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/traversalmetrics-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/traversalmetrics-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/traversalmetrics-v3d0.json
index fdd18a4..8e7effd 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/traversalmetrics-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/traversalmetrics-v3d0.json
@@ -1,114 +1,106 @@
 {
   "@type" : "g:TraversalMetrics",
   "@value" : {
-    "dur" : {
+    "@type" : "g:Map",
+    "@value" : [ "dur", {
       "@type" : "g:Double",
       "@value" : 0.004
-    },
-    "metrics" : [ {
+    }, "metrics", [ {
       "@type" : "g:Metrics",
       "@value" : {
-        "dur" : {
+        "@type" : "g:Map",
+        "@value" : [ "dur", {
           "@type" : "g:Double",
           "@value" : 100.0
-        },
-        "counts" : {
-          "traverserCount" : {
+        }, "counts", {
+          "@type" : "g:Map",
+          "@value" : [ "traverserCount", {
             "@type" : "g:Int64",
             "@value" : 4
-          },
-          "elementCount" : {
+          }, "elementCount", {
             "@type" : "g:Int64",
             "@value" : 4
-          }
-        },
-        "name" : "TinkerGraphStep(vertex,[~label.eq(person)])",
-        "annotations" : {
-          "percentDur" : {
+          } ]
+        }, "name", "TinkerGraphStep(vertex,[~label.eq(person)])", "annotations", {
+          "@type" : "g:Map",
+          "@value" : [ "percentDur", {
             "@type" : "g:Double",
             "@value" : 25.0
-          }
-        },
-        "id" : "7.0.0()"
+          } ]
+        }, "id", "7.0.0()" ]
       }
     }, {
       "@type" : "g:Metrics",
       "@value" : {
-        "dur" : {
+        "@type" : "g:Map",
+        "@value" : [ "dur", {
           "@type" : "g:Double",
           "@value" : 100.0
-        },
-        "counts" : {
-          "traverserCount" : {
+        }, "counts", {
+          "@type" : "g:Map",
+          "@value" : [ "traverserCount", {
             "@type" : "g:Int64",
             "@value" : 13
-          },
-          "elementCount" : {
+          }, "elementCount", {
             "@type" : "g:Int64",
             "@value" : 13
-          }
-        },
-        "name" : "VertexStep(OUT,vertex)",
-        "annotations" : {
-          "percentDur" : {
+          } ]
+        }, "name", "VertexStep(OUT,vertex)", "annotations", {
+          "@type" : "g:Map",
+          "@value" : [ "percentDur", {
             "@type" : "g:Double",
             "@value" : 25.0
-          }
-        },
-        "id" : "2.0.0()"
+          } ]
+        }, "id", "2.0.0()" ]
       }
     }, {
       "@type" : "g:Metrics",
       "@value" : {
-        "dur" : {
+        "@type" : "g:Map",
+        "@value" : [ "dur", {
           "@type" : "g:Double",
           "@value" : 100.0
-        },
-        "counts" : {
-          "traverserCount" : {
+        }, "counts", {
+          "@type" : "g:Map",
+          "@value" : [ "traverserCount", {
             "@type" : "g:Int64",
             "@value" : 7
-          },
-          "elementCount" : {
+          }, "elementCount", {
             "@type" : "g:Int64",
             "@value" : 7
-          }
-        },
-        "name" : "VertexStep(OUT,vertex)",
-        "annotations" : {
-          "percentDur" : {
+          } ]
+        }, "name", "VertexStep(OUT,vertex)", "annotations", {
+          "@type" : "g:Map",
+          "@value" : [ "percentDur", {
             "@type" : "g:Double",
             "@value" : 25.0
-          }
-        },
-        "id" : "3.0.0()"
+          } ]
+        }, "id", "3.0.0()" ]
       }
     }, {
       "@type" : "g:Metrics",
       "@value" : {
-        "dur" : {
+        "@type" : "g:Map",
+        "@value" : [ "dur", {
           "@type" : "g:Double",
           "@value" : 100.0
-        },
-        "counts" : {
-          "traverserCount" : {
+        }, "counts", {
+          "@type" : "g:Map",
+          "@value" : [ "traverserCount", {
             "@type" : "g:Int64",
             "@value" : 1
-          },
-          "elementCount" : {
+          }, "elementCount", {
             "@type" : "g:Int64",
             "@value" : 1
-          }
-        },
-        "name" : "TreeStep",
-        "annotations" : {
-          "percentDur" : {
+          } ]
+        }, "name", "TreeStep", "annotations", {
+          "@type" : "g:Map",
+          "@value" : [ "percentDur", {
             "@type" : "g:Double",
             "@value" : 25.0
-          }
-        },
-        "id" : "4.0.0()"
+          } ]
+        }, "id", "4.0.0()" ]
       }
-    } ]
+    } ] ]
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/tree-v3d0.json
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/tree-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/tree-v3d0.json
index 74dcffc..77ba971 100644
--- a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/tree-v3d0.json
+++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_0/tree-v3d0.json
@@ -1,5 +1,5 @@
 {
-  "@type" : "g:Tree",
+  "@type" : "g:Map",
   "@value" : [ {
     "key" : {
       "@type" : "g:Vertex",
@@ -102,7 +102,7 @@
       }
     },
     "value" : {
-      "@type" : "g:Tree",
+      "@type" : "g:Map",
       "@value" : [ {
         "key" : {
           "@type" : "g:Vertex",
@@ -128,7 +128,7 @@
           }
         },
         "value" : {
-          "@type" : "g:Tree",
+          "@type" : "g:Map",
           "@value" : [ {
             "key" : {
               "@type" : "g:Vertex",
@@ -154,7 +154,7 @@
               }
             },
             "value" : {
-              "@type" : "g:Tree",
+              "@type" : "g:Map",
               "@value" : [ ]
             }
           } ]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV3d0.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV3d0.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV3d0.java
index 685a8cc..c2eebf9 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV3d0.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV3d0.java
@@ -50,6 +50,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -194,7 +195,7 @@ public final class TinkerIoRegistryV3d0 extends AbstractIoRegistry {
             final List<? extends Vertex> vertices;
 
             jsonParser.nextToken();
-            final Map<String, Object> graphData = deserializationContext.readValue(jsonParser, Map.class);
+            final Map<String, Object> graphData = deserializationContext.readValue(jsonParser, LinkedHashMap.class);
             vertices = (List<DetachedVertex>) graphData.get(GraphSONTokens.VERTICES);
             edges = (List<DetachedEdge>) graphData.get(GraphSONTokens.EDGES);
 


[31/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-1427
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) {


[13/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-1427
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")


[02/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-1427
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
----------------------------------------------------------------------


[38/50] [abbrv] tinkerpop git commit: TINKERPOP-1427 Added g:Map for GraphSON 3.0

Posted by sp...@apache.org.
TINKERPOP-1427 Added g:Map for GraphSON 3.0


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

Branch: refs/heads/TINKERPOP-1427
Commit: bef05a8e958088157b881e6e58937ee8b53a7df3
Parents: 0489cd5
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Sat Jul 1 14:16:57 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 16:23:52 2017 -0400

----------------------------------------------------------------------
 .../AbstractGraphSONTypeSerializer.java         | 173 +++++++++++
 .../structure/io/graphson/GraphSONMapper.java   |   5 +-
 .../structure/io/graphson/GraphSONModule.java   |  11 +-
 .../structure/io/graphson/GraphSONReader.java   |   9 +-
 .../io/graphson/GraphSONSerializerProvider.java |   1 -
 .../io/graphson/GraphSONSerializersV2d0.java    |   2 +-
 .../io/graphson/GraphSONSerializersV3d0.java    |  28 +-
 .../graphson/GraphSONTypeResolverBuilder.java   |  10 +-
 .../io/graphson/GraphSONTypeSerializer.java     | 245 ---------------
 .../io/graphson/GraphSONTypeSerializerV2d0.java | 112 +++++++
 .../io/graphson/GraphSONTypeSerializerV3d0.java | 139 +++++++++
 .../io/graphson/GraphSONXModuleV2d0.java        |   8 +-
 .../io/graphson/GraphSONXModuleV3d0.java        |   8 +-
 .../io/graphson/JavaTimeSerializersV3d0.java    |   5 +
 .../io/graphson/JavaUtilSerializersV3d0.java    | 109 +++++--
 .../io/graphson/TraversalSerializersV3d0.java   | 146 +++++++--
 .../star/StarGraphGraphSONSerializerV3d0.java   | 165 +++++++++++
 .../GraphSONMapperEmbeddedTypeTest.java         |  39 ++-
 .../GraphSONMapperPartialEmbeddedTypeTest.java  | 297 +++++++++++++++++++
 .../io/graphson/GraphSONMapperTest.java         |   3 +
 ...aphSONMapperV2d0PartialEmbeddedTypeTest.java | 278 -----------------
 .../ser/GraphSONMessageSerializerV3d0Test.java  |  25 +-
 .../jsr223/PythonGraphSONJavaTranslator.java    |   5 +-
 .../server/GremlinDriverIntegrateTest.java      |  34 +++
 .../GremlinServerAuditLogIntegrateTest.java     |   7 +
 .../server/GremlinServerHttpIntegrateTest.java  |   2 +-
 .../server/GremlinServerIntegrateTest.java      |   2 +-
 .../gremlin/structure/io/IoCustomTest.java      |   7 +-
 .../tinkerpop/gremlin/structure/io/IoTest.java  |   4 +-
 .../gremlin/structure/io/util/CustomId.java     |  64 +++-
 .../GraphSONTypedCompatibilityTest.java         |   7 +-
 .../_3_3_0/authenticationchallenge-v3d0.json    |  10 +-
 .../_3_3_0/authenticationresponse-v3d0.json     |   4 +-
 .../io/graphson/_3_3_0/metrics-v3d0.json        |  55 ++--
 .../structure/io/graphson/_3_3_0/path-v3d0.json | 122 +-------
 .../io/graphson/_3_3_0/sessionclose-v3d0.json   |   5 +-
 .../io/graphson/_3_3_0/sessioneval-v3d0.json    |  15 +-
 .../_3_3_0/sessionevalaliased-v3d0.json         |  21 +-
 .../graphson/_3_3_0/sessionlesseval-v3d0.json   |  12 +-
 .../_3_3_0/sessionlessevalaliased-v3d0.json     |  18 +-
 .../io/graphson/_3_3_0/standardresult-v3d0.json |  10 +-
 .../graphson/_3_3_0/traversalmetrics-v3d0.json  | 112 ++++---
 .../structure/io/graphson/_3_3_0/tree-v3d0.json |   8 +-
 .../structure/TinkerIoRegistryV3d0.java         |   3 +-
 44 files changed, 1448 insertions(+), 897 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/AbstractGraphSONTypeSerializer.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/AbstractGraphSONTypeSerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/AbstractGraphSONTypeSerializer.java
new file mode 100644
index 0000000..6eb65e1
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/AbstractGraphSONTypeSerializer.java
@@ -0,0 +1,173 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.structure.io.graphson;
+
+import org.apache.tinkerpop.shaded.jackson.annotation.JsonTypeInfo;
+import org.apache.tinkerpop.shaded.jackson.core.JsonGenerator;
+import org.apache.tinkerpop.shaded.jackson.databind.BeanProperty;
+import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeIdResolver;
+import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Extension of the Jackson's default TypeSerializer. An instance of this object will be passed to the serializers
+ * on which they can safely call the utility methods to serialize types and making it compatible with the version
+ * 2.0+ of GraphSON.
+ *
+ * @author Kevin Gallardo (https://kgdo.me)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public abstract class AbstractGraphSONTypeSerializer extends TypeSerializer {
+
+    protected final TypeIdResolver idRes;
+    protected final String propertyName;
+    protected final TypeInfo typeInfo;
+    protected final String valuePropertyName;
+    protected final Map<Class, Class> classMap = new HashMap<>();
+
+    AbstractGraphSONTypeSerializer(final TypeIdResolver idRes, final String propertyName, final TypeInfo typeInfo,
+                                   final String valuePropertyName) {
+        this.idRes = idRes;
+        this.propertyName = propertyName;
+        this.typeInfo = typeInfo;
+        this.valuePropertyName = valuePropertyName;
+    }
+
+
+    @Override
+    public TypeSerializer forProperty(final BeanProperty beanProperty) {
+        return this;
+    }
+
+    @Override
+    public JsonTypeInfo.As getTypeInclusion() {
+        return null;
+    }
+
+    @Override
+    public String getPropertyName() {
+        return propertyName;
+    }
+
+    @Override
+    public TypeIdResolver getTypeIdResolver() {
+        return idRes;
+    }
+
+    @Override
+    public void writeTypePrefixForScalar(final Object o, final JsonGenerator jsonGenerator) throws IOException {
+        if (canWriteTypeId()) {
+            writeTypePrefix(jsonGenerator, getTypeIdResolver().idFromValueAndType(o, getClassFromObject(o)));
+        }
+    }
+
+    @Override
+    public void writeTypePrefixForObject(final Object o, final JsonGenerator jsonGenerator) throws IOException {
+        jsonGenerator.writeStartObject();
+        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypePrefix(Map);
+    }
+
+    @Override
+    public void writeTypePrefixForArray(final Object o, final JsonGenerator jsonGenerator) throws IOException {
+        jsonGenerator.writeStartArray();
+        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypePrefix(List);
+    }
+
+    @Override
+    public void writeTypeSuffixForScalar(final Object o, final JsonGenerator jsonGenerator) throws IOException {
+        if (canWriteTypeId()) {
+            writeTypeSuffix(jsonGenerator);
+        }
+    }
+
+    @Override
+    public void writeTypeSuffixForObject(final Object o, final JsonGenerator jsonGenerator) throws IOException {
+        jsonGenerator.writeEndObject();
+        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypeSuffix(Map);
+    }
+
+    @Override
+    public void writeTypeSuffixForArray(final Object o, final JsonGenerator jsonGenerator) throws IOException {
+        jsonGenerator.writeEndArray();
+        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypeSuffix(List);
+    }
+
+    @Override
+    public void writeCustomTypePrefixForScalar(final Object o, final JsonGenerator jsonGenerator, final String s) throws IOException {
+        if (canWriteTypeId()) {
+            writeTypePrefix(jsonGenerator, s);
+        }
+    }
+
+    @Override
+    public void writeCustomTypePrefixForObject(final Object o, final JsonGenerator jsonGenerator, final String s) throws IOException {
+        jsonGenerator.writeStartObject();
+        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypePrefix(s);
+    }
+
+    @Override
+    public void writeCustomTypePrefixForArray(final Object o, final JsonGenerator jsonGenerator, final String s) throws IOException {
+        jsonGenerator.writeStartArray();
+        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypePrefix(s);
+    }
+
+    @Override
+    public void writeCustomTypeSuffixForScalar(final Object o, final JsonGenerator jsonGenerator, final String s) throws IOException {
+        if (canWriteTypeId()) {
+            writeTypeSuffix(jsonGenerator);
+        }
+    }
+
+    @Override
+    public void writeCustomTypeSuffixForObject(final Object o, final JsonGenerator jsonGenerator, final String s) throws IOException {
+        jsonGenerator.writeEndObject();
+        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypeSuffix(s);
+    }
+
+    @Override
+    public void writeCustomTypeSuffixForArray(final Object o, final JsonGenerator jsonGenerator, final String s) throws IOException {
+        jsonGenerator.writeEndArray();
+        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypeSuffix(s);
+    }
+
+    protected boolean canWriteTypeId() {
+        return typeInfo != null
+                && typeInfo == TypeInfo.PARTIAL_TYPES;
+    }
+
+    protected void writeTypePrefix(final JsonGenerator jsonGenerator, final String s) throws IOException {
+        jsonGenerator.writeStartObject();
+        jsonGenerator.writeStringField(this.getPropertyName(), s);
+        jsonGenerator.writeFieldName(this.valuePropertyName);
+    }
+
+    protected void writeTypeSuffix(final JsonGenerator jsonGenerator) throws IOException {
+        jsonGenerator.writeEndObject();
+    }
+
+    /**
+     * We force only **one** translation of a Java object to a domain specific object. i.e. users register typeIDs
+     * and serializers/deserializers for the predefined types we have in the spec. Graph, Vertex, Edge,
+     * VertexProperty, etc... And **not** their implementations (TinkerGraph, DetachedVertex, TinkerEdge, etc..)
+     */
+    protected abstract Class getClassFromObject(final Object o);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapper.java
index 6b6bbf7..eb3c9ad 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapper.java
@@ -94,9 +94,12 @@ public class GraphSONMapper implements Mapper<ObjectMapper> {
             om.findAndRegisterModules();
 
         // graphson 3.0 only allows type - there is no option to remove embedded types
+        if (version == GraphSONVersion.V3_0 && typeInfo == TypeInfo.NO_TYPES)
+            throw new IllegalStateException(String.format("GraphSON 3.0 does not support %s", TypeInfo.NO_TYPES));
+
         if (version == GraphSONVersion.V3_0 || (version == GraphSONVersion.V2_0 && typeInfo != TypeInfo.NO_TYPES)) {
             final GraphSONTypeIdResolver graphSONTypeIdResolver = new GraphSONTypeIdResolver();
-            final TypeResolverBuilder typer = new GraphSONTypeResolverBuilder()
+            final TypeResolverBuilder typer = new GraphSONTypeResolverBuilder(version)
                     .typesEmbedding(getTypeInfo())
                     .valuePropertyName(GraphSONTokens.VALUEPROP)
                     .init(JsonTypeInfo.Id.CUSTOM, graphSONTypeIdResolver)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
index 019112b..22dc6b2 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
@@ -71,6 +71,7 @@ import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.star.DirectionalStarGraph;
 import org.apache.tinkerpop.gremlin.structure.util.star.StarGraphGraphSONSerializerV1d0;
 import org.apache.tinkerpop.gremlin.structure.util.star.StarGraphGraphSONSerializerV2d0;
+import org.apache.tinkerpop.gremlin.structure.util.star.StarGraphGraphSONSerializerV3d0;
 import org.apache.tinkerpop.gremlin.util.function.Lambda;
 
 import java.time.Duration;
@@ -122,6 +123,9 @@ abstract class GraphSONModule extends TinkerPopJacksonModule {
                     put(Double.class, "Double");
                     put(Float.class, "Float");
 
+                    put(Map.Entry.class, "Entry");
+                    put(Map.class, "Map");
+
                     // Tinkerpop Graph objects
                     put(Lambda.class, "Lambda");
                     put(Vertex.class, "Vertex");
@@ -196,11 +200,12 @@ abstract class GraphSONModule extends TinkerPopJacksonModule {
             addSerializer(TraversalMetrics.class, new GraphSONSerializersV3d0.TraversalMetricsJacksonSerializer());
             addSerializer(TraversalExplanation.class, new GraphSONSerializersV3d0.TraversalExplanationJacksonSerializer());
             addSerializer(Path.class, new GraphSONSerializersV3d0.PathJacksonSerializer());
-            addSerializer(DirectionalStarGraph.class, new StarGraphGraphSONSerializerV2d0(normalize));
+            addSerializer(DirectionalStarGraph.class, new StarGraphGraphSONSerializerV3d0(normalize));
             addSerializer(Tree.class, new GraphSONSerializersV3d0.TreeJacksonSerializer());
 
             // java.util
             addSerializer(Map.Entry.class, new JavaUtilSerializersV3d0.MapEntryJacksonSerializer());
+            addSerializer(Map.class, new JavaUtilSerializersV3d0.MapJacksonSerializer());
 
             // need to explicitly add serializers for those types because Jackson doesn't do it at all.
             addSerializer(Integer.class, new GraphSONSerializersV3d0.IntegerGraphSONSerializer());
@@ -237,6 +242,10 @@ abstract class GraphSONModule extends TinkerPopJacksonModule {
             addDeserializer(TraversalMetrics.class, new GraphSONSerializersV3d0.TraversalMetricsJacksonDeserializer());
             addDeserializer(Tree.class, new GraphSONSerializersV3d0.TreeJacksonDeserializer());
 
+            // java.util
+            addDeserializer(Map.Entry.class, new JavaUtilSerializersV3d0.MapEntryJacksonDeserializer());
+            addDeserializer(Map.class, new JavaUtilSerializersV3d0.MapJacksonDeserializer());
+
             // numbers
             addDeserializer(Integer.class, new GraphSONSerializersV3d0.IntegerJackonsDeserializer());
             addDeserializer(Double.class, new GraphSONSerializersV3d0.DoubleJackonsDeserializer());

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java
index 3f63b96..056d3c8 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java
@@ -52,6 +52,7 @@ import java.io.OutputStream;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.Function;
@@ -73,8 +74,8 @@ public final class GraphSONReader implements GraphReader {
     private final GraphSONVersion version;
     private boolean unwrapAdjacencyList = false;
 
-    final TypeReference<Map<String, Object>> mapTypeReference = new TypeReference<Map<String, Object>>() {
-    };
+    final TypeReference<Map<String, Object>> mapTypeReference = new TypeReference<Map<String, Object>>() {};
+    final TypeReference<LinkedHashMap<String, Object>> linkedHashMapTypeReference = new TypeReference<LinkedHashMap<String, Object>>() {};
 
     private GraphSONReader(final Builder builder) {
         mapper = builder.mapper.createMapper();
@@ -173,7 +174,9 @@ public final class GraphSONReader implements GraphReader {
                              final Function<Attachable<Vertex>, Vertex> vertexAttachMethod,
                              final Function<Attachable<Edge>, Edge> edgeAttachMethod,
                              final Direction attachEdgesOfThisDirection) throws IOException {
-        final Map<String, Object> vertexData = mapper.readValue(inputStream, mapTypeReference);
+        // graphson v3 has special handling for generic Map instances, by forcing to linkedhashmap (which is probably
+        // what it should have been anyway) stargraph format can remain unchanged across all versions
+        final Map<String, Object> vertexData = mapper.readValue(inputStream, version == GraphSONVersion.V3_0 ? linkedHashMapTypeReference : mapTypeReference);
         final StarGraph starGraph = StarGraphGraphSONDeserializer.readStarGraphVertex(vertexData);
         if (vertexAttachMethod != null) vertexAttachMethod.apply(starGraph.getStarVertex());
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java
index bd7f966..7744b79 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java
@@ -44,7 +44,6 @@ final class GraphSONSerializerProvider extends DefaultSerializerProvider {
             setDefaultKeySerializer(new GraphSONSerializersV2d0.GraphSONKeySerializer());
             unknownTypeSerializer = new ToStringGraphSONSerializer();
         } else {
-            setDefaultKeySerializer(new GraphSONSerializersV3d0.GraphSONKeySerializer());
             unknownTypeSerializer = new ToStringGraphSONSerializer();
         }
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java
index 095bfe6..717dcfa 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java
@@ -703,4 +703,4 @@ class GraphSONSerializersV2d0 {
             return true;
         }
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java
index 6f6e011..5fe8e74 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java
@@ -64,6 +64,7 @@ import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -610,20 +611,21 @@ class GraphSONSerializersV3d0 {
         }
     }
 
-    static class MetricsJacksonDeserializer extends AbstractObjectDeserializer<Metrics> {
+    static class MetricsJacksonDeserializer extends StdDeserializer<Metrics> {
         public MetricsJacksonDeserializer() {
             super(Metrics.class);
         }
 
         @Override
-        public Metrics createObject(final Map<String, Object> metricsData) {
+        public Metrics deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            final Map<String, Object> metricsData = deserializationContext.readValue(jsonParser, Map.class);
             final MutableMetrics m = new MutableMetrics((String)metricsData.get(GraphSONTokens.ID), (String)metricsData.get(GraphSONTokens.NAME));
 
             m.setDuration(Math.round((Double) metricsData.get(GraphSONTokens.DURATION) * 1000000), TimeUnit.NANOSECONDS);
-            for (Map.Entry<String, Long> count : ((Map<String, Long>)metricsData.getOrDefault(GraphSONTokens.COUNTS, new HashMap<>(0))).entrySet()) {
+            for (Map.Entry<String, Long> count : ((Map<String, Long>)metricsData.getOrDefault(GraphSONTokens.COUNTS, new LinkedHashMap<>(0))).entrySet()) {
                 m.setCount(count.getKey(), count.getValue());
             }
-            for (Map.Entry<String, Long> count : ((Map<String, Long>) metricsData.getOrDefault(GraphSONTokens.ANNOTATIONS, new HashMap<>(0))).entrySet()) {
+            for (Map.Entry<String, Long> count : ((Map<String, Long>) metricsData.getOrDefault(GraphSONTokens.ANNOTATIONS, new LinkedHashMap<>(0))).entrySet()) {
                 m.setAnnotation(count.getKey(), count.getValue());
             }
             for (MutableMetrics nested : (List<MutableMetrics>)metricsData.getOrDefault(GraphSONTokens.METRICS, new ArrayList<>(0))) {
@@ -631,21 +633,33 @@ class GraphSONSerializersV3d0 {
             }
             return m;
         }
+
+        @Override
+        public boolean isCachable() {
+            return true;
+        }
     }
 
-    static class TraversalMetricsJacksonDeserializer extends AbstractObjectDeserializer<TraversalMetrics> {
+    static class TraversalMetricsJacksonDeserializer extends StdDeserializer<TraversalMetrics> {
 
         public TraversalMetricsJacksonDeserializer() {
             super(TraversalMetrics.class);
         }
 
         @Override
-        public TraversalMetrics createObject(final Map<String, Object> traversalMetricsData) {
+        public TraversalMetrics deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            final Map<String, Object> traversalMetricsData = deserializationContext.readValue(jsonParser, Map.class);
+
             return new DefaultTraversalMetrics(
                     Math.round((Double) traversalMetricsData.get(GraphSONTokens.DURATION) * 1000000),
                     (List<MutableMetrics>) traversalMetricsData.get(GraphSONTokens.METRICS)
             );
         }
+
+        @Override
+        public boolean isCachable() {
+            return true;
+        }
     }
 
     static class TreeJacksonDeserializer extends StdDeserializer<Tree> {
@@ -703,4 +717,4 @@ class GraphSONSerializersV3d0 {
             return true;
         }
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeResolverBuilder.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeResolverBuilder.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeResolverBuilder.java
index 7d3d03c..0da512e 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeResolverBuilder.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeResolverBuilder.java
@@ -34,11 +34,17 @@ import java.util.Collection;
  * deserializers. Contains the typeInfo level that should be provided by the GraphSONMapper.
  *
  * @author Kevin Gallardo (https://kgdo.me)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class GraphSONTypeResolverBuilder extends StdTypeResolverBuilder {
 
     private TypeInfo typeInfo;
     private String valuePropertyName;
+    private final GraphSONVersion version;
+
+    public GraphSONTypeResolverBuilder(final GraphSONVersion version) {
+        this.version = version;
+    }
 
     @Override
     public TypeDeserializer buildTypeDeserializer(final DeserializationConfig config, final JavaType baseType,
@@ -52,7 +58,9 @@ public class GraphSONTypeResolverBuilder extends StdTypeResolverBuilder {
     public TypeSerializer buildTypeSerializer(final SerializationConfig config, final JavaType baseType,
                                               final Collection<NamedType> subtypes) {
         final TypeIdResolver idRes = this.idResolver(config, baseType, subtypes, true, false);
-        return new GraphSONTypeSerializer(idRes, this.getTypeProperty(), typeInfo, valuePropertyName);
+        return version == GraphSONVersion.V2_0 ?
+                new GraphSONTypeSerializerV2d0(idRes, this.getTypeProperty(), typeInfo, valuePropertyName) :
+                new GraphSONTypeSerializerV3d0(idRes, this.getTypeProperty(), typeInfo, valuePropertyName);
     }
 
     public GraphSONTypeResolverBuilder valuePropertyName(final String valuePropertyName) {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializer.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializer.java
deleted file mode 100644
index 78c670a..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializer.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.structure.io.graphson;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Operator;
-import org.apache.tinkerpop.gremlin.process.traversal.Order;
-import org.apache.tinkerpop.gremlin.process.traversal.Path;
-import org.apache.tinkerpop.gremlin.process.traversal.Pop;
-import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
-import org.apache.tinkerpop.gremlin.process.traversal.Scope;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
-import org.apache.tinkerpop.gremlin.process.traversal.util.Metrics;
-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;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.T;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-import org.apache.tinkerpop.gremlin.util.function.HashMapSupplier;
-import org.apache.tinkerpop.gremlin.util.function.Lambda;
-import org.apache.tinkerpop.shaded.jackson.annotation.JsonTypeInfo;
-import org.apache.tinkerpop.shaded.jackson.core.JsonGenerator;
-import org.apache.tinkerpop.shaded.jackson.databind.BeanProperty;
-import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeIdResolver;
-import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.nio.ByteBuffer;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Extension of the Jackson's default TypeSerializer. An instance of this object will be passed to the serializers
- * on which they can safely call the utility methods to serialize types and making it compatible with the version
- * 2.0 of GraphSON.
- *
- * @author Kevin Gallardo (https://kgdo.me)
- */
-public class GraphSONTypeSerializer extends TypeSerializer {
-
-    private final TypeIdResolver idRes;
-    private final String propertyName;
-    private final TypeInfo typeInfo;
-    private final String valuePropertyName;
-    private final Map<Class, Class> classMap = new HashMap<>();
-
-    GraphSONTypeSerializer(final TypeIdResolver idRes, final String propertyName, final TypeInfo typeInfo,
-                           final String valuePropertyName) {
-        this.idRes = idRes;
-        this.propertyName = propertyName;
-        this.typeInfo = typeInfo;
-        this.valuePropertyName = valuePropertyName;
-    }
-
-    @Override
-    public TypeSerializer forProperty(final BeanProperty beanProperty) {
-        return this;
-    }
-
-    @Override
-    public JsonTypeInfo.As getTypeInclusion() {
-        return null;
-    }
-
-    @Override
-    public String getPropertyName() {
-        return propertyName;
-    }
-
-    @Override
-    public TypeIdResolver getTypeIdResolver() {
-        return idRes;
-    }
-
-    @Override
-    public void writeTypePrefixForScalar(final Object o, final JsonGenerator jsonGenerator) throws IOException {
-        if (canWriteTypeId()) {
-            writeTypePrefix(jsonGenerator, getTypeIdResolver().idFromValueAndType(o, getClassFromObject(o)));
-        }
-    }
-
-    @Override
-    public void writeTypePrefixForObject(final Object o, final JsonGenerator jsonGenerator) throws IOException {
-        jsonGenerator.writeStartObject();
-        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypePrefix(Map);
-    }
-
-    @Override
-    public void writeTypePrefixForArray(final Object o, final JsonGenerator jsonGenerator) throws IOException {
-        jsonGenerator.writeStartArray();
-        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypePrefix(List);
-    }
-
-    @Override
-    public void writeTypeSuffixForScalar(final Object o, final JsonGenerator jsonGenerator) throws IOException {
-        if (canWriteTypeId()) {
-            writeTypeSuffix(jsonGenerator);
-        }
-    }
-
-    @Override
-    public void writeTypeSuffixForObject(final Object o, final JsonGenerator jsonGenerator) throws IOException {
-        jsonGenerator.writeEndObject();
-        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypeSuffix(Map);
-    }
-
-    @Override
-    public void writeTypeSuffixForArray(final Object o, final JsonGenerator jsonGenerator) throws IOException {
-        jsonGenerator.writeEndArray();
-        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypeSuffix(List);
-    }
-
-    @Override
-    public void writeCustomTypePrefixForScalar(final Object o, final JsonGenerator jsonGenerator, final String s) throws IOException {
-        if (canWriteTypeId()) {
-            writeTypePrefix(jsonGenerator, s);
-        }
-    }
-
-    @Override
-    public void writeCustomTypePrefixForObject(final Object o, final JsonGenerator jsonGenerator, final String s) throws IOException {
-        jsonGenerator.writeStartObject();
-        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypePrefix(s);
-    }
-
-    @Override
-    public void writeCustomTypePrefixForArray(final Object o, final JsonGenerator jsonGenerator, final String s) throws IOException {
-        jsonGenerator.writeStartArray();
-        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypePrefix(s);
-    }
-
-    @Override
-    public void writeCustomTypeSuffixForScalar(final Object o, final JsonGenerator jsonGenerator, final String s) throws IOException {
-        if (canWriteTypeId()) {
-            writeTypeSuffix(jsonGenerator);
-        }
-    }
-
-    @Override
-    public void writeCustomTypeSuffixForObject(final Object o, final JsonGenerator jsonGenerator, final String s) throws IOException {
-        jsonGenerator.writeEndObject();
-        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypeSuffix(s);
-    }
-
-    @Override
-    public void writeCustomTypeSuffixForArray(final Object o, final JsonGenerator jsonGenerator,final  String s) throws IOException {
-        jsonGenerator.writeEndArray();
-        // TODO: FULL_TYPES should be implemented here as : if (fullTypesModeEnabled()) writeTypeSuffix(s);
-    }
-
-    private boolean canWriteTypeId() {
-        return typeInfo != null
-                && typeInfo == TypeInfo.PARTIAL_TYPES;
-    }
-
-    private void writeTypePrefix(final JsonGenerator jsonGenerator, final String s) throws IOException {
-        jsonGenerator.writeStartObject();
-        jsonGenerator.writeStringField(this.getPropertyName(), s);
-        jsonGenerator.writeFieldName(this.valuePropertyName);
-    }
-
-    private void writeTypeSuffix(final JsonGenerator jsonGenerator) throws IOException {
-        jsonGenerator.writeEndObject();
-    }
-
-    /**
-     *  We force only **one** translation of a Java object to a domain specific object. i.e. users register typeIDs
-     *  and serializers/deserializers for the predefined types we have in the spec. Graph, Vertex, Edge,
-     *  VertexProperty, etc... And **not** their implementations (TinkerGraph, DetachedVertex, TinkerEdge, etc..)
-    */
-    private Class getClassFromObject(final Object o) {
-        final Class c = o.getClass();
-        if (classMap.containsKey(c))
-            return classMap.get(c);
-
-        final Class mapped;
-        if (Vertex.class.isAssignableFrom(c))
-            mapped = Vertex.class;
-        else if (Edge.class.isAssignableFrom(c))
-            mapped = Edge.class;
-        else if (Path.class.isAssignableFrom(c))
-            mapped = Path.class;
-        else if (VertexProperty.class.isAssignableFrom(c))
-            mapped = VertexProperty.class;
-        else if (Metrics.class.isAssignableFrom(c))
-            mapped = Metrics.class;
-        else if (TraversalMetrics.class.isAssignableFrom(c))
-            mapped = TraversalMetrics.class;
-        else if (Property.class.isAssignableFrom(c))
-            mapped = Property.class;
-        else if (ByteBuffer.class.isAssignableFrom(c))
-            mapped = ByteBuffer.class;
-        else if (InetAddress.class.isAssignableFrom(c))
-            mapped = InetAddress.class;
-        else if (Traverser.class.isAssignableFrom(c))
-            mapped = Traverser.class;
-        else if (Lambda.class.isAssignableFrom(c))
-            mapped = Lambda.class;
-        else if (VertexProperty.Cardinality.class.isAssignableFrom(c))
-            mapped = VertexProperty.Cardinality.class;
-        else if (Column.class.isAssignableFrom(c))
-            mapped = Column.class;
-        else if (Direction.class.isAssignableFrom(c))
-            mapped = Direction.class;
-        else if (Operator.class.isAssignableFrom(c))
-            mapped = Operator.class;
-        else if (Order.class.isAssignableFrom(c))
-            mapped = Order.class;
-        else if (Pop.class.isAssignableFrom(c))
-            mapped = Pop.class;
-        else if (SackFunctions.Barrier.class.isAssignableFrom(c))
-            mapped = SackFunctions.Barrier.class;
-        else if (TraversalOptionParent.Pick.class.isAssignableFrom(c))
-            mapped = TraversalOptionParent.Pick.class;
-        else if (Scope.class.isAssignableFrom(c))
-            mapped = Scope.class;
-        else if (T.class.isAssignableFrom(c))
-            mapped = T.class;
-        else
-            mapped = c;
-
-        classMap.put(c, mapped);
-        return mapped;
-    }
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV2d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV2d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV2d0.java
new file mode 100644
index 0000000..993f110
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV2d0.java
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.structure.io.graphson;
+
+import org.apache.tinkerpop.gremlin.process.traversal.Operator;
+import org.apache.tinkerpop.gremlin.process.traversal.Order;
+import org.apache.tinkerpop.gremlin.process.traversal.Path;
+import org.apache.tinkerpop.gremlin.process.traversal.Pop;
+import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
+import org.apache.tinkerpop.gremlin.process.traversal.Scope;
+import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
+import org.apache.tinkerpop.gremlin.process.traversal.util.Metrics;
+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;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.T;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.util.function.Lambda;
+import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeIdResolver;
+
+import java.net.InetAddress;
+import java.nio.ByteBuffer;
+
+/**
+ * GraphSON 2.0 {@code TypeSerializer}.
+ *
+ * @author Kevin Gallardo (https://kgdo.me)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class GraphSONTypeSerializerV2d0 extends AbstractGraphSONTypeSerializer {
+
+    GraphSONTypeSerializerV2d0(final TypeIdResolver idRes, final String propertyName, final TypeInfo typeInfo,
+                               final String valuePropertyName) {
+        super(idRes, propertyName, typeInfo, valuePropertyName);
+    }
+
+    @Override
+    protected Class getClassFromObject(final Object o) {
+        final Class c = o.getClass();
+        if (classMap.containsKey(c))
+            return classMap.get(c);
+
+        final Class mapped;
+        if (Vertex.class.isAssignableFrom(c))
+            mapped = Vertex.class;
+        else if (Edge.class.isAssignableFrom(c))
+            mapped = Edge.class;
+        else if (Path.class.isAssignableFrom(c))
+            mapped = Path.class;
+        else if (VertexProperty.class.isAssignableFrom(c))
+            mapped = VertexProperty.class;
+        else if (Metrics.class.isAssignableFrom(c))
+            mapped = Metrics.class;
+        else if (TraversalMetrics.class.isAssignableFrom(c))
+            mapped = TraversalMetrics.class;
+        else if (Property.class.isAssignableFrom(c))
+            mapped = Property.class;
+        else if (ByteBuffer.class.isAssignableFrom(c))
+            mapped = ByteBuffer.class;
+        else if (InetAddress.class.isAssignableFrom(c))
+            mapped = InetAddress.class;
+        else if (Traverser.class.isAssignableFrom(c))
+            mapped = Traverser.class;
+        else if (Lambda.class.isAssignableFrom(c))
+            mapped = Lambda.class;
+        else if (VertexProperty.Cardinality.class.isAssignableFrom(c))
+            mapped = VertexProperty.Cardinality.class;
+        else if (Column.class.isAssignableFrom(c))
+            mapped = Column.class;
+        else if (Direction.class.isAssignableFrom(c))
+            mapped = Direction.class;
+        else if (Operator.class.isAssignableFrom(c))
+            mapped = Operator.class;
+        else if (Order.class.isAssignableFrom(c))
+            mapped = Order.class;
+        else if (Pop.class.isAssignableFrom(c))
+            mapped = Pop.class;
+        else if (SackFunctions.Barrier.class.isAssignableFrom(c))
+            mapped = SackFunctions.Barrier.class;
+        else if (TraversalOptionParent.Pick.class.isAssignableFrom(c))
+            mapped = TraversalOptionParent.Pick.class;
+        else if (Scope.class.isAssignableFrom(c))
+            mapped = Scope.class;
+        else if (T.class.isAssignableFrom(c))
+            mapped = T.class;
+        else
+            mapped = c;
+
+        classMap.put(c, mapped);
+        return mapped;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java
new file mode 100644
index 0000000..246d38f
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.structure.io.graphson;
+
+import org.apache.tinkerpop.gremlin.process.traversal.Operator;
+import org.apache.tinkerpop.gremlin.process.traversal.Order;
+import org.apache.tinkerpop.gremlin.process.traversal.Path;
+import org.apache.tinkerpop.gremlin.process.traversal.Pop;
+import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
+import org.apache.tinkerpop.gremlin.process.traversal.Scope;
+import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
+import org.apache.tinkerpop.gremlin.process.traversal.util.Metrics;
+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;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.T;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.util.function.Lambda;
+import org.apache.tinkerpop.shaded.jackson.core.JsonGenerator;
+import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeIdResolver;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.nio.ByteBuffer;
+import java.util.Map;
+
+/**
+ * GraphSON 2.0 {@code TypeSerializer}.
+ *
+ * @author Kevin Gallardo (https://kgdo.me)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class GraphSONTypeSerializerV3d0 extends AbstractGraphSONTypeSerializer {
+
+    GraphSONTypeSerializerV3d0(final TypeIdResolver idRes, final String propertyName, final TypeInfo typeInfo,
+                               final String valuePropertyName) {
+        super(idRes, propertyName, typeInfo, valuePropertyName);
+    }
+
+    @Override
+    public void writeTypePrefixForObject(final Object o, final JsonGenerator jsonGenerator) throws IOException {
+        if (o instanceof Map || o instanceof Map.Entry) {
+            writeTypePrefix(jsonGenerator, getTypeIdResolver().idFromValueAndType(o, getClassFromObject(o)));
+            jsonGenerator.writeStartArray();
+        } else {
+            jsonGenerator.writeStartObject();
+        }
+    }
+
+    @Override
+    public void writeTypeSuffixForObject(final Object o, final JsonGenerator jsonGenerator) throws IOException {
+        if (o instanceof Map || o instanceof Map.Entry) {
+            jsonGenerator.writeEndArray();
+            writeTypeSuffix(jsonGenerator);
+        } else {
+            jsonGenerator.writeEndObject();
+        }
+    }
+
+    @Override
+    protected Class getClassFromObject(final Object o) {
+        final Class c = o.getClass();
+        if (classMap.containsKey(c))
+            return classMap.get(c);
+
+        final Class mapped;
+        if (Map.class.isAssignableFrom(c))
+            mapped = Map.class;
+        else if (Map.Entry.class.isAssignableFrom(c))
+            mapped = Map.Entry.class;
+        else if (Vertex.class.isAssignableFrom(c))
+            mapped = Vertex.class;
+        else if (Edge.class.isAssignableFrom(c))
+            mapped = Edge.class;
+        else if (Path.class.isAssignableFrom(c))
+            mapped = Path.class;
+        else if (VertexProperty.class.isAssignableFrom(c))
+            mapped = VertexProperty.class;
+        else if (Metrics.class.isAssignableFrom(c))
+            mapped = Metrics.class;
+        else if (TraversalMetrics.class.isAssignableFrom(c))
+            mapped = TraversalMetrics.class;
+        else if (Property.class.isAssignableFrom(c))
+            mapped = Property.class;
+        else if (ByteBuffer.class.isAssignableFrom(c))
+            mapped = ByteBuffer.class;
+        else if (InetAddress.class.isAssignableFrom(c))
+            mapped = InetAddress.class;
+        else if (Traverser.class.isAssignableFrom(c))
+            mapped = Traverser.class;
+        else if (Lambda.class.isAssignableFrom(c))
+            mapped = Lambda.class;
+        else if (VertexProperty.Cardinality.class.isAssignableFrom(c))
+            mapped = VertexProperty.Cardinality.class;
+        else if (Column.class.isAssignableFrom(c))
+            mapped = Column.class;
+        else if (Direction.class.isAssignableFrom(c))
+            mapped = Direction.class;
+        else if (Operator.class.isAssignableFrom(c))
+            mapped = Operator.class;
+        else if (Order.class.isAssignableFrom(c))
+            mapped = Order.class;
+        else if (Pop.class.isAssignableFrom(c))
+            mapped = Pop.class;
+        else if (SackFunctions.Barrier.class.isAssignableFrom(c))
+            mapped = SackFunctions.Barrier.class;
+        else if (TraversalOptionParent.Pick.class.isAssignableFrom(c))
+            mapped = TraversalOptionParent.Pick.class;
+        else if (Scope.class.isAssignableFrom(c))
+            mapped = Scope.class;
+        else if (T.class.isAssignableFrom(c))
+            mapped = T.class;
+        else
+            mapped = c;
+
+        classMap.put(c, mapped);
+        return mapped;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONXModuleV2d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONXModuleV2d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONXModuleV2d0.java
index 336d11c..0d4ba53 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONXModuleV2d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONXModuleV2d0.java
@@ -18,10 +18,6 @@
  */
 package org.apache.tinkerpop.gremlin.structure.io.graphson;
 
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.net.InetAddress;
@@ -45,6 +41,8 @@ import java.util.Map;
 
 /**
  * Version 2.0 of GraphSON extensions.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public final class GraphSONXModuleV2d0 extends GraphSONModule {
 
@@ -139,4 +137,4 @@ public final class GraphSONXModuleV2d0 extends GraphSONModule {
             return new GraphSONXModuleV2d0(normalize);
         }
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONXModuleV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONXModuleV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONXModuleV3d0.java
index 777c6c4..38caa09 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONXModuleV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONXModuleV3d0.java
@@ -18,10 +18,6 @@
  */
 package org.apache.tinkerpop.gremlin.structure.io.graphson;
 
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.net.InetAddress;
@@ -45,6 +41,8 @@ import java.util.Map;
 
 /**
  * Version 3.0 of GraphSON extensions.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public final class GraphSONXModuleV3d0 extends GraphSONModule {
 
@@ -139,4 +137,4 @@ public final class GraphSONXModuleV3d0 extends GraphSONModule {
             return new GraphSONXModuleV3d0(normalize);
         }
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaTimeSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaTimeSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaTimeSerializersV3d0.java
index 1cb75e0..c1668e2 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaTimeSerializersV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaTimeSerializersV3d0.java
@@ -85,6 +85,11 @@ final class JavaTimeSerializersV3d0 {
         public T deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException {
             return parse(jsonParser.getText());
         }
+
+        @Override
+        public boolean isCachable() {
+            return true;
+        }
     }
 
     final static class DurationJacksonSerializer extends AbstractJavaTimeSerializer<Duration> {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java
index 816a3f7..900eeb8 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java
@@ -18,16 +18,22 @@
  */
 package org.apache.tinkerpop.gremlin.structure.io.graphson;
 
-import org.apache.tinkerpop.gremlin.structure.Element;
 import org.apache.tinkerpop.shaded.jackson.core.JsonGenerator;
-import org.apache.tinkerpop.shaded.jackson.databind.SerializationFeature;
+import org.apache.tinkerpop.shaded.jackson.core.JsonParser;
+import org.apache.tinkerpop.shaded.jackson.core.JsonProcessingException;
+import org.apache.tinkerpop.shaded.jackson.core.JsonToken;
+import org.apache.tinkerpop.shaded.jackson.databind.DeserializationContext;
 import org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider;
+import org.apache.tinkerpop.shaded.jackson.databind.deser.std.StdDeserializer;
 import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer;
+import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdScalarSerializer;
 import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdSerializer;
 
 import java.io.IOException;
-import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * GraphSON serializers for classes in {@code java.util.*} for the version 3.0 of GraphSON.
@@ -36,6 +42,31 @@ final class JavaUtilSerializersV3d0 {
 
     private JavaUtilSerializersV3d0() {}
 
+    ////////////////////////////// SERIALIZERS /////////////////////////////////
+
+    final static class MapJacksonSerializer extends StdSerializer<Map> {
+        public MapJacksonSerializer() {
+            super(Map.class);
+        }
+
+        @Override
+        public void serialize(final Map map, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
+                throws IOException {
+            for(Map.Entry entry : (Set<Map.Entry>) map.entrySet()) {
+                jsonGenerator.writeObject(entry.getKey());
+                jsonGenerator.writeObject(entry.getValue());
+            }
+        }
+
+        @Override
+        public void serializeWithType(final Map map, final JsonGenerator jsonGenerator,
+                                      final SerializerProvider serializerProvider, final TypeSerializer typeSerializer) throws IOException {
+            typeSerializer.writeTypePrefixForObject(map, jsonGenerator);
+            serialize(map, jsonGenerator, serializerProvider);
+            typeSerializer.writeTypeSuffixForObject(map, jsonGenerator);
+        }
+    }
+
     final static class MapEntryJacksonSerializer extends StdSerializer<Map.Entry> {
 
         public MapEntryJacksonSerializer() {
@@ -45,41 +76,61 @@ final class JavaUtilSerializersV3d0 {
         @Override
         public void serialize(final Map.Entry entry, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
                 throws IOException {
-            jsonGenerator.writeStartObject();
-            ser(entry, jsonGenerator, serializerProvider);
-            jsonGenerator.writeEndObject();
+            jsonGenerator.writeObject(entry.getKey());
+            jsonGenerator.writeObject(entry.getValue());
         }
 
         @Override
         public void serializeWithType(final Map.Entry entry, final JsonGenerator jsonGenerator,
                                       final SerializerProvider serializerProvider, final TypeSerializer typeSerializer) throws IOException {
             typeSerializer.writeTypePrefixForObject(entry, jsonGenerator);
-            ser(entry, jsonGenerator, serializerProvider);
+            serialize(entry, jsonGenerator, serializerProvider);
             typeSerializer.writeTypeSuffixForObject(entry, jsonGenerator);
         }
+    }
+
+    ////////////////////////////// DESERIALIZERS /////////////////////////////////
+
+
+    static class MapJacksonDeserializer extends StdDeserializer<Map> {
+
+        protected MapJacksonDeserializer() {
+            super(Map.class);
+        }
+
+        @Override
+        public Map deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            final Map<Object,Object> m = new LinkedHashMap<>();
+
+            while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
+                final Object key = deserializationContext.readValue(jsonParser, Object.class);
+                jsonParser.nextToken();
+                final Object val = deserializationContext.readValue(jsonParser, Object.class);
+                m.put(key, val);
+            }
+
+            return m;
+        }
+    }
+
+    static class MapEntryJacksonDeserializer extends StdDeserializer<Map.Entry> {
+
+        protected MapEntryJacksonDeserializer() {
+            super(Map.Entry.class);
+        }
+
+        @Override
+        public Map.Entry deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            final Map<Object,Object> m = new HashMap<>();
+
+            while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
+                final Object key = deserializationContext.readValue(jsonParser, Object.class);
+                jsonParser.nextToken();
+                final Object val = deserializationContext.readValue(jsonParser, Object.class);
+                m.put(key, val);
+            }
 
-        private static void ser(final Map.Entry entry, final JsonGenerator jsonGenerator,
-                                final SerializerProvider serializerProvider) throws IOException {
-            // this treatment of keys is consistent with the current GraphSONKeySerializer which extends the
-            // StdKeySerializer
-            final Object key = entry.getKey();
-            final Class cls = key.getClass();
-            String k;
-            if (cls == String.class)
-                k = (String) key;
-            else if (Element.class.isAssignableFrom(cls))
-                k = ((Element) key).id().toString();
-            else if(Date.class.isAssignableFrom(cls)) {
-                if (serializerProvider.isEnabled(SerializationFeature.WRITE_DATE_KEYS_AS_TIMESTAMPS))
-                    k = String.valueOf(((Date) key).getTime());
-                else
-                    k = serializerProvider.getConfig().getDateFormat().format((Date) key);
-            } else if(cls == Class.class)
-                k = ((Class) key).getName();
-            else
-                k = key.toString();
-
-            serializerProvider.defaultSerializeField(k, entry.getValue(), jsonGenerator);
+            return m.entrySet().iterator().next();
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java
index e4f6df9..57b6736 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java
@@ -35,14 +35,19 @@ import org.apache.tinkerpop.gremlin.util.function.Lambda;
 import org.apache.tinkerpop.shaded.jackson.core.JsonGenerator;
 import org.apache.tinkerpop.shaded.jackson.core.JsonParser;
 import org.apache.tinkerpop.shaded.jackson.core.JsonProcessingException;
+import org.apache.tinkerpop.shaded.jackson.core.JsonToken;
 import org.apache.tinkerpop.shaded.jackson.databind.DeserializationContext;
+import org.apache.tinkerpop.shaded.jackson.databind.JavaType;
+import org.apache.tinkerpop.shaded.jackson.databind.JsonNode;
 import org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider;
 import org.apache.tinkerpop.shaded.jackson.databind.deser.std.StdDeserializer;
 import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer;
 import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdScalarSerializer;
 import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdSerializer;
+import org.apache.tinkerpop.shaded.jackson.databind.type.TypeFactory;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
@@ -242,29 +247,40 @@ final class TraversalSerializersV3d0 {
     // DESERIALIZERS //
     //////////////////
 
-    final static class BytecodeJacksonDeserializer extends AbstractObjectDeserializer<Bytecode> {
+    final static class BytecodeJacksonDeserializer extends StdDeserializer<Bytecode> {
+        private static final JavaType listJavaType = TypeFactory.defaultInstance().constructCollectionType(ArrayList.class, Object.class);
+        private static final JavaType listListJavaType = TypeFactory.defaultInstance().constructCollectionType(ArrayList.class, listJavaType);
 
         public BytecodeJacksonDeserializer() {
             super(Bytecode.class);
         }
 
         @Override
-        public Bytecode createObject(final Map<String, Object> data) {
+        public Bytecode deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
             final Bytecode bytecode = new Bytecode();
-            if (data.containsKey(GraphSONTokens.SOURCE)) {
-                final List<List<Object>> instructions = (List) data.get(GraphSONTokens.SOURCE);
-                for (final List<Object> instruction : instructions) {
-                    bytecode.addSource((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size()));
-                }
-            }
-            if (data.containsKey(GraphSONTokens.STEP)) {
-                final List<List<Object>> instructions = (List) data.get(GraphSONTokens.STEP);
-                for (final List<Object> instruction : instructions) {
-                    bytecode.addStep((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size()));
+
+            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
+                if (jsonParser.getCurrentName().equals(GraphSONTokens.SOURCE)) {
+                    jsonParser.nextToken();
+                    final List<List<Object>> instructions = deserializationContext.readValue(jsonParser, listListJavaType);
+                    for (final List<Object> instruction : instructions) {
+                        bytecode.addSource((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size()));
+                    }
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.STEP)) {
+                    jsonParser.nextToken();
+                    final List<List<Object>> instructions = deserializationContext.readValue(jsonParser, listListJavaType);
+                    for (final List<Object> instruction : instructions) {
+                        bytecode.addStep((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size()));
+                    }
                 }
             }
             return bytecode;
         }
+
+        @Override
+        public boolean isCachable() {
+            return true;
+        }
     }
 
     final static class EnumJacksonDeserializer<A extends Enum> extends StdDeserializer<A> {
@@ -283,18 +299,34 @@ final class TraversalSerializersV3d0 {
             }
             throw new IOException("Unknown enum type: " + enumClass);
         }
+
+        @Override
+        public boolean isCachable() {
+            return true;
+        }
     }
 
-    final static class PJacksonDeserializer extends AbstractObjectDeserializer<P> {
+    final static class PJacksonDeserializer extends StdDeserializer<P> {
 
         public PJacksonDeserializer() {
             super(P.class);
         }
 
         @Override
-        public P createObject(final Map<String, Object> data) {
-            final String predicate = (String) data.get(GraphSONTokens.PREDICATE);
-            final Object value = data.get(GraphSONTokens.VALUE);
+        public P deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            String predicate = null;
+            Object value = null;
+
+            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
+                if (jsonParser.getCurrentName().equals(GraphSONTokens.PREDICATE)) {
+                    jsonParser.nextToken();
+                    predicate = jsonParser.getText();
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.VALUE)) {
+                    jsonParser.nextToken();
+                    value = deserializationContext.readValue(jsonParser, Object.class);
+                }
+            }
+
             if (predicate.equals(GraphSONTokens.AND) || predicate.equals(GraphSONTokens.OR)) {
                 return predicate.equals(GraphSONTokens.AND) ? new AndP((List<P>) value) : new OrP((List<P>) value);
             } else {
@@ -324,20 +356,38 @@ final class TraversalSerializersV3d0 {
                 }
             }
         }
+
+        @Override
+        public boolean isCachable() {
+            return true;
+        }
     }
 
-    final static class LambdaJacksonDeserializer extends AbstractObjectDeserializer<Lambda> {
+    final static class LambdaJacksonDeserializer extends StdDeserializer<Lambda> {
 
         public LambdaJacksonDeserializer() {
             super(Lambda.class);
         }
 
         @Override
-        public Lambda createObject(final Map<String, Object> data) {
-            final String script = (String) data.get(GraphSONTokens.SCRIPT);
-            final String language = (String) data.get(GraphSONTokens.LANGUAGE);
-            final int arguments = ((Number) data.getOrDefault(GraphSONTokens.ARGUMENTS, -1)).intValue();
-            //
+        public Lambda deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            String script = null;
+            String language = null;
+            int arguments = -1;
+
+            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
+                if (jsonParser.getCurrentName().equals(GraphSONTokens.SCRIPT)) {
+                    jsonParser.nextToken();
+                    script = jsonParser.getText();
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.LANGUAGE)) {
+                    jsonParser.nextToken();
+                    language = jsonParser.getText();
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.ARGUMENTS)) {
+                    jsonParser.nextToken();
+                    arguments = jsonParser.getIntValue();
+                }
+            }
+
             if (-1 == arguments || arguments > 2)
                 return new Lambda.UnknownArgLambda(script, language, arguments);
             else if (0 == arguments)
@@ -347,29 +397,69 @@ final class TraversalSerializersV3d0 {
             else
                 return new Lambda.TwoArgLambda<>(script, language);
         }
+
+        @Override
+        public boolean isCachable() {
+            return true;
+        }
     }
 
-    final static class BindingJacksonDeserializer extends AbstractObjectDeserializer<Bytecode.Binding> {
+    final static class BindingJacksonDeserializer extends StdDeserializer<Bytecode.Binding> {
 
         public BindingJacksonDeserializer() {
             super(Bytecode.Binding.class);
         }
 
         @Override
-        public Bytecode.Binding createObject(final Map<String, Object> data) {
-            return new Bytecode.Binding<>((String) data.get(GraphSONTokens.KEY), data.get(GraphSONTokens.VALUE));
+        public Bytecode.Binding deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            String k = null;
+            Object v = null;
+
+            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
+                if (jsonParser.getCurrentName().equals(GraphSONTokens.KEY)) {
+                    jsonParser.nextToken();
+                    k = jsonParser.getText();
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.VALUE)) {
+                    jsonParser.nextToken();
+                    v = deserializationContext.readValue(jsonParser, Object.class);
+                }
+            }
+            return new Bytecode.Binding<>(k, v);
+        }
+
+        @Override
+        public boolean isCachable() {
+            return true;
         }
     }
 
-    static class TraverserJacksonDeserializer extends AbstractObjectDeserializer<Traverser> {
+    static class TraverserJacksonDeserializer extends StdDeserializer<Traverser> {
 
         public TraverserJacksonDeserializer() {
             super(Traverser.class);
         }
 
         @Override
-        public Traverser createObject(final Map<String, Object> data) {
-            return new DefaultRemoteTraverser<>(data.get(GraphSONTokens.VALUE), (Long) data.get(GraphSONTokens.BULK));
+        public Traverser deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
+            long bulk = 1;
+            Object v = null;
+
+            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
+                if (jsonParser.getCurrentName().equals(GraphSONTokens.BULK)) {
+                    jsonParser.nextToken();
+                    bulk = deserializationContext.readValue(jsonParser, Long.class);
+                } else if (jsonParser.getCurrentName().equals(GraphSONTokens.VALUE)) {
+                    jsonParser.nextToken();
+                    v = deserializationContext.readValue(jsonParser, Object.class);
+                }
+            }
+
+            return new DefaultRemoteTraverser<>(v, bulk);
+        }
+
+        @Override
+        public boolean isCachable() {
+            return true;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bef05a8e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGraphSONSerializerV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGraphSONSerializerV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGraphSONSerializerV3d0.java
new file mode 100644
index 0000000..9a9682c
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGraphSONSerializerV3d0.java
@@ -0,0 +1,165 @@
+/*
+ * 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.util.star;
+
+import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens;
+import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONUtil;
+import org.apache.tinkerpop.gremlin.structure.util.Comparators;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.apache.tinkerpop.shaded.jackson.core.JsonGenerationException;
+import org.apache.tinkerpop.shaded.jackson.core.JsonGenerator;
+import org.apache.tinkerpop.shaded.jackson.core.JsonProcessingException;
+import org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider;
+import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer;
+import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdSerializer;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class StarGraphGraphSONSerializerV3d0 extends StdSerializer<DirectionalStarGraph> {
+    private final boolean normalize;
+    public StarGraphGraphSONSerializerV3d0(final boolean normalize) {
+        super(DirectionalStarGraph.class);
+        this.normalize = normalize;
+    }
+
+    @Override
+    public void serialize(final DirectionalStarGraph starGraph, final JsonGenerator jsonGenerator,
+                          final SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
+        ser(starGraph, jsonGenerator, serializerProvider, null);
+    }
+
+    @Override
+    public void serializeWithType(final DirectionalStarGraph starGraph, final JsonGenerator jsonGenerator,
+                                  final SerializerProvider serializerProvider,
+                                  final TypeSerializer typeSerializer) throws IOException, JsonProcessingException {
+        ser(starGraph, jsonGenerator, serializerProvider, typeSerializer);
+    }
+
+    private void ser(final DirectionalStarGraph directionalStarGraph, final JsonGenerator jsonGenerator,
+                     final SerializerProvider serializerProvider,
+                     final TypeSerializer typeSerializer) throws IOException, JsonProcessingException {
+        final StarGraph starGraph = directionalStarGraph.getStarGraphToSerialize();
+        GraphSONUtil.writeStartObject(starGraph, jsonGenerator, typeSerializer);
+        GraphSONUtil.writeWithType(GraphSONTokens.ID, starGraph.starVertex.id, jsonGenerator, serializerProvider, typeSerializer);
+        jsonGenerator.writeStringField(GraphSONTokens.LABEL, starGraph.starVertex.label);
+        if (directionalStarGraph.getDirection() != null) writeEdges(directionalStarGraph, jsonGenerator, serializerProvider, typeSerializer, Direction.IN);
+        if (directionalStarGraph.getDirection() != null) writeEdges(directionalStarGraph, jsonGenerator, serializerProvider, typeSerializer, Direction.OUT);
+        if (starGraph.starVertex.vertexProperties != null && !starGraph.starVertex.vertexProperties.isEmpty()) {
+            jsonGenerator.writeFieldName(GraphSONTokens.PROPERTIES);
+            GraphSONUtil.writeStartObject(starGraph, jsonGenerator, typeSerializer);
+            final Set<String> keys = normalize ? new TreeSet<>(starGraph.starVertex.vertexProperties.keySet()) : starGraph.starVertex.vertexProperties.keySet();
+            for (final String k : keys) {
+                final List<VertexProperty> vp = starGraph.starVertex.vertexProperties.get(k);
+                jsonGenerator.writeFieldName(k);
+                GraphSONUtil.writeStartArray(k, jsonGenerator, typeSerializer);
+
+                final List<VertexProperty> vertexProperties = normalize ?sort(vp, Comparators.PROPERTY_COMPARATOR) : vp;
+                for (final VertexProperty property : vertexProperties) {
+                    GraphSONUtil.writeStartObject(property, jsonGenerator, typeSerializer);
+                    GraphSONUtil.writeWithType(GraphSONTokens.ID, property.id(), jsonGenerator, serializerProvider, typeSerializer);
+                    GraphSONUtil.writeWithType(GraphSONTokens.VALUE, property.value(), jsonGenerator, serializerProvider, typeSerializer);
+
+                    final Iterator<Property> metaProperties = normalize ?
+                            IteratorUtils.list(property.properties(), Comparators.PROPERTY_COMPARATOR).iterator() : property.properties();
+                    if (metaProperties.hasNext()) {
+                        jsonGenerator.writeFieldName(GraphSONTokens.PROPERTIES);
+                        GraphSONUtil.writeStartObject(metaProperties, jsonGenerator, typeSerializer);
+
+                        while (metaProperties.hasNext()) {
+                            final Property<Object> meta = metaProperties.next();
+                            GraphSONUtil.writeWithType(meta.key(), meta.value(), jsonGenerator, serializerProvider, typeSerializer);
+                        }
+                        GraphSONUtil.writeEndObject(metaProperties, jsonGenerator, typeSerializer);
+                    }
+                    GraphSONUtil.writeEndObject(property, jsonGenerator, typeSerializer);
+                }
+                GraphSONUtil.writeEndArray(k, jsonGenerator, typeSerializer);
+            }
+            GraphSONUtil.writeEndObject(starGraph, jsonGenerator, typeSerializer);
+        }
+        GraphSONUtil.writeEndObject(starGraph, jsonGenerator, typeSerializer);
+    }
+
+    private void writeEdges(final DirectionalStarGraph directionalStarGraph, final JsonGenerator jsonGenerator,
+                            final SerializerProvider serializerProvider,
+                            final TypeSerializer typeSerializer,
+                            final Direction direction)  throws IOException, JsonProcessingException {
+        // only write edges if there are some AND if the user requested them to be serialized AND if they match
+        // the direction being serialized by the format
+        final StarGraph starGraph = directionalStarGraph.getStarGraphToSerialize();
+        final Direction edgeDirectionToSerialize = directionalStarGraph.getDirection();
+        final Map<String, List<Edge>> starEdges = direction.equals(Direction.OUT) ? starGraph.starVertex.outEdges : starGraph.starVertex.inEdges;
+        final boolean writeEdges = null != starEdges && edgeDirectionToSerialize != null
+                && (edgeDirectionToSerialize == direction || edgeDirectionToSerialize == Direction.BOTH);
+        if (writeEdges) {
+            jsonGenerator.writeFieldName(direction == Direction.IN ? GraphSONTokens.IN_E : GraphSONTokens.OUT_E);
+            GraphSONUtil.writeStartObject(directionalStarGraph, jsonGenerator, typeSerializer);
+            final Set<String> keys = normalize ? new TreeSet<>(starEdges.keySet()) : starEdges.keySet();
+            for (final String k : keys) {
+                final List<Edge> edges = starEdges.get(k);
+                jsonGenerator.writeFieldName(k);
+                GraphSONUtil.writeStartArray(k, jsonGenerator, typeSerializer);
+
+                final List<Edge> edgesToWrite = normalize ? sort(edges, Comparators.EDGE_COMPARATOR) : edges;
+                for (final Edge edge : edgesToWrite) {
+                    GraphSONUtil.writeStartObject(edge, jsonGenerator, typeSerializer);
+                    GraphSONUtil.writeWithType(GraphSONTokens.ID, edge.id(), jsonGenerator, serializerProvider, typeSerializer);
+                    GraphSONUtil.writeWithType(direction.equals(Direction.OUT) ? GraphSONTokens.IN : GraphSONTokens.OUT,
+                            direction.equals(Direction.OUT) ? edge.inVertex().id() : edge.outVertex().id(),
+                            jsonGenerator, serializerProvider, typeSerializer);
+
+                    final Iterator<Property<Object>> edgeProperties = normalize ?
+                            IteratorUtils.list(edge.properties(), Comparators.PROPERTY_COMPARATOR).iterator() : edge.properties();
+                    if (edgeProperties.hasNext()) {
+                        jsonGenerator.writeFieldName(GraphSONTokens.PROPERTIES);
+                        GraphSONUtil.writeStartObject(edge, jsonGenerator, typeSerializer);
+                        while (edgeProperties.hasNext()) {
+                            final Property<Object> meta = edgeProperties.next();
+                            GraphSONUtil.writeWithType(meta.key(), meta.value(), jsonGenerator, serializerProvider, typeSerializer);
+                        }
+                        GraphSONUtil.writeEndObject(edge, jsonGenerator, typeSerializer);
+                    }
+                    GraphSONUtil.writeEndObject(edge, jsonGenerator, typeSerializer);
+                }
+                GraphSONUtil.writeEndArray(k, jsonGenerator, typeSerializer);
+            }
+            GraphSONUtil.writeEndObject(directionalStarGraph, jsonGenerator, typeSerializer);
+        }
+    }
+
+    private static <S> List<S> sort(final List<S> listToSort, final Comparator comparator) {
+        Collections.sort(listToSort, comparator);
+        return listToSort;
+    }
+
+}


[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/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-1427
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
----------------------------------------------------------------------


[39/50] [abbrv] tinkerpop git commit: TINKERPOP-1427 Migrate GraphSON v2 performance enhancement to v3

Posted by sp...@apache.org.
TINKERPOP-1427 Migrate GraphSON v2 performance enhancement to v3

This was for TinkerGraph whole graph serialization.


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

Branch: refs/heads/TINKERPOP-1427
Commit: 98a6c5958e8655588bf06ed9a80c0abb90bd6882
Parents: bef05a8
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Sat Jul 1 15:08:53 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 16:23:52 2017 -0400

----------------------------------------------------------------------
 .../structure/TinkerIoRegistryV3d0.java         | 38 +++++++++-----------
 1 file changed, 17 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/98a6c595/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV3d0.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV3d0.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV3d0.java
index c2eebf9..c6ff44f 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV3d0.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV3d0.java
@@ -36,6 +36,7 @@ import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
 import org.apache.tinkerpop.shaded.jackson.core.JsonGenerator;
 import org.apache.tinkerpop.shaded.jackson.core.JsonParser;
 import org.apache.tinkerpop.shaded.jackson.core.JsonProcessingException;
+import org.apache.tinkerpop.shaded.jackson.core.JsonToken;
 import org.apache.tinkerpop.shaded.jackson.databind.DeserializationContext;
 import org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider;
 import org.apache.tinkerpop.shaded.jackson.databind.deser.std.StdDeserializer;
@@ -50,8 +51,6 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -191,26 +190,23 @@ public final class TinkerIoRegistryV3d0 extends AbstractIoRegistry {
             conf.setProperty("gremlin.tinkergraph.defaultVertexPropertyCardinality", "list");
             final TinkerGraph graph = TinkerGraph.open(conf);
 
-            final List<? extends Edge> edges;
-            final List<? extends Vertex> vertices;
-
-            jsonParser.nextToken();
-            final Map<String, Object> graphData = deserializationContext.readValue(jsonParser, LinkedHashMap.class);
-            vertices = (List<DetachedVertex>) graphData.get(GraphSONTokens.VERTICES);
-            edges = (List<DetachedEdge>) graphData.get(GraphSONTokens.EDGES);
-
-
-            vertices.forEach(e -> {
-                if (e instanceof DetachedVertex) {
-                    ((DetachedVertex)e).attach(Attachable.Method.getOrCreate(graph));
+            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
+                if (jsonParser.getCurrentName().equals("vertices")) {
+                    while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
+                        if (jsonParser.currentToken() == JsonToken.START_OBJECT) {
+                            final DetachedVertex v = (DetachedVertex) deserializationContext.readValue(jsonParser, Vertex.class);
+                            v.attach(Attachable.Method.getOrCreate(graph));
+                        }
+                    }
+                } else if (jsonParser.getCurrentName().equals("edges")) {
+                    while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
+                        if (jsonParser.currentToken() == JsonToken.START_OBJECT) {
+                            final DetachedEdge e = (DetachedEdge) deserializationContext.readValue(jsonParser, Edge.class);
+                            e.attach(Attachable.Method.getOrCreate(graph));
+                        }
+                    }
                 }
-            });
-
-            edges.forEach(e -> {
-                if (e instanceof DetachedEdge) {
-                    ((DetachedEdge) e).attach(Attachable.Method.getOrCreate(graph));
-                }
-            });
+            }
 
             return graph;
         }


[46/50] [abbrv] tinkerpop git commit: TINKERPOP-1427 Coerced Map.Entry to a Map with single entry

Posted by sp...@apache.org.
TINKERPOP-1427 Coerced Map.Entry to a Map with single entry


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

Branch: refs/heads/TINKERPOP-1427
Commit: 918c14bdffde611100ca9ac3223988359afefedc
Parents: c12988c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jul 10 12:50:28 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 10 16:25:38 2017 -0400

----------------------------------------------------------------------
 .../structure/io/graphson/GraphSONModule.java   |  2 --
 .../io/graphson/GraphSONTypeSerializerV3d0.java |  6 ++--
 .../io/graphson/JavaUtilSerializersV3d0.java    | 32 ++++----------------
 .../ser/GraphSONMessageSerializerV3d0Test.java  |  5 +--
 .../server/GremlinServerHttpIntegrateTest.java  |  2 +-
 5 files changed, 12 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/918c14bd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
index 00bec01..9354eac 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
@@ -125,7 +125,6 @@ abstract class GraphSONModule extends TinkerPopJacksonModule {
                     put(Double.class, "Double");
                     put(Float.class, "Float");
 
-                    put(Map.Entry.class, "Entry");
                     put(Map.class, "Map");
                     put(List.class, "List");
                     put(Set.class, "Set");
@@ -249,7 +248,6 @@ abstract class GraphSONModule extends TinkerPopJacksonModule {
             addDeserializer(Tree.class, new GraphSONSerializersV3d0.TreeJacksonDeserializer());
 
             // java.util
-            addDeserializer(Map.Entry.class, new JavaUtilSerializersV3d0.MapEntryJacksonDeserializer());
             addDeserializer(Map.class, new JavaUtilSerializersV3d0.MapJacksonDeserializer());
             addDeserializer(List.class, new JavaUtilSerializersV3d0.ListJacksonDeserializer());
             addDeserializer(Set.class, new JavaUtilSerializersV3d0.SetJacksonDeserializer());

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/918c14bd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java
index f3b7afa..6d47ad9 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java
@@ -61,7 +61,7 @@ public class GraphSONTypeSerializerV3d0 extends AbstractGraphSONTypeSerializer {
 
     @Override
     public void writeTypePrefixForObject(final Object o, final JsonGenerator jsonGenerator) throws IOException {
-        if (o instanceof Map || o instanceof Map.Entry) {
+        if (o instanceof Map) {
             writeTypePrefix(jsonGenerator, getTypeIdResolver().idFromValueAndType(o, getClassFromObject(o)));
             jsonGenerator.writeStartArray();
         } else {
@@ -71,7 +71,7 @@ public class GraphSONTypeSerializerV3d0 extends AbstractGraphSONTypeSerializer {
 
     @Override
     public void writeTypeSuffixForObject(final Object o, final JsonGenerator jsonGenerator) throws IOException {
-        if (o instanceof Map || o instanceof Map.Entry) {
+        if (o instanceof Map) {
             jsonGenerator.writeEndArray();
             writeTypeSuffix(jsonGenerator);
         } else {
@@ -108,8 +108,6 @@ public class GraphSONTypeSerializerV3d0 extends AbstractGraphSONTypeSerializer {
         final Class mapped;
         if (Map.class.isAssignableFrom(c))
             mapped = Map.class;
-        else if (Map.Entry.class.isAssignableFrom(c))
-            mapped = Map.Entry.class;
         else if (List.class.isAssignableFrom(c))
             mapped = List.class;
         else if (Set.class.isAssignableFrom(c))

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/918c14bd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java
index 8298ce7..f5c4da8 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/JavaUtilSerializersV3d0.java
@@ -26,7 +26,6 @@ import org.apache.tinkerpop.shaded.jackson.databind.DeserializationContext;
 import org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider;
 import org.apache.tinkerpop.shaded.jackson.databind.deser.std.StdDeserializer;
 import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer;
-import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdScalarSerializer;
 import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdSerializer;
 
 import java.io.IOException;
@@ -70,6 +69,9 @@ final class JavaUtilSerializersV3d0 {
         }
     }
 
+    /**
+     * Coerces {@code Map.Entry} to a {@code Map} with a single entry in it.
+     */
     final static class MapEntryJacksonSerializer extends StdSerializer<Map.Entry> {
 
         public MapEntryJacksonSerializer() {
@@ -79,16 +81,15 @@ final class JavaUtilSerializersV3d0 {
         @Override
         public void serialize(final Map.Entry entry, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
                 throws IOException {
-            jsonGenerator.writeObject(entry.getKey());
-            jsonGenerator.writeObject(entry.getValue());
+            final Map<Object,Object> m = new HashMap<>();
+            if (entry != null) m.put(entry.getKey(), entry.getValue());
+            jsonGenerator.writeObject(m);
         }
 
         @Override
         public void serializeWithType(final Map.Entry entry, final JsonGenerator jsonGenerator,
                                       final SerializerProvider serializerProvider, final TypeSerializer typeSerializer) throws IOException {
-            typeSerializer.writeTypePrefixForObject(entry, jsonGenerator);
             serialize(entry, jsonGenerator, serializerProvider);
-            typeSerializer.writeTypeSuffixForObject(entry, jsonGenerator);
         }
     }
 
@@ -160,27 +161,6 @@ final class JavaUtilSerializersV3d0 {
         }
     }
 
-    static class MapEntryJacksonDeserializer extends StdDeserializer<Map.Entry> {
-
-        protected MapEntryJacksonDeserializer() {
-            super(Map.Entry.class);
-        }
-
-        @Override
-        public Map.Entry deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
-            final Map<Object,Object> m = new HashMap<>();
-
-            while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
-                final Object key = deserializationContext.readValue(jsonParser, Object.class);
-                jsonParser.nextToken();
-                final Object val = deserializationContext.readValue(jsonParser, Object.class);
-                m.put(key, val);
-            }
-
-            return m.entrySet().iterator().next();
-        }
-    }
-
     static class SetJacksonDeserializer extends StdDeserializer<Set> {
 
         protected SetJacksonDeserializer() {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/918c14bd/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV3d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV3d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV3d0Test.java
index b4f49d7..4bd3f6f 100644
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV3d0Test.java
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV3d0Test.java
@@ -131,9 +131,10 @@ public class GraphSONMessageSerializerV3d0Test {
         final ResponseMessage response = convert(IteratorUtils.asList(map.entrySet()));
         assertCommon(response);
 
-        final List<Map.Entry<Object, Object>> deserializedEntries = (List<Map.Entry<Object, Object>>) response.getResult().getData();
+        final List<Map<Object, Object>> deserializedEntries = (List<Map<Object, Object>>) response.getResult().getData();
         assertEquals(3, deserializedEntries.size());
-        deserializedEntries.forEach(e -> {
+        deserializedEntries.forEach(m -> {
+            final Map.Entry<Object,Object> e = m.entrySet().iterator().next();
             if (e.getKey().equals("x"))
                 assertEquals(1, e.getValue());
             else if (e.getKey() instanceof Vertex && e.getKey().equals(v1))

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/918c14bd/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
index 800b82f..21dd202 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
@@ -747,7 +747,7 @@ public class GremlinServerHttpIntegrateTest extends AbstractGremlinServerIntegra
             assertEquals("application/json", response.getEntity().getContentType().getValue());
             final String json = EntityUtils.toString(response.getEntity());
             final JsonNode node = mapper.readTree(json);
-            assertEquals("g:Entry", node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get("@type").asText());
+            assertEquals("g:Map", node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get("@type").asText());
             assertEquals(1, node.get("result").get("data").get(GraphSONTokens.VALUEPROP).get(0).get(GraphSONTokens.VALUEPROP).get(1).get(GraphSONTokens.VALUEPROP).asInt());
         }
     }