Repository: tinkerpop
Updated Branches:
  refs/heads/master 78f7f3e50 -> c0b0eedce


TINKERPOP-1341 Add missing classes to GryoRegistrator

GryoRegistrator is missing registrations for three classes registered
in GryoSerializer:

* void
* Void
* CompactBuffer[]

This commit adds all three to GryoRegistrator.getExtraRegistrations().

So far, CompactBuffer[] is the only omission known to cause practical
problems, as detailed by Dylan Bethune-Waddell on the mailing list and
in the referenced issue.  It's not clear whether omitting Void and
void causes practical problems, but they're trivial, so the cost
associated with registering them is tiny.  Might as well.


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

Branch: refs/heads/master
Commit: f19121b487258beebc4f86ff7ce58cd452d5ddef
Parents: 5395aae
Author: Dan LaRocque <[email protected]>
Authored: Wed Jun 29 15:14:32 2016 -0400
Committer: Dan LaRocque <[email protected]>
Committed: Wed Jun 29 15:17:11 2016 -0400

----------------------------------------------------------------------
 .../gremlin/spark/structure/io/gryo/GryoRegistrator.java        | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f19121b4/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 412fd3b..9e5d4e1 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
@@ -22,6 +22,7 @@ import com.esotericsoftware.kryo.Kryo;
 import com.esotericsoftware.kryo.Serializer;
 import com.esotericsoftware.kryo.serializers.JavaSerializer;
 import org.apache.spark.serializer.KryoRegistrator;
+import org.apache.spark.util.collection.CompactBuffer;
 import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopEdge;
 import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopProperty;
 import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopVertex;
@@ -215,6 +216,10 @@ public class GryoRegistrator implements KryoRegistrator {
         } catch (final ClassNotFoundException e) {
             throw new IllegalStateException(e.getMessage(), e);
         }
+        //
+        m.put(CompactBuffer[].class, null);
+        m.put(void.class, null);
+        m.put(Void.class, null);
         return m;
     }
 

Reply via email to