@Retention(value=RUNTIME) @Target(value=TYPE) public @interface SerializationToken
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 org.apache.hadoop.io.serializer.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
org.apache.hadoop.io.serializer.Serialization#accept(Class) more than one class.
Note that the token integer value must be 128 or greater to save room for internal types.
TupleInputStream,
TupleOutputStream,
TupleSerialization| Modifier and Type | Required Element and Description |
|---|---|
java.lang.String[] |
classNames |
int[] |
tokens |
public abstract int[] tokens
public abstract java.lang.String[] classNames
Copyright © 2007-2021 Cascading Maintainers. All Rights Reserved.