Class SerializablePairLongStringComplexMetricSerde
java.lang.Object
org.apache.druid.segment.serde.ComplexMetricSerde
org.apache.druid.query.aggregation.SerializablePairLongStringComplexMetricSerde
The SerializablePairLongStringSerde serializes a Long-String pair (SerializablePairLongString).
The serialization structure is: Long:Integer:String
The Long is delta-encoded for the column in order to potentially reduce the size to an integer so it may be stored
as: Integer:Integer:String
Future work: dictionary encoding of the String may be performed
The class is used on first/last String aggregators to store the time and the first/last string.
[Integer|Long]:Integer:String -> delta:StringSize:StringData --(delta decoded)--> TimeStamp:StringSize:StringData
(see )
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserializeColumn(ByteBuffer buffer, ColumnBuilder columnBuilder) ComplexMetricSerde.deserializeColumn(ByteBuffer, ColumnBuilder, ColumnConfig)should be used instead of this.This is deprecated because its usage is going to be removed from the code.getSerializer(SegmentWriteOutMedium segmentWriteOutMedium, String column, IndexSpec indexSpec) This method provides the ability for a ComplexMetricSerde to control its own serialization.Get aTypeStrategyto assist with writing individual complex values to aByteBuffer.Methods inherited from class org.apache.druid.segment.serde.ComplexMetricSerde
deserializeColumn, fromBytes, getSerializer, inputSizeFn, toBytes
-
Field Details
-
EXPECTED_VERSION
public static final int EXPECTED_VERSION- See Also:
-
TYPE_NAME
- See Also:
-
-
Constructor Details
-
SerializablePairLongStringComplexMetricSerde
public SerializablePairLongStringComplexMetricSerde() -
SerializablePairLongStringComplexMetricSerde
public SerializablePairLongStringComplexMetricSerde(boolean compressionEnabled)
-
-
Method Details
-
getTypeName
- Specified by:
getTypeNamein classComplexMetricSerde
-
getExtractor
- Specified by:
getExtractorin classComplexMetricSerde
-
deserializeColumn
Description copied from class:ComplexMetricSerdeComplexMetricSerde.deserializeColumn(ByteBuffer, ColumnBuilder, ColumnConfig)should be used instead of this. This method is left for backward compatibility.- Overrides:
deserializeColumnin classComplexMetricSerde
-
getObjectStrategy
Description copied from class:ComplexMetricSerdeThis is deprecated because its usage is going to be removed from the code.It was introduced before deserializeColumn() existed. This method creates the assumption that Druid knows how to interpret the actual column representation of the data, but I would much prefer that the ComplexMetricSerde objects be in charge of creating and interpreting the whole column, which is what deserializeColumn lets them do.
- Specified by:
getObjectStrategyin classComplexMetricSerde- Returns:
- an ObjectStrategy as used by GenericIndexed
-
getTypeStrategy
Description copied from class:ComplexMetricSerdeGet aTypeStrategyto assist with writing individual complex values to aByteBuffer.- Overrides:
getTypeStrategyin classComplexMetricSerde- See Also:
-
getSerializer
public GenericColumnSerializer<?> getSerializer(SegmentWriteOutMedium segmentWriteOutMedium, String column, IndexSpec indexSpec) Description copied from class:ComplexMetricSerdeThis method provides the ability for a ComplexMetricSerde to control its own serialization. Default implementation usesCompressedComplexColumnSerializerifIndexSpec.complexMetricCompressionis not null or uncompressed/none, orLargeColumnSupportedComplexColumnSerializerif no compression is specified.- Overrides:
getSerializerin classComplexMetricSerde- Returns:
- an instance of
GenericColumnSerializerused for serialization.
-