Package org.apache.druid.segment.data
Class VSizeLongSerde
- java.lang.Object
-
- org.apache.druid.segment.data.VSizeLongSerde
-
public class VSizeLongSerde extends Object
Currently only support big endianAn empty 4 bytes is written upon closing to avoid index out of bound exception for deserializers that shift bytes
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceVSizeLongSerde.LongDeserializerUnpack bitpacked long values from an underlying contiguous memory blockstatic interfaceVSizeLongSerde.LongSerializer
-
Field Summary
Fields Modifier and Type Field Description static byte[]EMPTYstatic int[]SUPPORTED_SIZES
-
Constructor Summary
Constructors Constructor Description VSizeLongSerde()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetBitsForMax(long value)static VSizeLongSerde.LongDeserializergetDeserializer(int longSize, ByteBuffer fromBuffer, int bufferOffset)static intgetNumValuesPerBlock(int bitsPerValue, int blockSize)Block size should be power of 2, soColumnarLongs.get(int)can be optimized using bit operators.static intgetSerializedSize(int bitsPerValue, int numValues)static VSizeLongSerde.LongSerializergetSerializer(int longSize, OutputStream output)static VSizeLongSerde.LongSerializergetSerializer(int longSize, ByteBuffer buffer, int bufferOffset)
-
-
-
Method Detail
-
getBitsForMax
public static int getBitsForMax(long value)
-
getSerializedSize
public static int getSerializedSize(int bitsPerValue, int numValues)
-
getNumValuesPerBlock
public static int getNumValuesPerBlock(int bitsPerValue, int blockSize)Block size should be power of 2, soColumnarLongs.get(int)can be optimized using bit operators.
-
getSerializer
public static VSizeLongSerde.LongSerializer getSerializer(int longSize, OutputStream output)
-
getSerializer
public static VSizeLongSerde.LongSerializer getSerializer(int longSize, ByteBuffer buffer, int bufferOffset)
-
getDeserializer
public static VSizeLongSerde.LongDeserializer getDeserializer(int longSize, ByteBuffer fromBuffer, int bufferOffset)
-
-