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<?>
getObjectStrategy()
This is deprecated because its usage is going to be removed from the code.GenericColumnSerializer<?>
getSerializer(SegmentWriteOutMedium segmentWriteOutMedium, String column)
This method provides the ability for a ComplexMetricSerde to control its own serialization.String
getTypeName()
-
Methods inherited from class org.apache.druid.segment.serde.ComplexMetricSerde
deserializeColumn, fromBytes, getTypeStrategy, 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.- Specified by:
deserializeColumn
in classComplexMetricSerde
-
getObjectStrategy
public ObjectStrategy<?> 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
-
getSerializer
public GenericColumnSerializer<?> getSerializer(SegmentWriteOutMedium segmentWriteOutMedium, String column)
Description copied from class:ComplexMetricSerde
This method provides the ability for a ComplexMetricSerde to control its own serialization. For large column (i.e columns greater thanInteger.MAX_VALUE
) useLargeColumnSupportedComplexColumnSerializer
- Overrides:
getSerializer
in classComplexMetricSerde
- Returns:
- an instance of GenericColumnSerializer used for serialization.
-
-