Interface Accumulator

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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 |
      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.
      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.
      org.apache.iotdb.tsfile.file.metadata.enums.TSDataType getFinalType()  
      org.apache.iotdb.tsfile.file.metadata.enums.TSDataType[] getIntermediateType()  
      boolean hasFinalResult()
      This method can only be used in seriesAggregateScanOperator.
      void outputFinal​(org.apache.iotdb.tsfile.read.common.block.column.ColumnBuilder tsBlockBuilder)
      Final result is single column for any aggregation function.
      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.
      void reset()  
      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.
    • 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()