Class AbstractSerializablePairLongObjectDeltaEncodedStagedSerde<T extends SerializablePair<Long,?>>

java.lang.Object
org.apache.druid.query.aggregation.AbstractSerializablePairLongObjectDeltaEncodedStagedSerde<T>
All Implemented Interfaces:
StagedSerde<T>
Direct Known Subclasses:
SerializablePairLongDoubleDeltaEncodedStagedSerde, SerializablePairLongFloatDeltaEncodedStagedSerde, SerializablePairLongLongDeltaEncodedStagedSerde, SerializablePairLongStringDeltaEncodedStagedSerde

public abstract class AbstractSerializablePairLongObjectDeltaEncodedStagedSerde<T extends SerializablePair<Long,?>> extends Object implements StagedSerde<T>
serializes a Long/Object(Number) pair in the context of a column/segment. Uses the minValue to perform delta encoding/decoding and if the range of the segment fits in an integer (useIntegerDelta), the format is Integer:Byte:Integer otherwise Long:Integer:bytes
  • Method Details

    • serializeDelayed

      public StorableBuffer serializeDelayed(@Nullable T value)
      Description copied from interface: StagedSerde
      Useful method when some computation is necessary to prepare for serialization without actually writing out all the bytes in order to determine the serialized size. It allows encapsulation of the size computation and the final logical to actually store into a ByteBuffer. It also allows for callers to pack multiple serialized objects into a single ByteBuffer without extra copies of a byte[]/ByteBuffer by using the StorableBuffer instance returned
      Specified by:
      serializeDelayed in interface StagedSerde<T extends SerializablePair<Long,?>>
      Parameters:
      value - - object to serialize
      Returns:
      an object that reports its serialized size and how to serialize the object to a ByteBuffer