Class PriorityMergeReader
- java.lang.Object
-
- org.apache.iotdb.db.query.reader.universal.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.IPointReaderThis class implementsIPointReaderfor data sources with different priorities.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPriorityMergeReader.MergeReaderPriority
-
Field Summary
Fields Modifier and Type Field Description protected longcurrentReadStopTimeprotected java.util.PriorityQueue<Element>heap
-
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 voidaddReader(org.apache.iotdb.tsfile.read.reader.IPointReader reader, long priority)voidaddReader(org.apache.iotdb.tsfile.read.reader.IPointReader reader, PriorityMergeReader.MergeReaderPriority priority, long endTime, QueryContext context)voidclose()org.apache.iotdb.tsfile.read.TimeValuePaircurrentTimeValuePair()protected voidfillNullValue(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 versionlonggetCurrentReadStopTime()booleanhasNextTimeValuePair()org.apache.iotdb.tsfile.read.TimeValuePairnextTimeValuePair()protected voidupdateHeap(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
-
-
-
Field Detail
-
currentReadStopTime
protected long currentReadStopTime
-
heap
protected java.util.PriorityQueue<Element> heap
-
-
Method Detail
-
addReader
public void addReader(org.apache.iotdb.tsfile.read.reader.IPointReader reader, long priority) throws java.io.IOException- Throws:
java.io.IOException
-
addReader
public void addReader(org.apache.iotdb.tsfile.read.reader.IPointReader reader, PriorityMergeReader.MergeReaderPriority priority, long endTime, QueryContext context) throws java.io.IOException- Throws:
java.io.IOException
-
getCurrentReadStopTime
public long getCurrentReadStopTime()
-
hasNextTimeValuePair
public boolean hasNextTimeValuePair()
- Specified by:
hasNextTimeValuePairin interfaceorg.apache.iotdb.tsfile.read.reader.IPointReader
-
nextTimeValuePair
public org.apache.iotdb.tsfile.read.TimeValuePair nextTimeValuePair() throws java.io.IOException- Specified by:
nextTimeValuePairin interfaceorg.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:
currentTimeValuePairin interfaceorg.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.IOExceptionremove 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:
closein interfaceorg.apache.iotdb.tsfile.read.reader.IPointReader- Throws:
java.io.IOException
-
-