Class SerializablePairLongStringDeltaEncodedStagedSerde
- java.lang.Object
-
- org.apache.druid.query.aggregation.SerializablePairLongStringDeltaEncodedStagedSerde
-
- All Implemented Interfaces:
StagedSerde<SerializablePairLongString>
public class SerializablePairLongStringDeltaEncodedStagedSerde extends Object implements StagedSerde<SerializablePairLongString>
serializes a Long/String 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:Integer:bytes otherwise Long:Integer:bytes
-
-
Constructor Summary
Constructors Constructor Description SerializablePairLongStringDeltaEncodedStagedSerde(long minValue, boolean useIntegerDelta)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SerializablePairLongString
deserialize(ByteBuffer byteBuffer)
StorableBuffer
serializeDelayed(SerializablePairLongString value)
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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.segment.serde.cell.StagedSerde
deserialize, serialize
-
-
-
-
Method Detail
-
serializeDelayed
public StorableBuffer serializeDelayed(@Nullable SerializablePairLongString 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 theStorableBuffer
instance returned- Specified by:
serializeDelayed
in interfaceStagedSerde<SerializablePairLongString>
- Parameters:
value
- - object to serialize- Returns:
- an object that reports its serialized size and how to serialize the object to a ByteBuffer
-
deserialize
@Nullable public SerializablePairLongString deserialize(ByteBuffer byteBuffer)
- Specified by:
deserialize
in interfaceStagedSerde<SerializablePairLongString>
-
-