Annotation SerializationToken enables
TupleInputStream
and
TupleOutputStream
to substitute Integer values for a class name when writing out nested objects inside a
Tuple
.
To use, add this annotation to any custom Hadoop
Serialization
implementation.
For example:
@SerializationToken(tokens={222, 223}, classNames = {"example.PersonObject", "example.SiteObject"})
public class MySerialization implements org.apache.hadoop.io.serializer.Serialization
{
public MySerialization()
{
...
}
...
}
The SerializationToken annotation allows for multiple token to className mappings, since a Serialization implementation may
Serialization.accept(Class)
more than one class.
Note that the token integer value must be 128 or greater to save room for internal types.