Class InMemoryHashAggregationBuilder
- java.lang.Object
-
- io.trino.operator.aggregation.builder.InMemoryHashAggregationBuilder
-
- All Implemented Interfaces:
HashAggregationBuilder,AutoCloseable
public class InMemoryHashAggregationBuilder extends Object implements HashAggregationBuilder
-
-
Constructor Summary
Constructors Constructor Description InMemoryHashAggregationBuilder(List<AccumulatorFactory> accumulatorFactories, AggregationNode.Step step, int expectedGroups, List<Type> groupByTypes, List<Integer> groupByChannels, Optional<Integer> hashChannel, OperatorContext operatorContext, Optional<io.airlift.units.DataSize> maxPartialMemory, JoinCompiler joinCompiler, BlockTypeOperators blockTypeOperators, UpdateMemory updateMemory)InMemoryHashAggregationBuilder(List<AccumulatorFactory> accumulatorFactories, AggregationNode.Step step, int expectedGroups, List<Type> groupByTypes, List<Integer> groupByChannels, Optional<Integer> hashChannel, OperatorContext operatorContext, Optional<io.airlift.units.DataSize> maxPartialMemory, Optional<Integer> overwriteIntermediateChannelOffset, JoinCompiler joinCompiler, BlockTypeOperators blockTypeOperators, UpdateMemory updateMemory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkProcessor<Page>buildHashSortedResult()List<Type>buildIntermediateTypes()WorkProcessor<Page>buildResult()List<Type>buildTypes()voidclose()voidfinishMemoryRevoke()intgetCapacity()doublegetExpectedHashCollisions()longgetGroupCount()longgetGroupIdsSortingSize()building hash sorted results requires memory for sorting group IDs.longgetHashCollisions()intgetKeyChannels()longgetSizeInMemory()booleanisFull()Work<?>processPage(Page page)voidrecordHashCollisions(HashCollisionsCounter hashCollisionsCounter)voidsetOutputPartial()com.google.common.util.concurrent.ListenableFuture<?>startMemoryRevoke()static List<Type>toTypes(List<? extends Type> groupByType, AggregationNode.Step step, List<AccumulatorFactory> factories, Optional<Integer> hashChannel)voidupdateMemory()
-
-
-
Constructor Detail
-
InMemoryHashAggregationBuilder
public InMemoryHashAggregationBuilder(List<AccumulatorFactory> accumulatorFactories, AggregationNode.Step step, int expectedGroups, List<Type> groupByTypes, List<Integer> groupByChannels, Optional<Integer> hashChannel, OperatorContext operatorContext, Optional<io.airlift.units.DataSize> maxPartialMemory, JoinCompiler joinCompiler, BlockTypeOperators blockTypeOperators, UpdateMemory updateMemory)
-
InMemoryHashAggregationBuilder
public InMemoryHashAggregationBuilder(List<AccumulatorFactory> accumulatorFactories, AggregationNode.Step step, int expectedGroups, List<Type> groupByTypes, List<Integer> groupByChannels, Optional<Integer> hashChannel, OperatorContext operatorContext, Optional<io.airlift.units.DataSize> maxPartialMemory, Optional<Integer> overwriteIntermediateChannelOffset, JoinCompiler joinCompiler, BlockTypeOperators blockTypeOperators, UpdateMemory updateMemory)
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceHashAggregationBuilder
-
processPage
public Work<?> processPage(Page page)
- Specified by:
processPagein interfaceHashAggregationBuilder
-
updateMemory
public void updateMemory()
- Specified by:
updateMemoryin interfaceHashAggregationBuilder
-
isFull
public boolean isFull()
- Specified by:
isFullin interfaceHashAggregationBuilder
-
recordHashCollisions
public void recordHashCollisions(HashCollisionsCounter hashCollisionsCounter)
- Specified by:
recordHashCollisionsin interfaceHashAggregationBuilder
-
getHashCollisions
public long getHashCollisions()
-
getExpectedHashCollisions
public double getExpectedHashCollisions()
-
startMemoryRevoke
public com.google.common.util.concurrent.ListenableFuture<?> startMemoryRevoke()
- Specified by:
startMemoryRevokein interfaceHashAggregationBuilder
-
finishMemoryRevoke
public void finishMemoryRevoke()
- Specified by:
finishMemoryRevokein interfaceHashAggregationBuilder
-
getSizeInMemory
public long getSizeInMemory()
-
getGroupIdsSortingSize
public long getGroupIdsSortingSize()
building hash sorted results requires memory for sorting group IDs. This method returns size of that memory requirement.
-
setOutputPartial
public void setOutputPartial()
-
getKeyChannels
public int getKeyChannels()
-
getGroupCount
public long getGroupCount()
-
buildResult
public WorkProcessor<Page> buildResult()
- Specified by:
buildResultin interfaceHashAggregationBuilder
-
buildHashSortedResult
public WorkProcessor<Page> buildHashSortedResult()
-
getCapacity
public int getCapacity()
-
toTypes
public static List<Type> toTypes(List<? extends Type> groupByType, AggregationNode.Step step, List<AccumulatorFactory> factories, Optional<Integer> hashChannel)
-
-