A - first tuple valueB - second tuple valuepublic static final class BTreeKeySerializer.Tuple2KeySerializer<A,B> extends BTreeKeySerializer<Fun.Tuple2<A,B>> implements Serializable
Value Serialized as
-------------------------
Tuple(1, 1) 1, 1
Tuple(1, 2) 2
Tuple(1, 3) 3
Tuple(1, 4) 4
BTreeKeySerializer.BasicKeySerializer, BTreeKeySerializer.Tuple2KeySerializer<A,B>, BTreeKeySerializer.Tuple3KeySerializer<A,B,C>, BTreeKeySerializer.Tuple4KeySerializer<A,B,C,D>, BTreeKeySerializer.Tuple5KeySerializer<A,B,C,D,E>, BTreeKeySerializer.Tuple6KeySerializer<A,B,C,D,E,F>| Modifier and Type | Field and Description |
|---|---|
protected Comparator<A> |
aComparator |
protected Serializer<A> |
aSerializer |
protected Serializer<B> |
bSerializer |
BASIC, STRING, TUPLE2, TUPLE3, TUPLE4, ZERO_OR_POSITIVE_INT, ZERO_OR_POSITIVE_LONG| Constructor and Description |
|---|
Tuple2KeySerializer(Comparator<A> aComparator,
Serializer<A> aSerializer,
Serializer<B> bSerializer)
Construct new Tuple2 Key Serializer.
|
| Modifier and Type | Method and Description |
|---|---|
Object[] |
deserialize(DataInput in,
int start,
int end,
int size)
Deserializes keys for single BTree Node.
|
boolean |
equals(Object o) |
Comparator<Fun.Tuple2<A,B>> |
getComparator()
Some key serializers may only work with they own comparators.
|
int |
hashCode() |
void |
serialize(DataOutput out,
int start,
int end,
Object[] keys)
Serialize keys from single BTree Node.
|
leadingValuePackRead, leadingValuePackWriteprotected final Comparator<A> aComparator
protected final Serializer<A> aSerializer
protected final Serializer<B> bSerializer
public Tuple2KeySerializer(Comparator<A> aComparator, Serializer<A> aSerializer, Serializer<B> bSerializer)
aComparator - comparator used for first tuple valueaSerializer - serializer used for first tuple valuebSerializer - serializer used for second tuple valuepublic void serialize(DataOutput out, int start, int end, Object[] keys) throws IOException
BTreeKeySerializerserialize in class BTreeKeySerializer<Fun.Tuple2<A,B>>out - output stream where to put atastart - where data start in array. Before this index all keys are nullend - where data ends in array (exclusive). From this index all keys are nullkeys - array of keys for single BTree NodeIOExceptionpublic Object[] deserialize(DataInput in, int start, int end, int size) throws IOException
BTreeKeySerializerdeserialize in class BTreeKeySerializer<Fun.Tuple2<A,B>>in - input stream to read data fromstart - where data start in array. Before this index all keys are nullend - where data ends in array (exclusive). From this index all keys are nullsize - size of array which should be returnedIOExceptionpublic Comparator<Fun.Tuple2<A,B>> getComparator()
BTreeKeySerializergetComparator in class BTreeKeySerializer<Fun.Tuple2<A,B>>Copyright © 2024. All rights reserved.