Class PriorityMergeReader

  • All Implemented Interfaces:
    org.apache.iotdb.tsfile.read.reader.IPointReader
    Direct Known Subclasses:
    AlignedPriorityMergeReader, CachedPriorityMergeReader, DescPriorityMergeReader

    public class PriorityMergeReader
    extends java.lang.Object
    implements org.apache.iotdb.tsfile.read.reader.IPointReader
    This class implements IPointReader for data sources with different priorities.
    • Constructor Summary

      Constructors 
      Constructor Description
      PriorityMergeReader()  
      PriorityMergeReader​(java.util.List<org.apache.iotdb.tsfile.read.reader.IPointReader> prioritySeriesReaders, int startPriority)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addReader​(org.apache.iotdb.tsfile.read.reader.IPointReader reader, long priority)  
      void addReader​(org.apache.iotdb.tsfile.read.reader.IPointReader reader, PriorityMergeReader.MergeReaderPriority priority, long endTime, QueryContext context)  
      void close()  
      org.apache.iotdb.tsfile.read.TimeValuePair currentTimeValuePair()  
      protected void fillNullValue​(org.apache.iotdb.tsfile.read.TimeValuePair v, org.apache.iotdb.tsfile.read.TimeValuePair c)
      this method only take effect for aligned time series, so the override version
      long getCurrentReadStopTime()  
      boolean hasNextTimeValuePair()  
      org.apache.iotdb.tsfile.read.TimeValuePair nextTimeValuePair()  
      protected void updateHeap​(org.apache.iotdb.tsfile.read.TimeValuePair ret, org.apache.iotdb.tsfile.read.TimeValuePair topNext)
      remove all the TimeValuePair that shares the same timestamp if it's an aligned path we may need to use those records that share the same timestamp to fill the null sub sensor value in current TimeValuePair
      • Methods inherited from class java.lang.Object

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

      • currentReadStopTime

        protected long currentReadStopTime
      • heap

        protected java.util.PriorityQueue<Element> heap
    • Constructor Detail

      • PriorityMergeReader

        public PriorityMergeReader()
      • PriorityMergeReader

        public PriorityMergeReader​(java.util.List<org.apache.iotdb.tsfile.read.reader.IPointReader> prioritySeriesReaders,
                                   int startPriority)
                            throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • addReader

        public void addReader​(org.apache.iotdb.tsfile.read.reader.IPointReader reader,
                              long priority)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • getCurrentReadStopTime

        public long getCurrentReadStopTime()
      • hasNextTimeValuePair

        public boolean hasNextTimeValuePair()
        Specified by:
        hasNextTimeValuePair in interface org.apache.iotdb.tsfile.read.reader.IPointReader
      • nextTimeValuePair

        public org.apache.iotdb.tsfile.read.TimeValuePair nextTimeValuePair()
                                                                     throws java.io.IOException
        Specified by:
        nextTimeValuePair in interface org.apache.iotdb.tsfile.read.reader.IPointReader
        Throws:
        java.io.IOException
      • currentTimeValuePair

        public org.apache.iotdb.tsfile.read.TimeValuePair currentTimeValuePair()
                                                                        throws java.io.IOException
        Specified by:
        currentTimeValuePair in interface org.apache.iotdb.tsfile.read.reader.IPointReader
        Throws:
        java.io.IOException
      • updateHeap

        protected void updateHeap​(org.apache.iotdb.tsfile.read.TimeValuePair ret,
                                  org.apache.iotdb.tsfile.read.TimeValuePair topNext)
                           throws java.io.IOException
        remove all the TimeValuePair that shares the same timestamp if it's an aligned path we may need to use those records that share the same timestamp to fill the null sub sensor value in current TimeValuePair
        Throws:
        java.io.IOException
      • fillNullValue

        protected void fillNullValue​(org.apache.iotdb.tsfile.read.TimeValuePair v,
                                     org.apache.iotdb.tsfile.read.TimeValuePair c)
        this method only take effect for aligned time series, so the override version
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface org.apache.iotdb.tsfile.read.reader.IPointReader
        Throws:
        java.io.IOException