public class HashAggregationOperator extends Object implements Operator
| Modifier and Type | Class and Description |
|---|---|
static class |
HashAggregationOperator.HashAggregationOperatorFactory |
NOT_BLOCKED| Constructor and Description |
|---|
HashAggregationOperator(OperatorContext operatorContext,
List<Type> groupByTypes,
List<Integer> groupByChannels,
List<Integer> globalAggregationGroupIds,
AggregationNode.Step step,
boolean produceDefaultOutput,
List<AccumulatorFactory> accumulatorFactories,
Optional<Integer> hashChannel,
Optional<Integer> groupIdChannel,
int expectedGroups,
Optional<io.airlift.units.DataSize> maxPartialMemory,
boolean spillEnabled,
io.airlift.units.DataSize memoryLimitForMerge,
io.airlift.units.DataSize memoryLimitForMergeWithMemory,
SpillerFactory spillerFactory,
JoinCompiler joinCompiler,
boolean useSystemMemory) |
| 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.
|
HashAggregationBuilder |
getAggregationBuilder() |
OperatorContext |
getOperatorContext() |
Page |
getOutput()
Gets an output page from the operator.
|
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 HashAggregationOperator(OperatorContext operatorContext, List<Type> groupByTypes, List<Integer> groupByChannels, List<Integer> globalAggregationGroupIds, AggregationNode.Step step, boolean produceDefaultOutput, List<AccumulatorFactory> accumulatorFactories, Optional<Integer> hashChannel, Optional<Integer> groupIdChannel, int expectedGroups, Optional<io.airlift.units.DataSize> maxPartialMemory, boolean spillEnabled, io.airlift.units.DataSize memoryLimitForMerge, io.airlift.units.DataSize memoryLimitForMergeWithMemory, SpillerFactory spillerFactory, JoinCompiler joinCompiler, boolean useSystemMemory)
public OperatorContext getOperatorContext()
getOperatorContext in interface Operatorpublic void finish()
Operatorpublic boolean isFinished()
OperatorisFinished in interface Operatorpublic boolean needsInput()
OperatorneedsInput in interface Operatorpublic void addInput(Page page)
OperatorneedsInput() 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 Operatorpublic void finishMemoryRevoke()
OperatorfinishMemoryRevoke in interface Operatorpublic Page getOutput()
Operatorpublic void close()
Operatorclose in interface Operatorclose in interface AutoCloseablepublic HashAggregationBuilder getAggregationBuilder()
Copyright © 2012–2019. All rights reserved.