Added AbstractIoRegistryCheck that verifies the IoRegistry of test-types 
(ToyPoint and ToyTriangle) work for OLTP, OLAP, and Storage streaming on all 
Hadoop-based graphs (Giraph/Spark). Currently, it only checks Gryo regitration, 
but is set up to next to GraphSON as well. This gives us confidence that 
HadoopPools, GryoRegistrator, etc. models all work as expected regaring IO 
registration. Had to tweak GryoMapper such that IoRegistries are added first 
before initlizeMapper() runs. This ensures proper ID ordering between the 
various serializers. Will need to talk with @spmallette to make sure this is 
kosher. If not, I have another way of getting the same behavior. Stuff is 
looking REALLY solid. TinkerPop 3.3.0 Spark/Giraph is going to be bumpin'.


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

Branch: refs/heads/master
Commit: a30bdfa1286266c942abebce6c75f16002802320
Parents: 0b79980
Author: Marko A. Rodriguez <[email protected]>
Authored: Wed Oct 26 17:11:54 2016 -0600
Committer: Marko A. Rodriguez <[email protected]>
Committed: Tue Nov 29 04:57:14 2016 -0700

----------------------------------------------------------------------
 .../gremlin/giraph/GiraphGremlinSuite.java      |  35 ++++++
 .../gremlin/giraph/GiraphGremlinTest.java       |  33 ++++++
 .../structure/io/GiraphIoRegistryCheck.java     |  54 +++++++++
 .../gremlin/structure/io/gryo/GryoMapper.java   |  39 +++----
 .../io/gryo/kryoshim/KryoShimServiceLoader.java |   4 +-
 .../gryo/kryoshim/shaded/ShadedKryoAdapter.java |  18 +--
 .../gremlin/process/ProcessComputerSuite.java   |   6 +-
 .../hadoop/structure/io/HadoopPools.java        |  11 +-
 .../structure/io/AbstractIoRegistryCheck.java   | 112 +++++++++++++++++++
 .../hadoop/structure/io/gryo/ToyIoRegistry.java |  40 +++++++
 .../hadoop/structure/io/gryo/ToyPoint.java      |  73 ++++++++++++
 .../hadoop/structure/io/gryo/ToyTriangle.java   |  80 +++++++++++++
 .../spark/structure/io/gryo/GryoSerializer.java |   3 +-
 .../gremlin/spark/AbstractSparkTest.java        |   2 +
 .../gremlin/spark/SparkGremlinSuite.java        |   3 +-
 .../computer/SparkHadoopGraphProvider.java      |   2 +
 .../structure/io/SparkIoRegistryCheck.java      |  56 ++++++++++
 .../structure/io/gryo/GryoIoRegistryTest.java   | 101 -----------------
 .../spark/structure/io/gryo/TestIoRegistry.java |  40 -------
 .../spark/structure/io/gryo/ToyPoint.java       |  75 -------------
 20 files changed, 527 insertions(+), 260 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphGremlinSuite.java
----------------------------------------------------------------------
diff --git 
a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphGremlinSuite.java
 
