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 interface
VSizeLongSerde.LongDeserializer
Unpack bitpacked long values from an underlying contiguous memory blockstatic interface
VSizeLongSerde.LongSerializer
-
Field Summary
Fields Modifier and Type Field Description static byte[]
EMPTY
static int[]
SUPPORTED_SIZES
-
Constructor Summary
Constructors Constructor Description VSizeLongSerde()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getBitsForMax(long value)
static VSizeLongSerde.LongDeserializer
getDeserializer(int longSize, ByteBuffer fromBuffer, int bufferOffset)
static int
getNumValuesPerBlock(int bitsPerValue, int blockSize)
Block size should be power of 2, soColumnarLongs.get(int)
can be optimized using bit operators.static int
getSerializedSize(int bitsPerValue, int numValues)
static VSizeLongSerde.LongSerializer
getSerializer(int longSize, OutputStream output)
static VSizeLongSerde.LongSerializer
getSerializer(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)
-
-