Class SerializablePairLongStringDeltaEncodedStagedSerde
java.lang.Object
org.apache.druid.query.aggregation.AbstractSerializablePairLongObjectDeltaEncodedStagedSerde<SerializablePairLongString>
org.apache.druid.query.aggregation.SerializablePairLongStringDeltaEncodedStagedSerde
- All Implemented Interfaces:
StagedSerde<SerializablePairLongString>
public class SerializablePairLongStringDeltaEncodedStagedSerde
extends AbstractSerializablePairLongObjectDeltaEncodedStagedSerde<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
The StringSize can be following:
-1 : Denotes an empty string
0 : Denotes a null string
>0 : Denotes a non-empty string
Mapping of null and empty string is done weirdly to preserve backward compatibility when nulls were returned all the
time, and there was no distinction between empty and null string
-
Constructor Summary
ConstructorsConstructorDescriptionSerializablePairLongStringDeltaEncodedStagedSerde(long minValue, boolean useIntegerDelta) -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(ByteBuffer byteBuffer) 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, waitMethods inherited from interface org.apache.druid.segment.serde.cell.StagedSerde
deserialize, serialize
-
Constructor Details
-
SerializablePairLongStringDeltaEncodedStagedSerde
public SerializablePairLongStringDeltaEncodedStagedSerde(long minValue, boolean useIntegerDelta)
-
-
Method Details
-
serializeDelayed
Description copied from interface:StagedSerdeUseful 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 theStorableBufferinstance returned- Specified by:
serializeDelayedin interfaceStagedSerde<SerializablePairLongString>- Overrides:
serializeDelayedin classAbstractSerializablePairLongObjectDeltaEncodedStagedSerde<SerializablePairLongString>- Parameters:
value- - object to serialize- Returns:
- an object that reports its serialized size and how to serialize the object to a ByteBuffer
-
deserialize
-