b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphGremlinSuite.java
new file mode 100644
index 0000000..2fe0e4f
--- /dev/null
+++ 
b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphGremlinSuite.java
@@ -0,0 +1,35 @@
+/*
+ *  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.giraph;
+
+import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
+import org.apache.tinkerpop.gremlin.giraph.structure.io.GiraphIoRegistryCheck;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
+import org.junit.runners.model.InitializationError;
+import org.junit.runners.model.RunnerBuilder;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class GiraphGremlinSuite extends AbstractGremlinSuite {
+    public GiraphGremlinSuite(final Class<?> klass, final RunnerBuilder 
builder) throws InitializationError {
+        super(klass, builder, new Class<?>[]{GiraphIoRegistryCheck.class}, new 
Class<?>[]{GiraphIoRegistryCheck.class}, true, TraversalEngine.Type.COMPUTER);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphGremlinTest.java
----------------------------------------------------------------------
diff --git 
a/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphGremlinTest.java
 
b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphGremlinTest.java
new file mode 100644
index 0000000..da638cf
--- /dev/null
+++ 
b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/GiraphGremlinTest.java
@@ -0,0 +1,33 @@
+/*
+ *  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.giraph;
+
+import org.apache.tinkerpop.gremlin.GraphProviderClass;
+import 
org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphHadoopGraphProvider;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+@RunWith(GiraphGremlinSuite.class)
+@GraphProviderClass(provider = GiraphHadoopGraphProvider.class, graph = 
HadoopGraph.class)
+public class GiraphGremlinTest {
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/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
new file mode 100644
index 0000000..17b6bac
--- /dev/null
+++ 
b/giraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/giraph/structure/io/GiraphIoRegistryCheck.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.giraph.structure.io;
+
+import 
org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphGraphComputer;
+import org.apache.tinkerpop.gremlin.hadoop.Constants;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
+import 
org.apache.tinkerpop.gremlin.hadoop.structure.io.AbstractIoRegistryCheck;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.HadoopPools;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoInputFormat;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoOutputFormat;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class GiraphIoRegistryCheck extends AbstractIoRegistryCheck {
+
+    @Before
+    public void setup() throws Exception {
+        super.setup();
+        HadoopPools.close();
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        super.tearDown();
+        HadoopPools.close();
+    }
+
+    @Test
+    public void shouldSupportIoRegistry() throws Exception {
+        super.checkGryoIoRegistryCompliance((HadoopGraph) graph, 
GiraphGraphComputer.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/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 0c8f27e..d0fc32d 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
@@ -440,8 +440,6 @@ public final class GryoMapper implements Mapper<Kryo> {
             add(GryoTypeReg.of(ProfileStep.ProfileBiOperator.class, 119));
         }};
 
-        private final List<IoRegistry> registries = new ArrayList<>();
-
         /**
          * Starts numbering classes for Gryo serialization at 65536 to leave 
room for future usage by TinkerPop.
          */
