Class SerializablePairLongStringComplexMetricSerde
- java.lang.Object
-
- org.apache.druid.segment.serde.ComplexMetricSerde
-
- org.apache.druid.query.aggregation.SerializablePairLongStringComplexMetricSerde
-
public class SerializablePairLongStringComplexMetricSerde extends ComplexMetricSerde
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:StringFuture 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 Modifier and Type Field Description static int
EXPECTED_VERSION
static String
TYPE_NAME
-
Constructor Summary
Constructors Constructor Description SerializablePairLongStringComplexMetricSerde()
SerializablePairLongStringComplexMetricSerde(boolean compressionEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deserializeColumn(ByteBuffer buffer, ColumnBuilder columnBuilder)
ComplexMetricSerde.deserializeColumn(ByteBuffer, ColumnBuilder, ColumnConfig)
should be used instead of this.ComplexMetricExtractor<?>
getExtractor()
ObjectStrategy<SerializablePairLongString>
getObjectStrategy()
This is deprecated because its usage is going to be removed from the code.GenericColumnSerializer<?>
getSerializer(SegmentWriteOutMedium segmentWriteOutMedium, String column, IndexSpec indexSpec)
This method provides the ability for a ComplexMetricSerde to control its own serialization.String
getTypeName()
TypeStrategy<SerializablePairLongString>
getTypeStrategy()
Get aTypeStrategy
to assist with writing individual complex values to aByteBuffer
.-
Methods inherited from class org.apache.druid.segment.serde.ComplexMetricSerde
deserializeColumn, fromBytes, getSerializer, inputSizeFn, toBytes
-
-
-
-
Field Detail
-
EXPECTED_VERSION
public static final int EXPECTED_VERSION
- See Also:
- Constant Field Values
-
TYPE_NAME
public static final String TYPE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTypeName
public String getTypeName()
- Specified by:
getTypeName
in classComplexMetricSerde
-
getExtractor
public ComplexMetricExtractor<?> getExtractor()
- Specified by:
getExtractor
in classComplexMetricSerde
-
deserializeColumn
public void deserializeColumn(ByteBuffer buffer, ColumnBuilder columnBuilder)
Description copied from class:ComplexMetricSerde
ComplexMetricSerde.deserializeColumn(ByteBuffer, ColumnBuilder, ColumnConfig)
should be used instead of this. This method is left for backward compatibility.- Overrides:
deserializeColumn
in classComplexMetricSerde
-
getObjectStrategy
public ObjectStrategy<SerializablePairLongString> getObjectStrategy()
Description copied from class:ComplexMetricSerde
This 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:
getObjectStrategy
in classComplexMetricSerde
- Returns:
- an ObjectStrategy as used by GenericIndexed
-
getTypeStrategy
public TypeStrategy<SerializablePairLongString> getTypeStrategy()
Description copied from class:ComplexMetricSerde
Get aTypeStrategy
to assist with writing individual complex values to aByteBuffer
.- Overrides:
getTypeStrategy
in classComplexMetricSerde
- See Also:
TypeStrategy
-
getSerializer
public GenericColumnSerializer<?> getSerializer(SegmentWriteOutMedium segmentWriteOutMedium, String column, IndexSpec indexSpec)
Description copied from class:ComplexMetricSerde
This method provides the ability for a ComplexMetricSerde to control its own serialization. Default implementation usesCompressedComplexColumnSerializer
ifIndexSpec.complexMetricCompression
is not null or uncompressed/none, orLargeColumnSupportedComplexColumnSerializer
if no compression is specified.- Overrides:
getSerializer
in classComplexMetricSerde
- Returns:
- an instance of
GenericColumnSerializer
used for serialization.
-
-