K
- type of keypublic abstract class BTreeKeySerializer<K> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
BTreeKeySerializer.BasicKeySerializer
Basic Key Serializer which just writes data without applying any compression.
|
static class |
BTreeKeySerializer.Tuple2KeySerializer<A,B>
Applies delta compression on array of tuple.
|
static class |
BTreeKeySerializer.Tuple3KeySerializer<A,B,C>
Applies delta compression on array of tuple.
|
static class |
BTreeKeySerializer.Tuple4KeySerializer<A,B,C,D>
Applies delta compression on array of tuple.
|
static class |
BTreeKeySerializer.Tuple5KeySerializer<A,B,C,D,E>
Applies delta compression on array of tuple.
|
static class |
BTreeKeySerializer.Tuple6KeySerializer<A,B,C,D,E,F>
Applies delta compression on array of tuple.
|
Modifier and Type | Field and Description |
---|---|
static BTreeKeySerializer |
BASIC |
static BTreeKeySerializer<String> |
STRING
Applies delta packing on
java.lang.String . |
static BTreeKeySerializer.Tuple2KeySerializer |
TUPLE2
Tuple2 Serializer which uses Default Serializer from DB and expect values to implement
Comparable interface. |
static BTreeKeySerializer.Tuple3KeySerializer |
TUPLE3
Tuple3 Serializer which uses Default Serializer from DB and expect values to implement
Comparable interface. |
static BTreeKeySerializer.Tuple4KeySerializer |
TUPLE4
Tuple4 Serializer which uses Default Serializer from DB and expect values to implement
Comparable interface. |
static BTreeKeySerializer<Integer> |
ZERO_OR_POSITIVE_INT
Applies delta packing on
java.lang.Integer . |
static BTreeKeySerializer<Long> |
ZERO_OR_POSITIVE_LONG
Applies delta packing on
java.lang.Long . |
Constructor and Description |
---|
BTreeKeySerializer() |
Modifier and Type | Method and Description |
---|---|
abstract Object[] |
deserialize(DataInput in,
int start,
int end,
int size)
Deserializes keys for single BTree Node.
|
abstract Comparator<K> |
getComparator()
Some key serializers may only work with they own comparators.
|
static byte[] |
leadingValuePackRead(DataInput in,
byte[] previous,
int ignoreLeadingCount)
Read previously written data from
leadingValuePackWrite() method. |
static void |
leadingValuePackWrite(DataOutput out,
byte[] buf,
byte[] previous,
int ignoreLeadingCount)
This method is used for delta compression for keys.
|
abstract void |
serialize(DataOutput out,
int start,
int end,
Object[] keys)
Serialize keys from single BTree Node.
|
public static final BTreeKeySerializer BASIC
public static final BTreeKeySerializer<Long> ZERO_OR_POSITIVE_LONG
java.lang.Long
. All keys must be non negative.
Difference between consequential numbers is also packed itself, so for small diffs it takes only single byte per
number.public static final BTreeKeySerializer<Integer> ZERO_OR_POSITIVE_INT
java.lang.Integer
. All keys must be non negative.
Difference between consequential numbers is also packed itself, so for small diffs it takes only single byte per
number.public static final BTreeKeySerializer<String> STRING
java.lang.String
. This serializer splits consequent strings
to two parts: shared prefix and different suffix. Only suffix is than stored.public static final BTreeKeySerializer.Tuple2KeySerializer TUPLE2
Comparable
interface.public static final BTreeKeySerializer.Tuple3KeySerializer TUPLE3
Comparable
interface.public static final BTreeKeySerializer.Tuple4KeySerializer TUPLE4
Comparable
interface.public abstract void serialize(DataOutput out, int start, int end, Object[] keys) throws IOException
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 NodeIOException
public abstract Object[] deserialize(DataInput in, int start, int end, int size) throws IOException
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 returnedIOException
public abstract Comparator<K> getComparator()
public static byte[] leadingValuePackRead(DataInput in, byte[] previous, int ignoreLeadingCount) throws IOException
leadingValuePackWrite()
method.
author: Kevin DayIOException
public static void leadingValuePackWrite(DataOutput out, byte[] buf, byte[] previous, int ignoreLeadingCount) throws IOException
IOException
Copyright © 2016. All rights reserved.