@Override
    public Kryo createMapper() {
        final Kryo kryo = new Kryo(classResolver.get(), new MapReferenceResolver(), new DefaultStreamFactory());
        kryo.addDefaultSerializer(Map.Entry.class, new UtilSerializers.EntrySerializer());
        kryo.setRegistrationRequired(registrationRequired);
        kryo.setReferences(referenceTracking);
        for (TypeRegistration tr : typeRegistrations)
            tr.registerWith(kryo);
        return kryo;
    }
A {@link Mapper} implementation for Kryo. This implementation requires that all classes to be serialized by
Kryo are registered to it.
<p/>
{@link Graph} implementations providing an {@link IoRegistry} should register their custom classes and/or
serializers in one of three ways:
<p/>
<ol>
<li>Register just the custom class with a {@code null} {@link Serializer} implementation</li>
<li>Register the custom class with a {@link Serializer} implementation</li>
<li>
Register the custom class with a {@code Function<Kryo, Serializer>} for those cases where the
{@link Serializer} requires the {@link Kryo} instance to get constructed.
</li>
</ol>
<p/>
For example:
<pre>
{@code
public class MyGraphIoRegistry extends AbstractIoRegistry {
  public MyGraphIoRegistry() {
    register(GryoIo.class, MyGraphIdClass.class, new MyGraphIdSerializer());
  }
}
}
</pre>

@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java