com.twitter.chill.config
Class ReflectingInstantiator

java.lang.Object
  extended by com.twitter.chill.KryoInstantiator
      extended by com.twitter.chill.config.ReflectingInstantiator
All Implemented Interfaces:
java.io.Serializable

public class ReflectingInstantiator
extends KryoInstantiator

See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_REGISTRATIONS
          DEFAULT_REGISTRATIONS holds a colon-separated list of classes or interfaces to register with Kryo.
static java.lang.String INSTANTIATOR_STRATEGY_CLASS
          Name of the InstatiatorStrategy to use.
static java.lang.String INSTANTIATOR_STRATEGY_CLASS_DEFAULT
           
static java.lang.String KRYO_CLASS
          Name of the subclass of kryo to instantiate to start with.
static java.lang.String KRYO_CLASS_DEFAULT
           
static java.lang.String prefix
          All keys are prefixed with this string
static java.lang.String REGISTRATION_REQUIRED
          If REGISTRATION_REQUIRED is set to false, Kryo will try to serialize all java objects, not just those with custom serializations registered.
static boolean REGISTRATION_REQUIRED_DEFAULT
           
static java.lang.String REGISTRATIONS
          KRYO_REGISTRATIONS holds a colon-separated list of classes to register with Kryo.
static java.lang.String 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.
static boolean SKIP_MISSING_DEFAULT
           
 
Constructor Summary
ReflectingInstantiator(java.lang.Class<? extends com.esotericsoftware.kryo.Kryo> kryoClass, java.lang.Class<? extends org.objenesis.strategy.InstantiatorStrategy> stratClass, java.lang.Iterable<ClassRegistrar> classRegistrations, java.lang.Iterable<ReflectingRegistrar> registrations, java.lang.Iterable<ReflectingDefaultRegistrar> defaults, boolean regRequired, boolean skipMissing)
           
ReflectingInstantiator(Config conf)
           
ReflectingInstantiator(java.lang.Iterable<ClassRegistrar> classRegistrations, java.lang.Iterable<ReflectingRegistrar> registrations, java.lang.Iterable<ReflectingDefaultRegistrar> defaults)
          Create an instance using the defaults for non-listed params
 
Method Summary
protected  java.util.List<? extends IKryoRegistrar> buildRegistrars(java.lang.String base, boolean isAddDefault)
           
 boolean equals(java.lang.Object that)
           
 int hashCode()
           
 com.esotericsoftware.kryo.Kryo newKryo()
           
protected  com.esotericsoftware.kryo.Kryo newKryoWithEx()
           
protected  java.lang.String registrarsToString(java.lang.Iterable<? extends IKryoRegistrar> registrars)
           
 void set(Config conf)
           
 
Methods inherited from class com.twitter.chill.KryoInstantiator
setInstantiatorStrategy, setReferences, setRegistrationRequired, withRegistrar
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prefix

public static final java.lang.String prefix
All keys are prefixed with this string

See Also:
Constant Field Values

KRYO_CLASS

public static final java.lang.String KRYO_CLASS
Name of the subclass of kryo to instantiate to start with. If this is empty, we use Kryo.class

See Also:
Constant Field Values

KRYO_CLASS_DEFAULT

public static final java.lang.String KRYO_CLASS_DEFAULT

INSTANTIATOR_STRATEGY_CLASS

public static final java.lang.String INSTANTIATOR_STRATEGY_CLASS
Name of the InstatiatorStrategy to use. If this is empty, we use org.objenesis.strategy.StdInstantiatorStrategy

See Also:
Constant Field Values

INSTANTIATOR_STRATEGY_CLASS_DEFAULT

public static final java.lang.String INSTANTIATOR_STRATEGY_CLASS_DEFAULT

REGISTRATIONS

public static final java.lang.String 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:
Constant Field Values

DEFAULT_REGISTRATIONS

public static final java.lang.String 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:
Constant Field Values

SKIP_MISSING

public static final java.lang.String 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:
Constant Field Values

SKIP_MISSING_DEFAULT

public static final boolean SKIP_MISSING_DEFAULT
See Also:
Constant Field Values

REGISTRATION_REQUIRED

public static final java.lang.String 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:
Constant Field Values

REGISTRATION_REQUIRED_DEFAULT

public static final boolean REGISTRATION_REQUIRED_DEFAULT
See Also:
Constant Field Values
Constructor Detail

ReflectingInstantiator

public ReflectingInstantiator(Config conf)
                       throws ConfigurationException
Throws:
ConfigurationException

ReflectingInstantiator

public ReflectingInstantiator(java.lang.Iterable<ClassRegistrar> classRegistrations,
                              java.lang.Iterable<ReflectingRegistrar> registrations,
                              java.lang.Iterable<ReflectingDefaultRegistrar> defaults)
Create an instance using the defaults for non-listed params


ReflectingInstantiator

public ReflectingInstantiator(java.lang.Class<? extends com.esotericsoftware.kryo.Kryo> kryoClass,
                              java.lang.Class<? extends org.objenesis.strategy.InstantiatorStrategy> stratClass,
                              java.lang.Iterable<ClassRegistrar> classRegistrations,
                              java.lang.Iterable<ReflectingRegistrar> registrations,
                              java.lang.Iterable<ReflectingDefaultRegistrar> defaults,
                              boolean regRequired,
                              boolean skipMissing)
Method Detail

set

public void set(Config conf)
         throws ConfigurationException
Throws:
ConfigurationException

newKryoWithEx

protected com.esotericsoftware.kryo.Kryo newKryoWithEx()
                                                throws java.lang.InstantiationException,
                                                       java.lang.IllegalAccessException
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException

newKryo

public com.esotericsoftware.kryo.Kryo newKryo()
Overrides:
newKryo in class KryoInstantiator

buildRegistrars

protected java.util.List<? extends IKryoRegistrar> buildRegistrars(java.lang.String base,
                                                                   boolean isAddDefault)
                                                            throws ConfigurationException
Throws:
ConfigurationException

registrarsToString

protected java.lang.String registrarsToString(java.lang.Iterable<? extends IKryoRegistrar> registrars)
                                       throws ConfigurationException
Throws:
ConfigurationException

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object that)
Overrides:
equals in class java.lang.Object