Module org.elasticsearch.compute
Interface GroupingAggregatorFunction
- All Superinterfaces:
AutoCloseable,Closeable,org.elasticsearch.core.Releasable
- All Known Implementing Classes:
CountGroupingAggregatorFunction,DimensionValuesByteRefGroupingAggregatorFunction,FirstDocIdGroupingAggregatorFunction,FromPartialGroupingAggregatorFunction,PresentGroupingAggregatorFunction,RateDoubleGroupingAggregatorFunction,RateIntGroupingAggregatorFunction,RateLongGroupingAggregatorFunction,ToPartialGroupingAggregatorFunction,WindowGroupingAggregatorFunction
public interface GroupingAggregatorFunction
extends org.elasticsearch.core.Releasable
Applies some grouping function like
min or avg to many values,
grouped into buckets.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceConsume group ids to cause theGroupingAggregatorFunctionto group values at a particular position into a particular group. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIntermediateInput(int positionOffset, IntArrayBlock groupIdVector, Page page) voidaddIntermediateInput(int positionOffset, IntBigArrayBlock groupIdVector, Page page) voidaddIntermediateInput(int positionOffset, IntVector groupIdVector, Page page) voidevaluateFinal(Block[] blocks, int offset, IntVector selected, GroupingAggregatorEvaluationContext evaluationContext) Build the final results for this aggregation.voidevaluateIntermediate(Block[] blocks, int offset, IntVector selected) Build the intermediate results for this aggregation.intThe number of blocks used by intermediate state.prepareProcessRawInputPage(SeenGroupIds seenGroupIds, Page page) Prepare to process a single page of raw input.voidselectedMayContainUnseenGroups(SeenGroupIds seenGroupIds) Call this to signal to the aggregation that theselectedparameter that's passed toevaluateIntermediate(org.elasticsearch.compute.data.Block[], int, org.elasticsearch.compute.data.IntVector)orevaluateFinal(org.elasticsearch.compute.data.Block[], int, org.elasticsearch.compute.data.IntVector, org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext)may reference groups that haven't been seen.Methods inherited from interface org.elasticsearch.core.Releasable
close
-
Method Details
-
prepareProcessRawInputPage
GroupingAggregatorFunction.AddInput prepareProcessRawInputPage(SeenGroupIds seenGroupIds, Page page) Prepare to process a single page of raw input.This should load the input
Blocks and check their types and select an optimal path and return that path as anGroupingAggregatorFunction.AddInput. -
selectedMayContainUnseenGroups
Call this to signal to the aggregation that theselectedparameter that's passed toevaluateIntermediate(org.elasticsearch.compute.data.Block[], int, org.elasticsearch.compute.data.IntVector)orevaluateFinal(org.elasticsearch.compute.data.Block[], int, org.elasticsearch.compute.data.IntVector, org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext)may reference groups that haven't been seen. This puts the underlying storage into a mode where it'll track which group ids have been seen, even if that increases the overhead. -
addIntermediateInput
-
addIntermediateInput
-
addIntermediateInput
-
evaluateIntermediate
Build the intermediate results for this aggregation.- Parameters:
selected- the groupIds that have been selected to be included in the results. Always ascending.
-
evaluateFinal
void evaluateFinal(Block[] blocks, int offset, IntVector selected, GroupingAggregatorEvaluationContext evaluationContext) Build the final results for this aggregation.- Parameters:
selected- the groupIds that have been selected to be included in the results. Always ascending.This function is called in the coordinator node after all intermediate results have been gathered from the worker nodes, and aggregated into intermediate blocks.
-
intermediateBlockCount
int intermediateBlockCount()The number of blocks used by intermediate state.
-