KEY - type of keyKEYS - type of object which holds multiple keys (public abstract class BTreeKeySerializer<KEY,KEYS> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BTreeKeySerializer.ArrayKeySerializer |
static class |
BTreeKeySerializer.BasicKeySerializer
Basic Key Serializer which just writes data without applying any compression.
|
static class |
BTreeKeySerializer.ByteArrayKeys |
static class |
BTreeKeySerializer.CharArrayKeys |
static class |
BTreeKeySerializer.Compress |
static interface |
BTreeKeySerializer.StringArrayKeys |
| Modifier and Type | Field and Description |
|---|---|
static BTreeKeySerializer |
ARRAY2 |
static BTreeKeySerializer |
ARRAY3 |
static BTreeKeySerializer |
ARRAY4 |
static BTreeKeySerializer<Object,Object[]> |
BASIC |
static BTreeKeySerializer<byte[],BTreeKeySerializer.ByteArrayKeys> |
BYTE_ARRAY |
static BTreeKeySerializer<byte[],byte[][]> |
BYTE_ARRAY2 |
static BTreeKeySerializer<Integer,int[]> |
INTEGER
Applies delta packing on
java.lang.Integer. |
static BTreeKeySerializer<Long,long[]> |
LONG
Applies delta packing on
java.lang.Long. |
static BTreeKeySerializer<String,BTreeKeySerializer.StringArrayKeys> |
STRING |
static BTreeKeySerializer<String,char[][]> |
STRING2 |
static BTreeKeySerializer<UUID,long[]> |
UUID |
static BTreeKeySerializer |
ZERO_OR_POSITIVE_INT
Deprecated.
use
INTEGER |
static BTreeKeySerializer |
ZERO_OR_POSITIVE_LONG
Deprecated.
use
LONG |
| Constructor and Description |
|---|
BTreeKeySerializer() |
| Modifier and Type | Method and Description |
|---|---|
abstract KEYS |
arrayToKeys(Object[] keys) |
protected static int |
commonPrefixLen(byte[][] bytes) |
protected static int |
commonPrefixLen(char[][] chars) |
abstract Comparator<KEY> |
comparator() |
abstract int |
compare(KEYS keys,
int pos1,
int pos2) |
abstract int |
compare(KEYS keys,
int pos,
KEY key) |
boolean |
compareIsSmaller(KEYS keys,
int pos,
KEY key) |
abstract KEYS |
copyOfRange(KEYS keys,
int from,
int to) |
abstract KEYS |
deleteKey(KEYS keys,
int pos) |
abstract KEYS |
deserialize(DataInput in,
int nodeSize)
Deserializes keys for single BTree Node.
|
abstract KEYS |
emptyKeys() |
int |
findChildren(BTreeMap.BNode node,
Object key)
Find the first children node with a key equal or greater than the given key.
|
int |
findChildren2(BTreeMap.BNode node,
Object key) |
abstract KEY |
getKey(KEYS keys,
int pos) |
boolean |
isTrusted() |
Object[] |
keysToArray(KEYS keys) |
abstract int |
length(KEYS keys) |
abstract KEYS |
putKey(KEYS keys,
int pos,
KEY newKey)
expand keys array by one and put
newKey at position pos |
abstract void |
serialize(DataOutput out,
KEYS keys)
Serialize keys from single BTree Node.
|
public static final BTreeKeySerializer<Object,Object[]> BASIC
public static final BTreeKeySerializer<Long,long[]> LONG
java.lang.Long.
Difference between consequential numbers is also packed itself, so for small diffs it takes only single byte per
number.public static final BTreeKeySerializer ZERO_OR_POSITIVE_LONG
LONGpublic static final BTreeKeySerializer<Integer,int[]> INTEGER
java.lang.Integer.
Difference between consequential numbers is also packed itself, so for small diffs it takes only single byte per
number.public static final BTreeKeySerializer ZERO_OR_POSITIVE_INT
INTEGERpublic static final BTreeKeySerializer ARRAY2
public static final BTreeKeySerializer ARRAY3
public static final BTreeKeySerializer ARRAY4
public static final BTreeKeySerializer<UUID,long[]> UUID
public static final BTreeKeySerializer<String,char[][]> STRING2
public static final BTreeKeySerializer<String,BTreeKeySerializer.StringArrayKeys> STRING
public static final BTreeKeySerializer<byte[],byte[][]> BYTE_ARRAY2
public static final BTreeKeySerializer<byte[],BTreeKeySerializer.ByteArrayKeys> BYTE_ARRAY
public abstract void serialize(DataOutput out, KEYS keys) throws IOException
out - output stream where to put atakeys - An object which represents keysIOException - in case of an writting errorpublic abstract KEYS deserialize(DataInput in, int nodeSize) throws IOException
in - input stream to read data fromnodeSize - number of keys in deserialized nodeIOException - in case of an reading errorpublic abstract int compare(KEYS keys, int pos1, int pos2)
public abstract Comparator<KEY> comparator()
public abstract KEYS emptyKeys()
public abstract int length(KEYS keys)
public abstract KEYS putKey(KEYS keys, int pos, KEY newKey)
newKey at position poskeys - array of keys to put new key intopos - of new keynewKey - new key to insertpublic int findChildren(BTreeMap.BNode node, Object key)
keyser.length(keys)node - BTree Node to find position inkey - key whose position needs to be findpublic int findChildren2(BTreeMap.BNode node, Object key)
public boolean isTrusted()
protected static int commonPrefixLen(byte[][] bytes)
protected static int commonPrefixLen(char[][] chars)
Copyright © 2015. All Rights Reserved.