public abstract class SerializerEightByte<E> extends java.lang.Object implements GroupSerializer<E>
BIG_DECIMAL, BIG_INTEGER, BOOLEAN, BYTE, BYTE_ARRAY, BYTE_ARRAY_DELTA, BYTE_ARRAY_DELTA2, BYTE_ARRAY_NOSIZE, CHAR, CHAR_ARRAY, CLASS, DATE, DOUBLE, DOUBLE_ARRAY, ELSA, FLOAT, FLOAT_ARRAY, ILLEGAL_ACCESS, INT_ARRAY, INTEGER, INTEGER_DELTA, INTEGER_PACKED, JAVA, LONG, LONG_ARRAY, LONG_DELTA, LONG_PACKED, RECID, RECID_ARRAY, SHORT, SHORT_ARRAY, STRING, STRING_ASCII, STRING_DELTA, STRING_DELTA2, STRING_INTERN, STRING_NOSIZE, STRING_ORIGHASH, UUID| Constructor and Description |
|---|
SerializerEightByte() |
| Modifier and Type | Method and Description |
|---|---|
int |
fixedSize()
Returns the fixed size of the serialized form in bytes or -1 if the size
is not fixed (e.g.
|
boolean |
isTrusted()
Returns if this Serializer is trusted to always read the same number of
bytes as it writes for any given object being serialized/de-serialized.
|
protected abstract long |
pack(E l) |
protected abstract E |
unpack(long l) |
E |
valueArrayBinaryGet(DataInput2 input,
int keysLen,
int pos) |
java.lang.Object |
valueArrayCopyOfRange(java.lang.Object vals,
int from,
int to) |
java.lang.Object |
valueArrayDeleteValue(java.lang.Object vals,
int pos) |
java.lang.Object |
valueArrayDeserialize(DataInput2 in,
int size) |
java.lang.Object |
valueArrayEmpty() |
java.lang.Object |
valueArrayFromArray(java.lang.Object[] objects) |
E |
valueArrayGet(java.lang.Object vals,
int pos) |
java.lang.Object |
valueArrayPut(java.lang.Object vals,
int pos,
E newValue) |
int |
valueArraySearch(java.lang.Object keys,
E key,
java.util.Comparator comparator) |
void |
valueArraySerialize(DataOutput2 out,
java.lang.Object vals) |
int |
valueArraySize(java.lang.Object vals) |
java.lang.Object |
valueArrayUpdateVal(java.lang.Object vals,
int pos,
E newValue) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnextValue, valueArrayBinarySearch, valueArraySearch, valueArrayToArrayclone, compare, deserialize, deserializeFromLong, equals, hashCode, needsAvailableSizeHint, serializeprotected abstract E unpack(long l)
protected abstract long pack(E l)
public E valueArrayGet(java.lang.Object vals, int pos)
valueArrayGet in interface GroupSerializer<E>public int valueArraySize(java.lang.Object vals)
valueArraySize in interface GroupSerializer<E>public java.lang.Object valueArrayEmpty()
valueArrayEmpty in interface GroupSerializer<E>public java.lang.Object valueArrayPut(java.lang.Object vals,
int pos,
E newValue)
valueArrayPut in interface GroupSerializer<E>public java.lang.Object valueArrayUpdateVal(java.lang.Object vals,
int pos,
E newValue)
valueArrayUpdateVal in interface GroupSerializer<E>public java.lang.Object valueArrayFromArray(java.lang.Object[] objects)
valueArrayFromArray in interface GroupSerializer<E>public java.lang.Object valueArrayCopyOfRange(java.lang.Object vals,
int from,
int to)
valueArrayCopyOfRange in interface GroupSerializer<E>public java.lang.Object valueArrayDeleteValue(java.lang.Object vals,
int pos)
valueArrayDeleteValue in interface GroupSerializer<E>public void valueArraySerialize(DataOutput2 out, java.lang.Object vals) throws java.io.IOException
valueArraySerialize in interface GroupSerializer<E>java.io.IOExceptionpublic java.lang.Object valueArrayDeserialize(DataInput2 in, int size) throws java.io.IOException
valueArrayDeserialize in interface GroupSerializer<E>java.io.IOExceptionpublic E valueArrayBinaryGet(DataInput2 input, int keysLen, int pos) throws java.io.IOException
valueArrayBinaryGet in interface GroupSerializer<E>java.io.IOExceptionpublic boolean isTrusted()
SerializerMapDB has a relaxed record size boundary checking. It expects deserializers to read exactly as many bytes as were written during serialization. If a deserializer reads more bytes than it wrote, it might start reading others record data in store.
Some serializers (Kryo) have problems with this. To prevent this, we can
not read data directly from a store, but we must copy them into separate
byte[] buffers. Thus, zero-copy optimizations are disabled by
default, but can be explicitly enabled here by letting this method return
true.
This flag indicates if this serializer was 'verified' to read as many bytes as it writes. It should also be much better tested etc.
isTrusted in interface Serializer<E>public int fixedSize()
SerializerSome optimizations can be applied to serializers with a fixed size.
fixedSize in interface Serializer<E>public final int valueArraySearch(java.lang.Object keys,
E key,
java.util.Comparator comparator)
valueArraySearch in interface GroupSerializer<E>Copyright © 2018. All Rights Reserved.