Package com.twitter.chill
Class KryoInstantiator
java.lang.Object
com.twitter.chill.KryoInstantiator
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ConfiguredInstantiator,ReflectingInstantiator
Class to create a new Kryo instance.
Used in initial configuration or pooling of Kryo objects.
These objects are immutable (and hopefully Kryo serializable)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.esotericsoftware.kryo.kryo5.KryonewKryo()Use this to set a specific classloadersetInstantiatorStrategy(com.esotericsoftware.kryo.kryo5.objenesis.strategy.InstantiatorStrategy inst) If true, Kryo will error if it sees a class that has not been registeredsetReferences(boolean ref) If true, Kryo keeps a map of all the objects it has seen.setRegistrationRequired(boolean req) If true, Kryo will error if it sees a class that has not been registeredUse Thread.currentThread().getContextClassLoader() as the ClassLoader where ther newKryo is called
-
Constructor Details
-
KryoInstantiator
public KryoInstantiator()
-
-
Method Details
-
newKryo
public com.esotericsoftware.kryo.kryo5.Kryo newKryo() -
setClassLoader
Use this to set a specific classloader -
setInstantiatorStrategy
public KryoInstantiator setInstantiatorStrategy(com.esotericsoftware.kryo.kryo5.objenesis.strategy.InstantiatorStrategy inst) If true, Kryo will error if it sees a class that has not been registered -
setReferences
If true, Kryo keeps a map of all the objects it has seen. this can use a ton of memory on hadoop, but save serialization costs in some cases -
setRegistrationRequired
If true, Kryo will error if it sees a class that has not been registered -
setThreadContextClassLoader
Use Thread.currentThread().getContextClassLoader() as the ClassLoader where ther newKryo is called -
withRegistrar
-