Class 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 Detail

      • GIO

        public static final byte[] GIO
      • HEADER

        public static final byte[] HEADER
    • Method Detail

      • 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>
      • getRegisteredClasses

        public List<Class> getRegisteredClasses()