public interface Aggregator extends Closeable
ColumnValueSelector objects.
During ingestion, OnheapIncrementalIndex uses instances of this class
from multiple threads. In particular, ingestion threads call aggregate() simultaneously with query threads
calling the various "get" methods. Instances of this class must be thread-safe.| Modifier and Type | Method and Description |
|---|---|
void |
aggregate()
Performs aggregation.
|
default long |
aggregateWithSize()
Performs aggregation and returns the increase in required on-heap memory
caused by this aggregation step.
|
void |
close() |
Object |
get() |
default double |
getDouble()
The default implementation casts
getFloat() to double. |
float |
getFloat() |
long |
getLong() |
default boolean |
isNull()
returns true if aggregator's output type is primitive long/double/float and aggregated value is null,
but when aggregated output type is Object, this method always returns false,
and users are advised to check nullability for the object returned by
get()
method. |
void aggregate()
default long aggregateWithSize()
The default implementation of this method calls aggregate() and returns 0.
If overridden, this method must include the JVM object overheads in the size estimation and must ensure not to underestimate required memory as that might lead to OOM errors.
float getFloat()
long getLong()
default double getDouble()
getFloat() to double.
This default method is added to enable smooth backward compatibility, please re-implement it if your aggregators
work with numeric double columns.default boolean isNull()
get()
method.
The default implementation always return false to enable smooth backward compatibility,
re-implement if your aggregator is nullable.void close()
close in interface AutoCloseableclose in interface CloseableCopyright © 2011–2022 The Apache Software Foundation. All rights reserved.