Class TransformOperator
- java.lang.Object
-
- org.apache.iotdb.db.mpp.execution.operator.process.TransformOperator
-
- All Implemented Interfaces:
java.lang.AutoCloseable,Operator,ProcessOperator
public class TransformOperator extends java.lang.Object implements ProcessOperator
-
-
Field Summary
Fields Modifier and Type Field Description protected QueryDataSetInputLayerinputLayerprotected OperatorinputOperatorprotected booleankeepNullprotected OperatorContextoperatorContextprotected java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>outputDataTypesprotected boolean[]shouldIterateReadersToNextValidprotected TimeSelectortimeHeapprotected LayerPointReader[]transformersprotected floatudfCollectorMemoryBudgetInMBprotected floatudfReaderMemoryBudgetInMBprotected floatudfTransformerMemoryBudgetInMBprotected UDTFContextudtfContext-
Fields inherited from interface org.apache.iotdb.db.mpp.execution.operator.Operator
NOT_BLOCKED
-
-
Constructor Summary
Constructors Constructor Description TransformOperator(OperatorContext operatorContext, Operator inputOperator, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> inputDataTypes, java.util.Map<java.lang.String,java.util.List<InputLocation>> inputLocations, Expression[] outputExpressions, boolean keepNull, java.time.ZoneId zoneId, TypeProvider typeProvider, boolean isAscending)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()longcalculateRetainedSizeAfterCallingNext()voidclose()This method will always be called before releasing the Operator reference.protected YieldableStatecollectDataPoint(LayerPointReader reader, org.apache.iotdb.tsfile.read.common.block.column.ColumnBuilder writer, long currentTime, int readerIndex)protected booleancollectReaderAppendIsNull(LayerPointReader reader, long currentTime)OperatorContextgetOperatorContext()booleanhasNext()protected voidinitTransformers(java.util.Map<java.lang.String,java.util.List<InputLocation>> inputLocations, Expression[] outputExpressions, TypeProvider typeProvider)com.google.common.util.concurrent.ListenableFuture<?>isBlocked()Returns a future that will be completed when the operator becomes unblocked.booleanisFinished()Is this operator completely finished processing and no more output TsBlock will be produced.protected YieldableStateiterateAllColumnsToNextValid()protected YieldableStateiterateReaderToNextValid(LayerPointReader reader)org.apache.iotdb.tsfile.read.common.block.TsBlocknext()Gets next tsBlock from this operator.
-
-
-
Field Detail
-
udfReaderMemoryBudgetInMB
protected final float udfReaderMemoryBudgetInMB
-
udfTransformerMemoryBudgetInMB
protected final float udfTransformerMemoryBudgetInMB
-
udfCollectorMemoryBudgetInMB
protected final float udfCollectorMemoryBudgetInMB
-
operatorContext
protected final OperatorContext operatorContext
-
inputOperator
protected final Operator inputOperator
-
keepNull
protected final boolean keepNull
-
inputLayer
protected QueryDataSetInputLayer inputLayer
-
udtfContext
protected UDTFContext udtfContext
-
transformers
protected LayerPointReader[] transformers
-
outputDataTypes
protected java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> outputDataTypes
-
timeHeap
protected TimeSelector timeHeap
-
shouldIterateReadersToNextValid
protected boolean[] shouldIterateReadersToNextValid
-
-
Constructor Detail
-
TransformOperator
public TransformOperator(OperatorContext operatorContext, Operator inputOperator, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> inputDataTypes, java.util.Map<java.lang.String,java.util.List<InputLocation>> inputLocations, Expression[] outputExpressions, boolean keepNull, java.time.ZoneId zoneId, TypeProvider typeProvider, boolean isAscending) throws QueryProcessException, java.io.IOException
- Throws:
QueryProcessExceptionjava.io.IOException
-
-
Method Detail
-
initTransformers
protected void initTransformers(java.util.Map<java.lang.String,java.util.List<InputLocation>> inputLocations, Expression[] outputExpressions, TypeProvider typeProvider) throws QueryProcessException, java.io.IOException
- Throws:
QueryProcessExceptionjava.io.IOException
-
iterateAllColumnsToNextValid
protected YieldableState iterateAllColumnsToNextValid() throws QueryProcessException, java.io.IOException
- Throws:
QueryProcessExceptionjava.io.IOException
-
iterateReaderToNextValid
protected YieldableState iterateReaderToNextValid(LayerPointReader reader) throws QueryProcessException, java.io.IOException
- Throws:
QueryProcessExceptionjava.io.IOException
-
hasNext
public final 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.
-
collectReaderAppendIsNull
protected boolean collectReaderAppendIsNull(LayerPointReader reader, long currentTime) throws QueryProcessException, java.io.IOException
- Throws:
QueryProcessExceptionjava.io.IOException
-
collectDataPoint
protected YieldableState collectDataPoint(LayerPointReader reader, org.apache.iotdb.tsfile.read.common.block.column.ColumnBuilder writer, long currentTime, int readerIndex) throws QueryProcessException, java.io.IOException
- Throws:
QueryProcessExceptionjava.io.IOException
-
close
public void close() throws java.lang.ExceptionDescription copied from interface:OperatorThis method will always be called before releasing the Operator reference.
-
isBlocked
public com.google.common.util.concurrent.ListenableFuture<?> isBlocked()
Description copied from interface:OperatorReturns a future that will be completed when the operator becomes unblocked. If the operator is not blocked, this method should returnNOT_BLOCKED.
-
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
-
getOperatorContext
public OperatorContext getOperatorContext()
- Specified by:
getOperatorContextin interfaceOperator
-
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
-
-