Class InMemoryHashAggregationBuilder
- java.lang.Object
-
- io.prestosql.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()
void
close()
void
finishMemoryRevoke()
int
getCapacity()
double
getExpectedHashCollisions()
long
getGroupCount()
long
getGroupIdsSortingSize()
building hash sorted results requires memory for sorting group IDs.long
getHashCollisions()
int
getKeyChannels()
long
getSizeInMemory()
boolean
isFull()
Work<?>
processPage(Page page)
void
recordHashCollisions(HashCollisionsCounter hashCollisionsCounter)
void
setOutputPartial()
com.google.common.util.concurrent.ListenableFuture<?>
startMemoryRevoke()
static List<Type>
toTypes(List<? extends Type> groupByType, AggregationNode.Step step, List<AccumulatorFactory> factories, Optional<Integer> hashChannel)
void
updateMemory()
-
-
-
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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceHashAggregationBuilder
-
processPage
public Work<?> processPage(Page page)
- Specified by:
processPage
in interfaceHashAggregationBuilder
-
updateMemory
public void updateMemory()
- Specified by:
updateMemory
in interfaceHashAggregationBuilder
-
isFull
public boolean isFull()
- Specified by:
isFull
in interfaceHashAggregationBuilder
-
recordHashCollisions
public void recordHashCollisions(HashCollisionsCounter hashCollisionsCounter)
- Specified by:
recordHashCollisions
in interfaceHashAggregationBuilder
-
getHashCollisions
public long getHashCollisions()
-
getExpectedHashCollisions
public double getExpectedHashCollisions()
-
startMemoryRevoke
public com.google.common.util.concurrent.ListenableFuture<?> startMemoryRevoke()
- Specified by:
startMemoryRevoke
in interfaceHashAggregationBuilder
-
finishMemoryRevoke
public void finishMemoryRevoke()
- Specified by:
finishMemoryRevoke
in 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:
buildResult
in 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)
-
-