java.lang.Object
org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper
All Implemented Interfaces:
Mapper<org.apache.tinkerpop.shaded.kryo.Kryo>

public final class GryoMapper extends Object implements Mapper<org.apache.tinkerpop.shaded.kryo.Kryo>
A Mapper implementation for Kryo. This implementation requires that all classes to be serialized by Kryo are registered to it.

Graph implementations providing an IoRegistry should register their custom classes and/or serializers in one of three ways:

  1. Register just the custom class with a null Serializer implementation
  2. Register the custom class with a Serializer implementation
  3. Register the custom class with a Function<Kryo, Serializer> for those cases where the Serializer requires the Kryo instance to get constructed.

For example:

 
 public class MyGraphIoRegistry extends AbstractIoRegistry {
   public MyGraphIoRegistry() {
     register(GryoIo.class, MyGraphIdClass.class, new MyGraphIdSerializer());
   }
 }
 
 
Author:
Stephen Mallette (http://stephen.genoprime.com)
  • Field Details

    • GIO

      public static final byte[] GIO
  • Method Details

    • createMapper

      public org.apache.tinkerpop.shaded.kryo.Kryo createMapper()
      Description copied from interface: Mapper
      Create a new instance of the internal object mapper that an implementation represents.
      Specified by:
      createMapper in interface Mapper<org.apache.tinkerpop.shaded.kryo.Kryo>
    • getVersion

      public GryoVersion getVersion()
    • getRegisteredClasses

      public List<Class> getRegisteredClasses()
    • getTypeRegistrations

      public List<TypeRegistration<?>> getTypeRegistrations()
    • build

      public static GryoMapper.Builder build()