@ThreadSafe public class HashBuilderOperator extends Object implements Operator
Modifier and Type | Class and Description |
---|---|
static class |
HashBuilderOperator.HashBuilderOperatorFactory |
static class |
HashBuilderOperator.State |
NOT_BLOCKED
Constructor and Description |
---|
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,
boolean enforceBroadcastMemoryLimit) |
Modifier and Type | Method and Description |
---|---|
void |
addInput(Page page)
Adds an input page to the operator.
|
void |
close()
This method will always be called before releasing the Operator reference.
|
void |
finish()
Notifies the operator that no more pages will be added and the
operator should finish processing and flush results.
|
void |
finishMemoryRevoke()
Clean up and release resources after completed memory revoking.
|
OperatorContext |
getOperatorContext() |
Page |
getOutput()
Gets an output page from the operator.
|
HashBuilderOperator.State |
getState() |
com.google.common.util.concurrent.ListenableFuture<?> |
isBlocked()
Returns a future that will be completed when the operator becomes
unblocked.
|
boolean |
isFinished()
Is this operator completely finished processing and no more
output pages will be produced.
|
boolean |
needsInput()
Returns true if and only if this operator can accept an input page.
|
com.google.common.util.concurrent.ListenableFuture<?> |
startMemoryRevoke()
After calling this method operator should revoke all reserved revocable memory.
|
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, boolean enforceBroadcastMemoryLimit)
public OperatorContext getOperatorContext()
getOperatorContext
in interface Operator
public HashBuilderOperator.State getState()
public com.google.common.util.concurrent.ListenableFuture<?> isBlocked()
Operator
NOT_BLOCKED
.public boolean needsInput()
Operator
needsInput
in interface Operator
public void addInput(Page page)
Operator
needsInput()
returns true.public com.google.common.util.concurrent.ListenableFuture<?> startMemoryRevoke()
Operator
Spawned threads can not 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 any
processing methods on it (isBlocked/needsInput/addInput/getOutput) until
Operator.finishMemoryRevoke()
is called.
startMemoryRevoke
in interface Operator
public void finishMemoryRevoke()
Operator
finishMemoryRevoke
in interface Operator
public Page getOutput()
Operator
public void finish()
Operator
public boolean isFinished()
Operator
isFinished
in interface Operator
public void close()
Operator
close
in interface Operator
close
in interface AutoCloseable
Copyright © 2012–2022. All rights reserved.