Interface Accumulator
-
- All Known Implementing Classes:
AvgAccumulator,CountAccumulator,ExtremeAccumulator,FirstValueAccumulator,FirstValueDescAccumulator,LastValueAccumulator,LastValueDescAccumulator,MaxTimeAccumulator,MaxTimeDescAccumulator,MaxValueAccumulator,MinTimeAccumulator,MinTimeDescAccumulator,MinValueAccumulator,SumAccumulator
public interface Accumulator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intaddInput(org.apache.iotdb.tsfile.read.common.block.column.Column[] column, org.apache.iotdb.tsfile.read.common.TimeRange timeRange)Column should be like: | Time | Value |voidaddIntermediate(org.apache.iotdb.tsfile.read.common.block.column.Column[] partialResult)For aggregation function like COUNT, SUM, partialResult should be single; But for AVG, last_value, it should be double column with dictionary order.voidaddStatistics(org.apache.iotdb.tsfile.file.metadata.statistics.Statistics statistics)This method can only be used in seriesAggregateScanOperator, it will use different statistics based on the type of Accumulator.org.apache.iotdb.tsfile.file.metadata.enums.TSDataTypegetFinalType()org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[]getIntermediateType()booleanhasFinalResult()This method can only be used in seriesAggregateScanOperator.voidoutputFinal(org.apache.iotdb.tsfile.read.common.block.column.ColumnBuilder tsBlockBuilder)Final result is single column for any aggregation function.voidoutputIntermediate(org.apache.iotdb.tsfile.read.common.block.column.ColumnBuilder[] tsBlockBuilder)For aggregation function like COUNT, SUM, partialResult should be single, so its output column is single too; But for AVG(COUNT and SUM), LAST_VALUE(LAST_VALUE and MAX_TIME), the output columns should be double in dictionary order.voidreset()voidsetFinal(org.apache.iotdb.tsfile.read.common.block.column.Column finalResult)Attention: setFinal should be invoked only once, and addInput() and addIntermediate() are not allowed again.
-
-
-
Method Detail
-
addInput
int addInput(org.apache.iotdb.tsfile.read.common.block.column.Column[] column, org.apache.iotdb.tsfile.read.common.TimeRange timeRange)Column should be like: | Time | Value |Return the last read row index of current timeColumn
-
addIntermediate
void addIntermediate(org.apache.iotdb.tsfile.read.common.block.column.Column[] partialResult)
For aggregation function like COUNT, SUM, partialResult should be single; But for AVG, last_value, it should be double column with dictionary order.
-
addStatistics
void addStatistics(org.apache.iotdb.tsfile.file.metadata.statistics.Statistics statistics)
This method can only be used in seriesAggregateScanOperator, it will use different statistics based on the type of Accumulator.
-
setFinal
void setFinal(org.apache.iotdb.tsfile.read.common.block.column.Column finalResult)
Attention: setFinal should be invoked only once, and addInput() and addIntermediate() are not allowed again.
-
outputIntermediate
void outputIntermediate(org.apache.iotdb.tsfile.read.common.block.column.ColumnBuilder[] tsBlockBuilder)
For aggregation function like COUNT, SUM, partialResult should be single, so its output column is single too; But for AVG(COUNT and SUM), LAST_VALUE(LAST_VALUE and MAX_TIME), the output columns should be double in dictionary order.
-
outputFinal
void outputFinal(org.apache.iotdb.tsfile.read.common.block.column.ColumnBuilder tsBlockBuilder)
Final result is single column for any aggregation function.
-
reset
void reset()
-
hasFinalResult
boolean hasFinalResult()
This method can only be used in seriesAggregateScanOperator. For first_value or last_value in decreasing order, we can get final result by the first record.
-
getIntermediateType
org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] getIntermediateType()
-
getFinalType
org.apache.iotdb.tsfile.file.metadata.enums.TSDataType getFinalType()
-
-