Package io.trino.operator
Class WorkProcessorOperatorAdapter
java.lang.Object
io.trino.operator.WorkProcessorOperatorAdapter
- All Implemented Interfaces:
Operator,AutoCloseable
This
WorkProcessorOperator adapter allows to adapt WorkProcessor operators
that require customization of input handling (e.g. aggregation operators that want to skip extra
buffering step or operators that require more sophisticated initial blocking condition).
If such customization is not required, it's recommended to use BasicWorkProcessorOperatorAdapter
instead.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Field Summary
Fields inherited from interface io.trino.operator.Operator
NOT_BLOCKED -
Constructor Summary
ConstructorsConstructorDescriptionWorkProcessorOperatorAdapter(OperatorContext operatorContext, WorkProcessorOperatorAdapter.AdapterWorkProcessorOperatorFactory workProcessorOperatorFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an input page to the operator.voidclose()This method will always be called before releasing the Operator reference.static OperatorFactorycreateAdapterOperatorFactory(WorkProcessorOperatorAdapter.AdapterWorkProcessorOperatorFactory operatorFactory) voidfinish()Notifies the operator that no more pages will be added and the operator should finish processing and flush results.Gets an output page from the operator.com.google.common.util.concurrent.ListenableFuture<Void> Returns a future that will be completed when the operator becomes unblocked.booleanIs this operator completely finished processing and no more output pages will be produced.booleanReturns true if and only if this operator can accept an input page.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.trino.operator.Operator
finishMemoryRevoke, startMemoryRevoke
-
Constructor Details
-
WorkProcessorOperatorAdapter
public WorkProcessorOperatorAdapter(OperatorContext operatorContext, WorkProcessorOperatorAdapter.AdapterWorkProcessorOperatorFactory workProcessorOperatorFactory)
-
-
Method Details
-
createAdapterOperatorFactory
public static OperatorFactory createAdapterOperatorFactory(WorkProcessorOperatorAdapter.AdapterWorkProcessorOperatorFactory operatorFactory) -
getOperatorContext
- Specified by:
getOperatorContextin interfaceOperator
-
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. -
needsInput
public boolean needsInput()Description copied from interface:OperatorReturns true if and only if this operator can accept an input page.- Specified by:
needsInputin interfaceOperator
-
addInput
Description copied from interface:OperatorAdds an input page to the operator. This method will only be called ifneedsInput()returns true. -
getOutput
Description copied from interface:OperatorGets an output page from the operator. If no output data is currently available, return null. -
finish
public void finish()Description copied from interface:OperatorNotifies the operator that no more pages will be added and the operator should finish processing and flush results. This method will not be called if the Task is already failed or canceled. -
isFinished
public boolean isFinished()Description copied from interface:OperatorIs this operator completely finished processing and no more output pages will be produced.- Specified by:
isFinishedin interfaceOperator
-
close
Description copied from interface:OperatorThis method will always be called before releasing the Operator reference.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceOperator- Throws:
Exception
-