public abstract class ComplexMetricSerde extends Object
| Constructor and Description |
|---|
ComplexMetricSerde() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
deserializeColumn(ByteBuffer buffer,
ColumnBuilder builder)
Deprecated.
|
void |
deserializeColumn(ByteBuffer buffer,
ColumnBuilder builder,
ColumnConfig columnConfig)
Deserializes a ByteBuffer and adds it to the ColumnBuilder.
|
Object |
fromBytes(byte[] data,
int start,
int numBytes)
Converts byte[] to intermediate representation of the aggregate.
|
abstract ComplexMetricExtractor |
getExtractor() |
abstract ObjectStrategy |
getObjectStrategy()
Deprecated.
|
GenericColumnSerializer |
getSerializer(SegmentWriteOutMedium segmentWriteOutMedium,
String column)
This method provides the ability for a ComplexMetricSerde to control its own serialization.
|
abstract String |
getTypeName() |
<T extends Comparable<T>> |
getTypeStrategy()
Get a
TypeStrategy to assist with writing individual complex values to a ByteBuffer. |
com.google.common.base.Function<Object,Long> |
inputSizeFn()
Returns a function that can convert the Object provided by the ComplexColumn created through deserializeColumn
into a number of expected input bytes to produce that object.
|
byte[] |
toBytes(Object val)
Converts intermediate representation of aggregate to byte[].
|
public abstract String getTypeName()
public abstract ComplexMetricExtractor getExtractor()
public void deserializeColumn(ByteBuffer buffer, ColumnBuilder builder, ColumnConfig columnConfig)
buffer - the buffer to deserializebuilder - ColumnBuilder to add the column tocolumnConfig - ColumnConfiguration used during deserialization@Deprecated public abstract void deserializeColumn(ByteBuffer buffer, ColumnBuilder builder)
deserializeColumn(ByteBuffer, ColumnBuilder, ColumnConfig) should be used instead of this.
This method is left for backward compatibility.@Deprecated public abstract ObjectStrategy getObjectStrategy()
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.
public <T extends Comparable<T>> TypeStrategy<T> getTypeStrategy()
TypeStrategy to assist with writing individual complex values to a ByteBuffer.TypeStrategy@Nullable public com.google.common.base.Function<Object,Long> inputSizeFn()
This is used to approximate the size of the input data via the SegmentMetadataQuery and does not need to be overridden if you do not care about the query.
public byte[] toBytes(@Nullable Object val)
val - intermediate representation of aggregatepublic Object fromBytes(byte[] data, int start, int numBytes)
data - arraystart - offset in the byte array where to start readingnumBytes - number of bytes to read in given arraypublic GenericColumnSerializer getSerializer(SegmentWriteOutMedium segmentWriteOutMedium, String column)
Integer.MAX_VALUE) use
LargeColumnSupportedComplexColumnSerializerCopyright © 2011–2022 The Apache Software Foundation. All rights reserved.