Class VSizeLongSerde

java.lang.Object
org.apache.druid.segment.data.VSizeLongSerde

public class VSizeLongSerde extends Object
Currently only support big endian

An empty 4 bytes is written upon closing to avoid index out of bound exception for deserializers that shift bytes

  • Field Details

    • SUPPORTED_SIZES

      public static final int[] SUPPORTED_SIZES
    • EMPTY

      public static final byte[] EMPTY
  • Constructor Details

    • VSizeLongSerde

      public VSizeLongSerde()
  • Method Details

    • 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, so ColumnarLongs.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)