@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 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.TupleInputStream
,
TupleOutputStream
,
TupleSerialization
Modifier and Type | Required Element and Description |
---|---|
String[] |
classNames |
int[] |
tokens |
public abstract int[] tokens
public abstract String[] classNames
Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.