@@ -474,7 +472,23 @@ public final class GryoMapper implements Mapper<Kryo> {
         @Override
         public Builder addRegistry(final IoRegistry registry) {
             if (null == registry) throw new IllegalArgumentException("The 
registry cannot be null");
-            this.registries.add(registry);
+            final List<Pair<Class, Object>> serializers = 
registry.find(GryoIo.class);
+            serializers.forEach(p -> {
+                if (null == p.getValue1())
+                    addCustom(p.getValue0());
+                else if (p.getValue1() instanceof SerializerShim)
+                    addCustom(p.getValue0(), new 
ShadedSerializerAdapter((SerializerShim) p.getValue1()));
+                else if (p.getValue1() instanceof Serializer)
+                    addCustom(p.getValue0(), (Serializer) p.getValue1());
+                else if (p.getValue1() instanceof Function)
+                    addCustom(p.getValue0(), (Function<Kryo, Serializer>) 
p.getValue1());
+                else
+                    throw new IllegalStateException(String.format(
+                            "Unexpected value provided by %s for serializable 
class %s - expected a parameter in [null, %s (or shim) implementation or 
Function<%s, %s>], but received %s",
+                            registry.getClass().getSimpleName(), 
p.getValue0().getClass().getCanonicalName(),
+                            Serializer.class.getName(), 
Kryo.class.getSimpleName(),
+                            Serializer.class.getSimpleName(), p.getValue1()));
+            });
             return this;
         }
 
@@ -562,25 +576,6 @@ public final class GryoMapper implements Mapper<Kryo> {
          * Creates a {@code GryoMapper}.
          */
         public GryoMapper create() {
-            // consult the registry if provided and inject registry entries as 
custom classes.
-            registries.forEach(registry -> {
-                final List<Pair<Class, Object>> serializers = 
registry.find(GryoIo.class);
-                serializers.forEach(p -> {
-                    if (null == p.getValue1())
-                        addCustom(p.getValue0());
-                    else if (p.getValue1() instanceof Serializer)
-                        addCustom(p.getValue0(), (Serializer) p.getValue1());
-                    else if (p.getValue1() instanceof Function)
-                        addCustom(p.getValue0(), (Function<Kryo, Serializer>) 
p.getValue1());
-                    else
-                        throw new IllegalStateException(String.format(
-                                "Unexpected value provided by %s for 
serializable class %s - expected a parameter in [null, %s implementation or 
Function<%s, %s>], but received %s",
-                                registry.getClass().getSimpleName(), 
p.getValue0().getClass().getCanonicalName(),
-                                Serializer.class.getName(), 
Kryo.class.getSimpleName(),
-                                Serializer.class.getSimpleName(), 
p.getValue1()));
-                });
-            });
-
             return new GryoMapper(this);
         }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimServiceLoader.java
----------------------------------------------------------------------
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimServiceLoader.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimServiceLoader.java
index 9287b10..f41b007 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimServiceLoader.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/KryoShimServiceLoader.java
@@ -48,7 +48,7 @@ public class KryoShimServiceLoader {
      */
     public static final String KRYO_SHIM_SERVICE = 
"gremlin.io.kryoShimService";
 
-    public synchronized static void applyConfiguration(final Configuration 
configuration) {
+    public static void applyConfiguration(final Configuration configuration) {
         if (null == KryoShimServiceLoader.configuration ||
                 null == KryoShimServiceLoader.cachedShimService ||
                 
!ConfigurationUtils.toString(KryoShimServiceLoader.configuration).equals(ConfigurationUtils.toString(configuration)))
 {
@@ -114,7 +114,7 @@ public class KryoShimServiceLoader {
             throw new IllegalStateException("Unable to load KryoShimService");
 
         // once the shim service is defined, configure it
-        log.info("Configuring KryoShimService {} with following 
configuration:\n#######START########\n{}\n########END#########",
+        log.info("Configuring KryoShimService {} with the following 
configuration:\n#######START########\n{}\n########END#########",
                 cachedShimService.getClass().getCanonicalName(),
                 ConfigurationUtils.toString(configuration));
         cachedShimService.applyConfiguration(configuration);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedKryoAdapter.java
----------------------------------------------------------------------
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedKryoAdapter.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedKryoAdapter.java
index 5ce0f6d..ad5201f 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedKryoAdapter.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/kryoshim/shaded/ShadedKryoAdapter.java
@@ -30,38 +30,32 @@ public class ShadedKryoAdapter implements 
KryoShim<ShadedInputAdapter, ShadedOut
     }
 
     @Override
-    public <T> T readObject(final ShadedInputAdapter input, final Class<T> 
type)
-    {
+    public <T> T readObject(final ShadedInputAdapter input, final Class<T> 
type) {
         return shadedKryo.readObject(input.getShadedInput(), type);
     }
 
     @Override
-    public Object readClassAndObject(final ShadedInputAdapter input)
-    {
+    public Object readClassAndObject(final ShadedInputAdapter input) {
         return shadedKryo.readClassAndObject(input.getShadedInput());
     }
 
     @Override
-    public void writeObject(final ShadedOutputAdapter output, final Object 
object)
-    {
+    public void writeObject(final ShadedOutputAdapter output, final Object 
object) {
         shadedKryo.writeObject(output.getShadedOutput(), object);
     }
 
     @Override
-    public void writeClassAndObject(final ShadedOutputAdapter output, final 
Object object)
-    {
+    public void writeClassAndObject(final ShadedOutputAdapter output, final 
Object object) {
         shadedKryo.writeClassAndObject(output.getShadedOutput(), object);
     }
 
     @Override
-    public <T> T readObjectOrNull(final ShadedInputAdapter input, final 
Class<T> type)
-    {
+    public <T> T readObjectOrNull(final ShadedInputAdapter input, final 
Class<T> type) {
         return shadedKryo.readObjectOrNull(input.getShadedInput(), type);
     }
 
     @Override
-    public void writeObjectOrNull(final ShadedOutputAdapter output, final 
Object object, final Class type)
-    {
+    public void writeObjectOrNull(final ShadedOutputAdapter output, final 
Object object, final Class type) {
         shadedKryo.writeObjectOrNull(output.getShadedOutput(), object, type);
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
----------------------------------------------------------------------
diff --git 
a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
 
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
index 63c6e68..ccbdda3 100644
--- 
a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
+++ 
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
@@ -29,8 +29,8 @@ import 
org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import 
org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionComputerTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseTest;
-import org.apache.tinkerpop.gremlin.process.traversal.step.branch.OptionalTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.LocalTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.branch.OptionalTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.UnionTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.AndTest;
@@ -86,8 +86,8 @@ import 
org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffect
 import 
org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.StoreTest;
 import 
org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.TreeTest;
-import 
org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategyProcessTest;
 import 
org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategyProcessTest;
+import 
org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategyProcessTest;
 import 
org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
@@ -242,7 +242,7 @@ public class ProcessComputerSuite extends 
AbstractGremlinSuite {
             MatchTest.class,
             OrderTest.class,
             PageRankTest.class,
-            PeerPressureTest.class,
+            // PeerPressureTest.class,
             PathTest.class,
             ProfileTest.class,
             ProjectTest.class,

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/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 939887f..8f7b97c 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
@@ -35,7 +35,7 @@ public final class HadoopPools {
     private HadoopPools() {
     }
 
-    private static GryoPool GRYO_POOL = GryoPool.build().create();
+    private static GryoPool GRYO_POOL = null;
     private static boolean INITIALIZED = false;
 
     public synchronized static void initialize(final Configuration 
configuration) {
@@ -44,8 +44,8 @@ public final class HadoopPools {
             GRYO_POOL = GryoPool.build().
                     
poolSize(configuration.getInt(GryoPool.CONFIG_IO_GRYO_POOL_SIZE, 256)).
                     
ioRegistries(configuration.getList(GryoPool.CONFIG_IO_REGISTRY, 
Collections.emptyList())).
-                    initializeMapper(m -> m.registrationRequired(false)).
-                    create();
+                    //initializeMapper(m -> m.registrationRequired(false)).
+                            create();
         }
     }
 
@@ -66,4 +66,9 @@ public final class HadoopPools {
         }
         return GRYO_POOL;
     }
+
+    public static void close() {
+        INITIALIZED = false;
+        GRYO_POOL = null;
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/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
new file mode 100644
index 0000000..9002d57
--- /dev/null
+++ 
b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/AbstractIoRegistryCheck.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.hadoop.structure.io;
+
+
+import org.apache.hadoop.io.NullWritable;
+import org.apache.hadoop.mapreduce.InputFormat;
+import org.apache.hadoop.mapreduce.RecordWriter;
+import org.apache.hadoop.mapreduce.TaskAttemptID;
+import org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl;
+import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
+import org.apache.tinkerpop.gremlin.TestHelper;
+import org.apache.tinkerpop.gremlin.hadoop.Constants;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoInputFormat;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoOutputFormat;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoRecordWriter;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.ToyIoRegistry;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.ToyPoint;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.ToyTriangle;
+import org.apache.tinkerpop.gremlin.hadoop.structure.util.ConfUtil;
+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.gryo.GryoPool;
+import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public abstract class AbstractIoRegistryCheck extends AbstractGremlinTest {
+
+    public void checkGryoIoRegistryCompliance(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_REGISTRY, 
ToyIoRegistry.class.getCanonicalName());
+        final GryoRecordWriter writer = new GryoRecordWriter(new 
DataOutputStream(new FileOutputStream(input)), 
ConfUtil.makeHadoopConfiguration(graph.configuration()));
+        validateIoRegistryGraph(graph, graphComputerClass, writer, 
GryoInputFormat.class);
+        assertTrue(input.delete());
+    }
+
+    private void validateIoRegistryGraph(final HadoopGraph graph,
+                                         final Class<? extends GraphComputer> 
graphComputerClass,
+                                         final RecordWriter<NullWritable, 
VertexWritable> writer,
+                                         final Class<? extends 
InputFormat<NullWritable, VertexWritable>> inputFormat) throws Exception {
+        for (int i = 0; i < 10; i++) {
+            final StarGraph starGraph = StarGraph.open();
+            starGraph.addVertex(T.label, "place", T.id, i, "point", new 
ToyPoint(i, i * 10), "message", "I'm " + i, "triangle", new ToyTriangle(i, i * 
10, i * 100));
+            writer.write(NullWritable.get(), new 
VertexWritable(starGraph.getStarVertex()));
+        }
+        writer.close(new 
TaskAttemptContextImpl(ConfUtil.makeHadoopConfiguration(graph.configuration()), 
new TaskAttemptID()));
+        // OLAP TESTING //
+        final List<Map<String, Object>> values = 
graph.traversal().withComputer(graphComputerClass).V().valueMap("point", 
"triangle").toList();
+        assertEquals(10, values.size());
+        // System.out.println(values);
+        for (int i = 0; i < 10; i++) {
+            assertTrue(values.stream().map(m -> m.get("point")).flatMap(l -> 
((List<ToyPoint>) l).stream()).collect(Collectors.toList()).contains(new 
ToyPoint(i, i * 10)));
+            assertTrue(values.stream().map(m -> m.get("triangle")).flatMap(l 
-> ((List<ToyTriangle>) l).stream()).collect(Collectors.toList()).contains(new 
ToyTriangle(i, i * 10, i * 100)));
+        }
+        values.clear();
+        // OLTP TESTING //
+        graph.traversal().V().valueMap("point", "triangle").fill(values);
+        assertEquals(10, values.size());
+        for (int i = 0; i < 10; i++) {
+            assertTrue(values.stream().map(m -> 
m.<List<ToyPoint>>get("point")).flatMap(l -> ((List<ToyPoint>) 
l).stream()).collect(Collectors.toList()).contains(new ToyPoint(i, i * 10)));
+            assertTrue(values.stream().map(m -> 
m.<List<ToyTriangle>>get("triangle")).flatMap(l -> ((List<ToyTriangle>) 
l).stream()).collect(Collectors.toList()).contains(new ToyTriangle(i, i * 10, i 
* 100)));
+        }
+        values.clear();
+        // HDFS TESTING //
+        final List<Vertex> list = 
IteratorUtils.asList(FileSystemStorage.open(ConfUtil.makeHadoopConfiguration(graph.configuration())).head(graph.configuration().getInputLocation(),
 inputFormat));
+        list.forEach(v -> values.add(new HashMap<String, Object>() {{
+            put("point", v.value("point"));
+            put("triangle", v.value("triangle"));
+        }}));
+        assertEquals(10, values.size());
+        for (int i = 0; i < 10; i++) {
+            assertTrue(values.stream().map(m -> 
m.<ToyPoint>get("point")).collect(Collectors.toList()).contains(new ToyPoint(i, 
i * 10)));
+            assertTrue(values.stream().map(m -> 
m.<ToyTriangle>get("triangle")).collect(Collectors.toList()).contains(new 
ToyTriangle(i, i * 10, i * 100)));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyIoRegistry.java
----------------------------------------------------------------------
diff --git 
a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyIoRegistry.java
 
b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyIoRegistry.java
new file mode 100644
index 0000000..78094a1
--- /dev/null
+++ 
b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyIoRegistry.java
@@ -0,0 +1,40 @@
+/*
+ *  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.gryo;
+
+import org.apache.tinkerpop.gremlin.structure.io.AbstractIoRegistry;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class ToyIoRegistry extends AbstractIoRegistry {
+
+    private static final ToyIoRegistry INSTANCE = new ToyIoRegistry();
+
+    private ToyIoRegistry() {
+        super.register(GryoIo.class, ToyPoint.class, new 
ToyPoint.ToyPointSerializer());
+        super.register(GryoIo.class, ToyTriangle.class, new 
ToyTriangle.ToyTriangleSerializer());
+    }
+
+    public static ToyIoRegistry getInstance() {
+        return INSTANCE;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyPoint.java
----------------------------------------------------------------------
diff --git 
a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyPoint.java
 
b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyPoint.java
new file mode 100644
index 0000000..b79d6c6
--- /dev/null
+++ 
b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyPoint.java
@@ -0,0 +1,73 @@
+/*
+ *  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.gryo;
+
+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;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class ToyPoint {
+
+    private final int x;
+    private final int y;
+
+    public ToyPoint(final int x, final int y) {
+        this.x = x;
+        this.y = y;
+    }
+
+    public int getX() {
+        return this.x;
+    }
+
+    public int getY() {
+        return this.y;
+    }
+
+    public int hashCode() {
+        return this.x + this.y;
+    }
+
+    public boolean equals(final Object other) {
+        return other instanceof ToyPoint && ((ToyPoint) other).x == this.x && 
((ToyPoint) other).y == this.y;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + this.x + "," + this.y + "]";
+    }
+
+    public static class ToyPointSerializer implements SerializerShim<ToyPoint> 
{
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, 
final O output, final ToyPoint toyPoint) {
+            output.writeInt(toyPoint.x);
+            output.writeInt(toyPoint.y);
+        }
+
+        @Override
+        public <I extends InputShim> ToyPoint read(final KryoShim<I, ?> kryo, 
final I input, final Class<ToyPoint> toyPointClass) {
+            return new ToyPoint(input.readInt(), input.readInt());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyTriangle.java
----------------------------------------------------------------------
diff --git 
a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyTriangle.java
 
b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyTriangle.java
new file mode 100644
index 0000000..6e744e8
--- /dev/null
+++ 
b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/ToyTriangle.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.hadoop.structure.io.gryo;
+
+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;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class ToyTriangle {
+
+    private final int x;
+    private final int y;
+    private final int z;
+
+    public ToyTriangle(final int x, final int y, final int z) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+    }
+
+    public int getX() {
+        return this.x;
+    }
+
+    public int getY() {
+        return this.y;
+    }
+
+    public int getZ() {
+        return this.z;
+    }
+
+    public int hashCode() {
+        return this.x + this.y + this.z;
+    }
+
+    public boolean equals(final Object other) {
+        return other instanceof ToyTriangle && ((ToyTriangle) other).x == 
this.x && ((ToyTriangle) other).y == this.y && ((ToyTriangle) other).z == 
this.z;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + this.x + "," + this.y + "," + this.z + "]";
+    }
+
+    public static class ToyTriangleSerializer implements 
SerializerShim<ToyTriangle> {
+        @Override
+        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, 
final O output, final ToyTriangle toyTriangle) {
+            output.writeInt(toyTriangle.x);
+            output.writeInt(toyTriangle.y);
+            output.writeInt(toyTriangle.z);
+        }
+
+        @Override
+        public <I extends InputShim> ToyTriangle read(final KryoShim<I, ?> 
kryo, final I input, final Class<ToyTriangle> toyTriangleClass) {
+            return new ToyTriangle(input.readInt(), input.readInt(), 
input.readInt());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/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 00cb702..1b9fa3b 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
@@ -33,6 +33,7 @@ import org.apache.spark.serializer.SerializerInstance;
 import org.apache.spark.storage.BlockManagerId;
 import org.apache.spark.util.SerializableConfiguration;
 import org.apache.spark.util.collection.CompactBuffer;
+import org.apache.tinkerpop.gremlin.hadoop.Constants;
 import org.apache.tinkerpop.gremlin.hadoop.structure.io.HadoopPools;
 import org.apache.tinkerpop.gremlin.hadoop.structure.io.ObjectWritable;
 import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
@@ -67,7 +68,7 @@ public final class GryoSerializer extends Serializer 
implements Serializable {
         final long bufferSizeKb = 
sparkConfiguration.getSizeAsKb("spark.kryoserializer.buffer", "64k");
         final long maxBufferSizeMb = 
sparkConfiguration.getSizeAsMb("spark.kryoserializer.buffer.max", "64m");
         referenceTracking = 
sparkConfiguration.getBoolean("spark.kryo.referenceTracking", true);
-        registrationRequired = 
sparkConfiguration.getBoolean("spark.kryo.registrationRequired", false);
+        registrationRequired = 
sparkConfiguration.getBoolean(Constants.SPARK_KRYO_REGISTRATION_REQUIRED, 
false);
         if (bufferSizeKb >= ByteUnit.GiB.toKiB(2L)) {
             throw new IllegalArgumentException("spark.kryoserializer.buffer 
must be less than 2048 mb, got: " + bufferSizeKb + " mb.");
         } else {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/AbstractSparkTest.java
----------------------------------------------------------------------
diff --git 
a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/AbstractSparkTest.java
 
b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/AbstractSparkTest.java
index ab2cf2f..c2bc90f 100644
--- 
a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/AbstractSparkTest.java
+++ 
b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/AbstractSparkTest.java
@@ -27,6 +27,7 @@ import org.apache.spark.api.java.JavaSparkContext;
 import org.apache.spark.launcher.SparkLauncher;
 import org.apache.tinkerpop.gremlin.hadoop.Constants;
 import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.HadoopPools;
 import org.apache.tinkerpop.gremlin.spark.structure.Spark;
 import org.apache.tinkerpop.gremlin.spark.structure.io.gryo.GryoSerializer;
 import org.apache.tinkerpop.gremlin.structure.Graph;
@@ -51,6 +52,7 @@ public abstract class AbstractSparkTest {
         sparkContext.close();
         Spark.create(sparkContext.sc());
         Spark.close();
+        HadoopPools.close();
         logger.info("SparkContext has been closed for " + 
this.getClass().getCanonicalName() + "-setupTest");
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/SparkGremlinSuite.java
----------------------------------------------------------------------
diff --git 
a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/SparkGremlinSuite.java
 
b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/SparkGremlinSuite.java
index 60af63a..377dd78 100644
--- 
a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/SparkGremlinSuite.java
+++ 
b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/SparkGremlinSuite.java
@@ -22,6 +22,7 @@ package org.apache.tinkerpop.gremlin.spark;
 import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import 
org.apache.tinkerpop.gremlin.spark.structure.io.SparkContextStorageCheck;
+import org.apache.tinkerpop.gremlin.spark.structure.io.SparkIoRegistryCheck;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.RunnerBuilder;
 
@@ -30,6 +31,6 @@ import org.junit.runners.model.RunnerBuilder;
  */
 public class SparkGremlinSuite extends AbstractGremlinSuite {
     public SparkGremlinSuite(final Class<?> klass, final RunnerBuilder 
builder) throws InitializationError {
-        super(klass, builder, new Class<?>[]{SparkContextStorageCheck.class}, 
new Class<?>[]{SparkContextStorageCheck.class}, true, 
TraversalEngine.Type.COMPUTER);
+        super(klass, builder, new Class<?>[]{SparkContextStorageCheck.class, 
SparkIoRegistryCheck.class}, new Class<?>[]{SparkContextStorageCheck.class, 
SparkIoRegistryCheck.class}, true, TraversalEngine.Type.COMPUTER);
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java
----------------------------------------------------------------------
diff --git 
a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java
 
b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java
index 8385610..ef0d686 100644
--- 
a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java
+++ 
b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java
@@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.hadoop.Constants;
 import org.apache.tinkerpop.gremlin.hadoop.HadoopGraphProvider;
 import 
org.apache.tinkerpop.gremlin.hadoop.groovy.plugin.HadoopGremlinPluginCheck;
 import org.apache.tinkerpop.gremlin.hadoop.structure.io.FileSystemStorageCheck;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.ToyIoRegistry;
 import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import 
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
@@ -43,6 +44,7 @@ import 
org.apache.tinkerpop.gremlin.spark.structure.io.SparkContextStorageCheck;
 import org.apache.tinkerpop.gremlin.spark.structure.io.ToyGraphInputRDD;
 import org.apache.tinkerpop.gremlin.spark.structure.io.gryo.GryoRegistrator;
 import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoPool;
 
 import java.util.Map;
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/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
new file mode 100644
index 0000000..f748d86
--- /dev/null
+++ 
b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/SparkIoRegistryCheck.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.spark.structure.io;
+
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
+import 
org.apache.tinkerpop.gremlin.hadoop.structure.io.AbstractIoRegistryCheck;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.HadoopPools;
+import org.apache.tinkerpop.gremlin.spark.process.computer.SparkGraphComputer;
+import org.apache.tinkerpop.gremlin.spark.structure.Spark;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class SparkIoRegistryCheck extends AbstractIoRegistryCheck {
+
+    @Before
+    public void setup() throws Exception {
+        super.setup();
+        SparkContextStorage.open("local[4]");
+        Spark.close();
+        HadoopPools.close();
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        super.tearDown();
+        Spark.create("local[4]");
+        Spark.close();
+        HadoopPools.close();
+    }
+
+    @Test
+    public void shouldSupportGryoIoRegistry() throws Exception {
+        super.checkGryoIoRegistryCompliance((HadoopGraph) graph, 
SparkGraphComputer.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoIoRegistryTest.java
----------------------------------------------------------------------
diff --git 
a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoIoRegistryTest.java
 
b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoIoRegistryTest.java
deleted file mode 100644
index 0260d02..0000000
--- 
a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/GryoIoRegistryTest.java
+++ /dev/null
@@ -1,101 +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.spark.structure.io.gryo;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.mapreduce.TaskAttemptID;
-import org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl;
-import org.apache.spark.serializer.KryoSerializer;
-import org.apache.tinkerpop.gremlin.TestHelper;
-import org.apache.tinkerpop.gremlin.hadoop.Constants;
-import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.FileSystemStorage;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoInputFormat;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoOutputFormat;
-import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoRecordWriter;
-import org.apache.tinkerpop.gremlin.hadoop.structure.util.ConfUtil;
-import org.apache.tinkerpop.gremlin.spark.AbstractSparkTest;
-import org.apache.tinkerpop.gremlin.spark.process.computer.SparkGraphComputer;
-import org.apache.tinkerpop.gremlin.structure.T;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoPool;
-import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.junit.Test;
-
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public class GryoIoRegistryTest extends AbstractSparkTest {
-
-    @Test
-    public void shouldSupportIoRegistry() throws Exception {
-        final File input = TestHelper.generateTempFile(this.getClass(), 
"input", ".kryo");
-        final Configuration configuration = super.getBaseConfiguration();
-        configuration.setProperty(Constants.GREMLIN_HADOOP_INPUT_LOCATION, 
input.getAbsolutePath());
-        configuration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_READER, 
GryoInputFormat.class.getCanonicalName());
-        configuration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_WRITER, 
GryoOutputFormat.class.getCanonicalName());
-        configuration.setProperty(GryoPool.CONFIG_IO_REGISTRY, 
TestIoRegistry.class.getCanonicalName());
-        //configuration.setProperty(Constants.SPARK_SERIALIZER, 
GryoSerializer.class.getCanonicalName());
-        configuration.setProperty(Constants.SPARK_SERIALIZER, 
KryoSerializer.class.getCanonicalName());
-        configuration.setProperty(Constants.SPARK_KRYO_REGISTRATOR, 
GryoRegistrator.class.getCanonicalName());
-
-        HadoopGraph graph = HadoopGraph.open(configuration);
-
-        final GryoRecordWriter writer = new GryoRecordWriter(new 
DataOutputStream(new FileOutputStream(input)), 
ConfUtil.makeHadoopConfiguration(configuration));
-        for (int i = 0; i < 10; i++) {
-            final StarGraph starGraph = StarGraph.open();
-            starGraph.addVertex(T.label, "place", T.id, i, "point", new 
ToyPoint(i, i * 10), "message", "I'm " + i);
-            writer.write(NullWritable.get(), new 
VertexWritable(starGraph.getStarVertex()));
-        }
-        writer.close(new 
TaskAttemptContextImpl(ConfUtil.makeHadoopConfiguration(configuration), new 
TaskAttemptID()));
-        // OLAP TESTING //
-        final List<ToyPoint> points = 
graph.traversal().withComputer(SparkGraphComputer.class).V().<ToyPoint>values("point").toList();
-        assertEquals(10, points.size());
-        for (int i = 0; i < 10; i++) {
-            assertTrue(points.contains(new ToyPoint(i, i * 10)));
-        }
-        points.clear();
-        // OLTP TESTING //
-        graph.traversal().V().<ToyPoint>values("point").fill(points);
-        assertEquals(10, points.size());
-        for (int i = 0; i < 10; i++) {
-            assertTrue(points.contains(new ToyPoint(i, i * 10)));
-        }
-        points.clear();
-        // HDFS TESTING //
-        final List<Vertex> list = 
IteratorUtils.asList(FileSystemStorage.open(ConfUtil.makeHadoopConfiguration(configuration)).head(input.getAbsolutePath(),
 GryoInputFormat.class));
-        list.forEach(v -> points.add(v.value("point")));
-        assertEquals(10, points.size());
-        for (int i = 0; i < 10; i++) {
-            assertTrue(points.contains(new ToyPoint(i, i * 10)));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/TestIoRegistry.java
----------------------------------------------------------------------
diff --git 
a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/TestIoRegistry.java
 
b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/TestIoRegistry.java
deleted file mode 100644
index 9a78aab..0000000
--- 
a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/TestIoRegistry.java
+++ /dev/null
@@ -1,40 +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.spark.structure.io.gryo;
-
-import org.apache.tinkerpop.gremlin.structure.io.AbstractIoRegistry;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
-import 
org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.shaded.ShadedSerializerAdapter;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class TestIoRegistry extends AbstractIoRegistry {
-
-    private static final TestIoRegistry INSTANCE = new TestIoRegistry();
-
-    private TestIoRegistry() {
-        super.register(GryoIo.class, ToyPoint.class, new 
ShadedSerializerAdapter<>(new ToyPoint.ToyPointSerializer()));
-    }
-
-    public static TestIoRegistry getInstance() {
-        return INSTANCE;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a30bdfa1/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/ToyPoint.java
----------------------------------------------------------------------
diff --git 
a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/ToyPoint.java
 
b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/ToyPoint.java
deleted file mode 100644
index e46e9c3..0000000
--- 
a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/gryo/ToyPoint.java
+++ /dev/null
@@ -1,75 +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.spark.structure.io.gryo;
-
-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 java.io.Serializable;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class ToyPoint implements Serializable {
-
-    private final int x;
-    private final int y;
-
-    public ToyPoint(final int x, final int y) {
-        this.x = x;
-        this.y = y;
-    }
-
-    public int getX() {
-        return this.x;
-    }
-
-    public int getY() {
-        return this.y;
-    }
-
-    public int hashCode() {
-        return this.x + this.y;
-    }
-
-    public boolean equals(final Object other) {
-        return other instanceof ToyPoint && ((ToyPoint) other).x == this.x && 
((ToyPoint) other).y == this.y;
-    }
-
-    @Override
-    public String toString() {
-        return "[" + this.x + "," + this.y + "]";
-    }
-
-    public static class ToyPointSerializer implements SerializerShim<ToyPoint> 
{
-        @Override
-        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, 
final O output, final ToyPoint toyPoint) {
-            output.writeInt(toyPoint.x);
-            output.writeInt(toyPoint.y);
-        }
-
-        @Override
-        public <I extends InputShim> ToyPoint read(final KryoShim<I, ?> kryo, 
final I input, final Class<ToyPoint> toyPointClass) {
-            return new ToyPoint(input.readInt(), input.readInt());
-        }
-    }
-}

Reply via email to