Class AbstractGryoClassResolver
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.structure.io.gryo.AbstractGryoClassResolver
-
- All Implemented Interfaces:
org.apache.tinkerpop.shaded.kryo.ClassResolver
- Direct Known Subclasses:
GryoClassResolverV1
,GryoClassResolverV3
public abstract class AbstractGryoClassResolver extends Object implements org.apache.tinkerpop.shaded.kryo.ClassResolver
This mapper implementation of theClassResolver
helps ensure that all Vertex and Edge concrete classes get properly serialized and deserialized by stripping them of their concrete class name so that they are treated generically. See thegetRegistration(Class)
method for the core of this logic.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.tinkerpop.shaded.kryo.util.IdentityObjectIntMap<Class>
classToNameId
protected org.apache.tinkerpop.shaded.kryo.util.ObjectMap<Class,org.apache.tinkerpop.shaded.kryo.Registration>
classToRegistration
protected org.apache.tinkerpop.shaded.kryo.util.IntMap<org.apache.tinkerpop.shaded.kryo.Registration>
idToRegistration
protected org.apache.tinkerpop.shaded.kryo.Kryo
kryo
static byte
NAME
protected org.apache.tinkerpop.shaded.kryo.util.IntMap<Class>
nameIdToClass
protected org.apache.tinkerpop.shaded.kryo.util.ObjectMap<String,Class>
nameToClass
protected int
nextNameId
-
Constructor Summary
Constructors Constructor Description AbstractGryoClassResolver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Class
coerceType(Class clazz)
Called fromgetRegistration(Class)
to determine the actual type.org.apache.tinkerpop.shaded.kryo.Registration
getRegistration(int classID)
org.apache.tinkerpop.shaded.kryo.Registration
getRegistration(Class clazz)
protected Class<?>
getTypeByName(String className)
org.apache.tinkerpop.shaded.kryo.Registration
readClass(org.apache.tinkerpop.shaded.kryo.io.Input input)
protected org.apache.tinkerpop.shaded.kryo.Registration
readName(org.apache.tinkerpop.shaded.kryo.io.Input input)
org.apache.tinkerpop.shaded.kryo.Registration
register(org.apache.tinkerpop.shaded.kryo.Registration registration)
org.apache.tinkerpop.shaded.kryo.Registration
registerImplicit(Class type)
void
reset()
void
setKryo(org.apache.tinkerpop.shaded.kryo.Kryo kryo)
org.apache.tinkerpop.shaded.kryo.Registration
writeClass(org.apache.tinkerpop.shaded.kryo.io.Output output, Class type)
protected void
writeName(org.apache.tinkerpop.shaded.kryo.io.Output output, Class type)
-
-
-
Field Detail
-
NAME
public static final byte NAME
- See Also:
- Constant Field Values
-
kryo
protected org.apache.tinkerpop.shaded.kryo.Kryo kryo
-
idToRegistration
protected final org.apache.tinkerpop.shaded.kryo.util.IntMap<org.apache.tinkerpop.shaded.kryo.Registration> idToRegistration
-
classToRegistration
protected final org.apache.tinkerpop.shaded.kryo.util.ObjectMap<Class,org.apache.tinkerpop.shaded.kryo.Registration> classToRegistration
-
classToNameId
protected org.apache.tinkerpop.shaded.kryo.util.IdentityObjectIntMap<Class> classToNameId
-
nameIdToClass
protected org.apache.tinkerpop.shaded.kryo.util.IntMap<Class> nameIdToClass
-
nextNameId
protected int nextNameId
-
-
Method Detail
-
setKryo
public void setKryo(org.apache.tinkerpop.shaded.kryo.Kryo kryo)
- Specified by:
setKryo
in interfaceorg.apache.tinkerpop.shaded.kryo.ClassResolver
-
register
public org.apache.tinkerpop.shaded.kryo.Registration register(org.apache.tinkerpop.shaded.kryo.Registration registration)
- Specified by:
register
in interfaceorg.apache.tinkerpop.shaded.kryo.ClassResolver
-
registerImplicit
public org.apache.tinkerpop.shaded.kryo.Registration registerImplicit(Class type)
- Specified by:
registerImplicit
in interfaceorg.apache.tinkerpop.shaded.kryo.ClassResolver
-
coerceType
public abstract Class coerceType(Class clazz)
Called fromgetRegistration(Class)
to determine the actual type.
-
getRegistration
public org.apache.tinkerpop.shaded.kryo.Registration getRegistration(Class clazz)
- Specified by:
getRegistration
in interfaceorg.apache.tinkerpop.shaded.kryo.ClassResolver
-
getRegistration
public org.apache.tinkerpop.shaded.kryo.Registration getRegistration(int classID)
- Specified by:
getRegistration
in interfaceorg.apache.tinkerpop.shaded.kryo.ClassResolver
-
writeClass
public org.apache.tinkerpop.shaded.kryo.Registration writeClass(org.apache.tinkerpop.shaded.kryo.io.Output output, Class type)
- Specified by:
writeClass
in interfaceorg.apache.tinkerpop.shaded.kryo.ClassResolver
-
writeName
protected void writeName(org.apache.tinkerpop.shaded.kryo.io.Output output, Class type)
-
readClass
public org.apache.tinkerpop.shaded.kryo.Registration readClass(org.apache.tinkerpop.shaded.kryo.io.Input input)
- Specified by:
readClass
in interfaceorg.apache.tinkerpop.shaded.kryo.ClassResolver
-
readName
protected org.apache.tinkerpop.shaded.kryo.Registration readName(org.apache.tinkerpop.shaded.kryo.io.Input input)
-
reset
public void reset()
- Specified by:
reset
in interfaceorg.apache.tinkerpop.shaded.kryo.ClassResolver
-
-