public abstract class ComplexMetricSerde extends Object
Constructor and Description |
---|
ComplexMetricSerde() |
Modifier and Type | Method and Description |
---|---|
abstract void |
deserializeColumn(ByteBuffer buffer,
ColumnBuilder builder)
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(IOPeon peon,
String column)
This method provides the ability for a ComplexMetricSerde to control its own serialization.
|
abstract String |
getTypeName() |
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 abstract void deserializeColumn(ByteBuffer buffer, ColumnBuilder builder)
buffer
- the buffer to deserializebuilder
- ColumnBuilder to add the column to@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 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(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(IOPeon peon, String column)
peon
- IOPeoncolumn
- name of the columnCopyright © 2011–2017. All rights reserved.