Package com.twitter.chill.config
Class ReflectingInstantiator
java.lang.Object
com.twitter.chill.KryoInstantiator
com.twitter.chill.config.ReflectingInstantiator
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDEFAULT_REGISTRATIONS holds a colon-separated list of classes or interfaces to register with Kryo.static final StringName of the InstatiatorStrategy to use.static final Stringstatic final StringName of the subclass of kryo to instantiate to start with.static final Stringstatic final StringAll keys are prefixed with this stringstatic final StringIf REGISTRATION_REQUIRED is set to false, Kryo will try to serialize all java objects, not just those with custom serializations registered.static final booleanstatic final StringKRYO_REGISTRATIONS holds a colon-separated list of classes to register with Kryo.static final StringIf SKIP_MISSING is set to false, Kryo will throw an error when Cascading tries to register a class or serialization that doesn't exist.static final boolean -
Constructor Summary
ConstructorsConstructorDescriptionReflectingInstantiator(Config conf) ReflectingInstantiator(Class<? extends com.esotericsoftware.kryo.kryo5.Kryo> kryoClass, Class<? extends com.esotericsoftware.kryo.kryo5.objenesis.strategy.InstantiatorStrategy> stratClass, Iterable<ClassRegistrar> classRegistrations, Iterable<ReflectingRegistrar> registrations, Iterable<ReflectingDefaultRegistrar> defaults, boolean regRequired, boolean skipMissing) ReflectingInstantiator(Iterable<ClassRegistrar> classRegistrations, Iterable<ReflectingRegistrar> registrations, Iterable<ReflectingDefaultRegistrar> defaults) Create an instance using the defaults for non-listed params -
Method Summary
Modifier and TypeMethodDescriptionprotected List<? extends IKryoRegistrar>buildRegistrars(String base, boolean isAddDefault) booleaninthashCode()com.esotericsoftware.kryo.kryo5.KryonewKryo()protected com.esotericsoftware.kryo.kryo5.Kryoprotected StringregistrarsToString(Iterable<? extends IKryoRegistrar> registrars) voidMethods inherited from class com.twitter.chill.KryoInstantiator
setClassLoader, setInstantiatorStrategy, setReferences, setRegistrationRequired, setThreadContextClassLoader, withRegistrar
-
Field Details
-
prefix
All keys are prefixed with this string- See Also:
-
KRYO_CLASS
Name of the subclass of kryo to instantiate to start with. If this is empty, we use Kryo.class- See Also:
-
KRYO_CLASS_DEFAULT
-
INSTANTIATOR_STRATEGY_CLASS
Name of the InstatiatorStrategy to use. If this is empty, we use org.objenesis.strategy.StdInstantiatorStrategy- See Also:
-
INSTANTIATOR_STRATEGY_CLASS_DEFAULT
-
REGISTRATIONS
KRYO_REGISTRATIONS holds a colon-separated list of classes to register with Kryo. For example, the following value: "someClass,someSerializer:otherClass:thirdClass,thirdSerializer" will direct KryoFactory to register someClass and thirdClass with custom serializers and otherClass with Kryo's FieldsSerializer.- See Also:
-
DEFAULT_REGISTRATIONS
DEFAULT_REGISTRATIONS holds a colon-separated list of classes or interfaces to register with Kryo. Default Registrations are searched after basic registrations, and have the ability to capture objects that are assignable from the hierarchy's superclass. For example, the following value: "someClass,someSerializer:someInterface,otherSerializer" will configure to serializeobjects that extend from someClass with someSerializer, and objects that extend someInterface with otherSerializer.- See Also:
-
SKIP_MISSING
If SKIP_MISSING is set to false, Kryo will throw an error when Cascading tries to register a class or serialization that doesn't exist.- See Also:
-
SKIP_MISSING_DEFAULT
public static final boolean SKIP_MISSING_DEFAULT- See Also:
-
REGISTRATION_REQUIRED
If REGISTRATION_REQUIRED is set to false, Kryo will try to serialize all java objects, not just those with custom serializations registered.- See Also:
-
REGISTRATION_REQUIRED_DEFAULT
public static final boolean REGISTRATION_REQUIRED_DEFAULT- See Also:
-
-
Constructor Details
-
ReflectingInstantiator
- Throws:
ConfigurationException
-
ReflectingInstantiator
public ReflectingInstantiator(Iterable<ClassRegistrar> classRegistrations, Iterable<ReflectingRegistrar> registrations, Iterable<ReflectingDefaultRegistrar> defaults) Create an instance using the defaults for non-listed params -
ReflectingInstantiator
public ReflectingInstantiator(Class<? extends com.esotericsoftware.kryo.kryo5.Kryo> kryoClass, Class<? extends com.esotericsoftware.kryo.kryo5.objenesis.strategy.InstantiatorStrategy> stratClass, Iterable<ClassRegistrar> classRegistrations, Iterable<ReflectingRegistrar> registrations, Iterable<ReflectingDefaultRegistrar> defaults, boolean regRequired, boolean skipMissing)
-
-
Method Details
-
set
- Throws:
ConfigurationException
-
newKryoWithEx
protected com.esotericsoftware.kryo.kryo5.Kryo newKryoWithEx() throws InstantiationException, IllegalAccessException -
newKryo
public com.esotericsoftware.kryo.kryo5.Kryo newKryo()- Overrides:
newKryoin classKryoInstantiator
-
buildRegistrars
protected List<? extends IKryoRegistrar> buildRegistrars(String base, boolean isAddDefault) throws ConfigurationException - Throws:
ConfigurationException
-
registrarsToString
protected String registrarsToString(Iterable<? extends IKryoRegistrar> registrars) throws ConfigurationException - Throws:
ConfigurationException
-
hashCode
public int hashCode() -
equals
-