Class LinearFill

  • All Implemented Interfaces:
    ILinearFill
    Direct Known Subclasses:
    DoubleLinearFill, FloatLinearFill, IntLinearFill, LongLinearFill

    public abstract class LinearFill
    extends java.lang.Object
    implements ILinearFill
    The result of Linear Fill functions at timestamp "T" is calculated by performing a linear fitting method on two time series values, one is at the closest timestamp before T, and the other is at the closest timestamp after T. Linear Fill function calculation only supports numeric types including long, int, double and float.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean previousIsNull  
    • Constructor Summary

      Constructors 
      Constructor Description
      LinearFill()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.iotdb.tsfile.read.common.block.column.Column fill​(org.apache.iotdb.tsfile.read.common.block.column.TimeColumn timeColumn, org.apache.iotdb.tsfile.read.common.block.column.Column valueColumn, long startRowIndex)
      Before we call this method, we need to make sure the nextValue has been prepared or noMoreNext has been set to true
      boolean needPrepareForNext​(long rowIndex, org.apache.iotdb.tsfile.read.common.block.column.Column valueColumn)  
      boolean prepareForNext​(long startRowIndex, long endRowIndex, org.apache.iotdb.tsfile.read.common.block.column.TimeColumn nextTimeColumn, org.apache.iotdb.tsfile.read.common.block.column.Column nextValueColumn)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • previousIsNull

        protected boolean previousIsNull
    • Constructor Detail

      • LinearFill

        public LinearFill()
    • Method Detail

      • fill

        public org.apache.iotdb.tsfile.read.common.block.column.Column fill​(org.apache.iotdb.tsfile.read.common.block.column.TimeColumn timeColumn,
                                                                            org.apache.iotdb.tsfile.read.common.block.column.Column valueColumn,
                                                                            long startRowIndex)
        Description copied from interface: ILinearFill
        Before we call this method, we need to make sure the nextValue has been prepared or noMoreNext has been set to true
        Specified by:
        fill in interface ILinearFill
        Parameters:
        timeColumn - TimeColumn of valueColumn
        valueColumn - valueColumn that need to be filled
        startRowIndex - current row index for start time in timeColumn
        Returns:
        Value Column that has been filled
      • needPrepareForNext

        public boolean needPrepareForNext​(long rowIndex,
                                          org.apache.iotdb.tsfile.read.common.block.column.Column valueColumn)
        Specified by:
        needPrepareForNext in interface ILinearFill
        Parameters:
        rowIndex - end time of current valueColumn that need to be filled
        valueColumn - valueColumn that need to be filled
        Returns:
        true if valueColumn can't be filled using current information, and we need to get next TsBlock and then call prepareForNext. false if valueColumn can be filled using current information, and we can directly call fill() function
      • prepareForNext

        public boolean prepareForNext​(long startRowIndex,
                                      long endRowIndex,
                                      org.apache.iotdb.tsfile.read.common.block.column.TimeColumn nextTimeColumn,
                                      org.apache.iotdb.tsfile.read.common.block.column.Column nextValueColumn)
        Specified by:
        prepareForNext in interface ILinearFill
        Parameters:
        startRowIndex - row index for start time of nextValueColumn
        endRowIndex - row index for end time of current valueColumn that need to be filled
        nextTimeColumn - TimeColumn of next TsBlock
        nextValueColumn - Value Column of next TsBlock
        Returns:
        true if we get enough information to fill current column, and we can stop getting next TsBlock and calling prepareForNext. false if we still don't get enough information to fill current column, and still need to keep getting next TsBlock and then call prepareForNext