Package io.trino.operator.join
Class HashBuilderOperator
java.lang.Object
io.trino.operator.join.HashBuilderOperator
- All Implemented Interfaces:
Operator,AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Field Summary
Fields inherited from interface io.trino.operator.Operator
NOT_BLOCKED -
Constructor Summary
ConstructorsConstructorDescriptionHashBuilderOperator(OperatorContext operatorContext, PartitionedLookupSourceFactory lookupSourceFactory, int partitionIndex, List<Integer> outputChannels, List<Integer> hashChannels, OptionalInt preComputedHashChannel, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, Optional<Integer> sortChannel, List<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> searchFunctionFactories, int expectedPositions, PagesIndex.Factory pagesIndexFactory, boolean spillEnabled, SingleStreamSpillerFactory singleStreamSpillerFactory, HashArraySizeSupplier hashArraySizeSupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an input page to the operator.voidclose()This method will always be called before releasing the Operator reference.voidfinish()Notifies the operator that no more pages will be added and the operator should finish processing and flush results.voidClean up and release resources after completed memory revoking.Gets an output page from the operator.getState()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.com.google.common.util.concurrent.ListenableFuture<Void> After calling this method operator should revoke all reserved revocable memory.
-
Constructor Details
-
HashBuilderOperator
public HashBuilderOperator(OperatorContext operatorContext, PartitionedLookupSourceFactory lookupSourceFactory, int partitionIndex, List<Integer> outputChannels, List<Integer> hashChannels, OptionalInt preComputedHashChannel, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, Optional<Integer> sortChannel, List<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> searchFunctionFactories, int expectedPositions, PagesIndex.Factory pagesIndexFactory, boolean spillEnabled, SingleStreamSpillerFactory singleStreamSpillerFactory, HashArraySizeSupplier hashArraySizeSupplier)
-
-
Method Details
-
getOperatorContext
- Specified by:
getOperatorContextin interfaceOperator
-
getState
-
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. -
startMemoryRevoke
Description copied from interface:OperatorAfter calling this method operator should revoke all reserved revocable memory. As soon as memory is revoked returned future should be marked as done.Spawned threads cannot modify OperatorContext because it's not thread safe. For this purpose implement
Operator.finishMemoryRevoke()Since memory revoking signal is delivered asynchronously to the Operator, implementation must gracefully handle the case when there no longer is any revocable memory allocated.
After this method is called on Operator the Driver is disallowed to call most of processing methods on it (
Operator.isBlocked()/Operator.needsInput()/Operator.addInput(Page)/Operator.getOutput()) untilOperator.finishMemoryRevoke()is called.Operator.finish()is the only processing method that can be called during that time andOperator.close()remains callable at any time.- Specified by:
startMemoryRevokein interfaceOperator
-
finishMemoryRevoke
public void finishMemoryRevoke()Description copied from interface:OperatorClean up and release resources after completed memory revoking. Called by driver once future returned by startMemoryRevoke is completed.- Specified by:
finishMemoryRevokein interfaceOperator
-
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
public void close()Description copied from interface:OperatorThis method will always be called before releasing the Operator reference.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceOperator
-