Module org.elasticsearch.compute
Class CountGroupingAggregatorFunction
java.lang.Object
org.elasticsearch.compute.aggregation.CountGroupingAggregatorFunction
- All Implemented Interfaces:
Closeable,AutoCloseable,GroupingAggregatorFunction,org.elasticsearch.core.Releasable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.compute.aggregation.GroupingAggregatorFunction
GroupingAggregatorFunction.AddInput -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIntermediateInput(int positionOffset, IntVector groups, Page page) voidaddIntermediateRowInput(int groupId, GroupingAggregatorFunction input, int position) Add the position-th row from the intermediate output of the given aggregator function to the groupIdvoidclose()create(DriverContext driverContext, List<Integer> inputChannels) voidevaluateFinal(Block[] blocks, int offset, IntVector selected, DriverContext driverContext) 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.static List<IntermediateStateDesc> prepareProcessPage(SeenGroupIds seenGroupIds, Page page) Prepare to process a single page of input.voidselectedMayContainUnseenGroups(SeenGroupIds seenGroupIds) Call this to signal to the aggregation that theselectedparameter that's passed toGroupingAggregatorFunction.evaluateIntermediate(org.elasticsearch.compute.data.Block[], int, org.elasticsearch.compute.data.IntVector)orGroupingAggregatorFunction.evaluateFinal(org.elasticsearch.compute.data.Block[], int, org.elasticsearch.compute.data.IntVector, org.elasticsearch.compute.operator.DriverContext)may reference groups that haven't been seen.toString()
-
Method Details
-
create
public static CountGroupingAggregatorFunction create(DriverContext driverContext, List<Integer> inputChannels) -
intermediateStateDesc
-
intermediateBlockCount
public int intermediateBlockCount()Description copied from interface:GroupingAggregatorFunctionThe number of blocks used by intermediate state.- Specified by:
intermediateBlockCountin interfaceGroupingAggregatorFunction
-
prepareProcessPage
Description copied from interface:GroupingAggregatorFunctionPrepare to process a single page of input.This should load the input
Blocks and check their types and select an optimal path and return that path as anGroupingAggregatorFunction.AddInput.- Specified by:
prepareProcessPagein interfaceGroupingAggregatorFunction
-
selectedMayContainUnseenGroups
Description copied from interface:GroupingAggregatorFunctionCall this to signal to the aggregation that theselectedparameter that's passed toGroupingAggregatorFunction.evaluateIntermediate(org.elasticsearch.compute.data.Block[], int, org.elasticsearch.compute.data.IntVector)orGroupingAggregatorFunction.evaluateFinal(org.elasticsearch.compute.data.Block[], int, org.elasticsearch.compute.data.IntVector, org.elasticsearch.compute.operator.DriverContext)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.- Specified by:
selectedMayContainUnseenGroupsin interfaceGroupingAggregatorFunction
-
addIntermediateInput
Description copied from interface:GroupingAggregatorFunctionAdd data produced byGroupingAggregatorFunction.evaluateIntermediate(org.elasticsearch.compute.data.Block[], int, org.elasticsearch.compute.data.IntVector).- Specified by:
addIntermediateInputin interfaceGroupingAggregatorFunction
-
addIntermediateRowInput
Description copied from interface:GroupingAggregatorFunctionAdd the position-th row from the intermediate output of the given aggregator function to the groupId- Specified by:
addIntermediateRowInputin interfaceGroupingAggregatorFunction
-
evaluateIntermediate
Description copied from interface:GroupingAggregatorFunctionBuild the intermediate results for this aggregation.- Specified by:
evaluateIntermediatein interfaceGroupingAggregatorFunction- Parameters:
selected- the groupIds that have been selected to be included in the results. Always ascending.
-
evaluateFinal
public void evaluateFinal(Block[] blocks, int offset, IntVector selected, DriverContext driverContext) Description copied from interface:GroupingAggregatorFunctionBuild the final results for this aggregation.- Specified by:
evaluateFinalin interfaceGroupingAggregatorFunction- Parameters:
selected- the groupIds that have been selected to be included in the results. Always ascending.
-
toString
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-