Class AbstractSeriesAggregationScanOperator
- java.lang.Object
-
- org.apache.iotdb.db.mpp.execution.operator.source.AbstractSeriesAggregationScanOperator
-
- All Implemented Interfaces:
java.lang.AutoCloseable,Operator,DataSourceOperator,SourceOperator
- Direct Known Subclasses:
AlignedSeriesAggregationScanOperator,SeriesAggregationScanOperator
public abstract class AbstractSeriesAggregationScanOperator extends java.lang.Object implements DataSourceOperator
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<Aggregator>aggregatorsprotected booleanascendingprotected org.apache.iotdb.tsfile.read.common.TimeRangecurTimeRangeprotected booleanfinishedprotected org.apache.iotdb.tsfile.read.common.block.TsBlockinputTsBlockprotected booleanisGroupByQueryprotected OperatorContextoperatorContextprotected org.apache.iotdb.tsfile.read.common.block.TsBlockBuilderresultTsBlockBuilderprotected SeriesScanUtilseriesScanUtilprotected PlanNodeIdsourceIdprotected intsubSensorSizeprotected ITimeRangeIteratortimeRangeIterator-
Fields inherited from interface org.apache.iotdb.db.mpp.execution.operator.Operator
NOT_BLOCKED
-
-
Constructor Summary
Constructors Constructor Description AbstractSeriesAggregationScanOperator(PlanNodeId sourceId, OperatorContext context, SeriesScanUtil seriesScanUtil, int subSensorSize, java.util.List<Aggregator> aggregators, ITimeRangeIterator timeRangeIterator, boolean ascending, GroupByTimeParameter groupByTimeParameter, long maxReturnSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancalcFromCachedData()protected voidcalcFromStatistics(org.apache.iotdb.tsfile.file.metadata.statistics.Statistics[] statistics)longcalculateMaxPeekMemory()We should also consider the memory used by its children operator, so the calculation logic may be like: long estimatedOfCurrentOperator = XXXXX; return max(estimatedOfCurrentOperator, child1.calculateMaxPeekMemory(), child2.calculateMaxPeekMemory(), ....)longcalculateMaxReturnSize()protected voidcalculateNextAggregationResult()longcalculateRetainedSizeAfterCallingNext()protected booleancanUseCurrentChunkStatistics()protected booleancanUseCurrentFileStatistics()protected booleancanUseCurrentPageStatistics()OperatorContextgetOperatorContext()PlanNodeIdgetSourceId()booleanhasNext()voidinitQueryDataSource(QueryDataSource dataSource)booleanisFinished()Is this operator completely finished processing and no more output TsBlock will be produced.org.apache.iotdb.tsfile.read.common.block.TsBlocknext()Gets next tsBlock from this operator.protected booleanreadAndCalcFromChunk()protected booleanreadAndCalcFromFile()protected booleanreadAndCalcFromPage()protected voidupdateResultTsBlock()
-
-
-
Field Detail
-
sourceId
protected final PlanNodeId sourceId
-
operatorContext
protected final OperatorContext operatorContext
-
ascending
protected final boolean ascending
-
isGroupByQuery
protected final boolean isGroupByQuery
-
seriesScanUtil
protected SeriesScanUtil seriesScanUtil
-
subSensorSize
protected int subSensorSize
-
inputTsBlock
protected org.apache.iotdb.tsfile.read.common.block.TsBlock inputTsBlock
-
timeRangeIterator
protected final ITimeRangeIterator timeRangeIterator
-
curTimeRange
protected org.apache.iotdb.tsfile.read.common.TimeRange curTimeRange
-
aggregators
protected final java.util.List<Aggregator> aggregators
-
resultTsBlockBuilder
protected final org.apache.iotdb.tsfile.read.common.block.TsBlockBuilder resultTsBlockBuilder
-
finished
protected boolean finished
-
-
Constructor Detail
-
AbstractSeriesAggregationScanOperator
public AbstractSeriesAggregationScanOperator(PlanNodeId sourceId, OperatorContext context, SeriesScanUtil seriesScanUtil, int subSensorSize, java.util.List<Aggregator> aggregators, ITimeRangeIterator timeRangeIterator, boolean ascending, GroupByTimeParameter groupByTimeParameter, long maxReturnSize)
-
-
Method Detail
-
getSourceId
public PlanNodeId getSourceId()
- Specified by:
getSourceIdin interfaceSourceOperator
-
getOperatorContext
public OperatorContext getOperatorContext()
- Specified by:
getOperatorContextin interfaceOperator
-
initQueryDataSource
public void initQueryDataSource(QueryDataSource dataSource)
- Specified by:
initQueryDataSourcein interfaceDataSourceOperator
-
calculateMaxPeekMemory
public long calculateMaxPeekMemory()
Description copied from interface:OperatorWe should also consider the memory used by its children operator, so the calculation logic may be like: long estimatedOfCurrentOperator = XXXXX; return max(estimatedOfCurrentOperator, child1.calculateMaxPeekMemory(), child2.calculateMaxPeekMemory(), ....)Each operator's MaxPeekMemory should also take retained size of each child operator into account.
- Specified by:
calculateMaxPeekMemoryin interfaceOperator- Returns:
- estimated max memory footprint that the Operator Tree(rooted from this operator) will use while doing its own query processing
-
calculateMaxReturnSize
public long calculateMaxReturnSize()
- Specified by:
calculateMaxReturnSizein interfaceOperator- Returns:
- estimated max memory footprint for returned TsBlock when calling operator.next()
-
calculateRetainedSizeAfterCallingNext
public long calculateRetainedSizeAfterCallingNext()
- Specified by:
calculateRetainedSizeAfterCallingNextin interfaceOperator- Returns:
- each operator's retained size(including all its children's retained size) after calling its next() method
-
hasNext
public boolean hasNext()
-
next
public org.apache.iotdb.tsfile.read.common.block.TsBlock next()
Description copied from interface:OperatorGets next tsBlock from this operator. If no data is currently available, return null.
-
isFinished
public boolean isFinished()
Description copied from interface:OperatorIs this operator completely finished processing and no more output TsBlock will be produced.- Specified by:
isFinishedin interfaceOperator
-
calculateNextAggregationResult
protected void calculateNextAggregationResult()
-
updateResultTsBlock
protected void updateResultTsBlock()
-
calcFromCachedData
protected boolean calcFromCachedData()
-
calcFromStatistics
protected void calcFromStatistics(org.apache.iotdb.tsfile.file.metadata.statistics.Statistics[] statistics)
-
readAndCalcFromFile
protected boolean readAndCalcFromFile() throws java.io.IOException- Throws:
java.io.IOException
-
readAndCalcFromChunk
protected boolean readAndCalcFromChunk() throws java.io.IOException- Throws:
java.io.IOException
-
readAndCalcFromPage
protected boolean readAndCalcFromPage() throws java.io.IOException- Throws:
java.io.IOException
-
canUseCurrentFileStatistics
protected boolean canUseCurrentFileStatistics() throws java.io.IOException- Throws:
java.io.IOException
-
canUseCurrentChunkStatistics
protected boolean canUseCurrentChunkStatistics() throws java.io.IOException- Throws:
java.io.IOException
-
canUseCurrentPageStatistics
protected boolean canUseCurrentPageStatistics() throws java.io.IOException- Throws:
java.io.IOException
-
-