Class InternalAggregation.ReduceContext
java.lang.Object
org.elasticsearch.search.aggregations.InternalAggregation.ReduceContext
- Enclosing class:
- InternalAggregation
public static class InternalAggregation.ReduceContext
extends java.lang.Object
-
Method Summary
Modifier and Type Method Description BigArrays
bigArrays()
void
consumeBucketsAndMaybeBreak(int size)
Addscount
buckets to the global count for the request and fails if this number is greater than the maximum number of buckets allowed in a responsestatic InternalAggregation.ReduceContext
forFinalReduction(BigArrays bigArrays, ScriptService scriptService, java.util.function.IntConsumer multiBucketConsumer, PipelineAggregator.PipelineTree pipelineTreeRoot)
Build a InternalAggregation.ReduceContext to perform the final reduction.static InternalAggregation.ReduceContext
forPartialReduction(BigArrays bigArrays, ScriptService scriptService)
Build a InternalAggregation.ReduceContext to perform a partial reduction.boolean
isFinalReduce()
Returnstrue
iff the current reduce phase is the final reduce phase.PipelineAggregator.PipelineTree
pipelineTreeRoot()
The root of the tree of pipeline aggregations for this request.ScriptService
scriptService()
-
Method Details
-
forPartialReduction
public static InternalAggregation.ReduceContext forPartialReduction(BigArrays bigArrays, ScriptService scriptService)Build a InternalAggregation.ReduceContext to perform a partial reduction. -
forFinalReduction
public static InternalAggregation.ReduceContext forFinalReduction(BigArrays bigArrays, ScriptService scriptService, java.util.function.IntConsumer multiBucketConsumer, PipelineAggregator.PipelineTree pipelineTreeRoot)Build a InternalAggregation.ReduceContext to perform the final reduction.- Parameters:
pipelineTreeRoot
- The root of tree of pipeline aggregations for this request
-
isFinalReduce
public boolean isFinalReduce()Returnstrue
iff the current reduce phase is the final reduce phase. This indicates if operations like pipeline aggregations should be applied or if specific features likeminDocCount
should be taken into account. Operations that are potentially losing information can only be applied during the final reduce phase. -
bigArrays
-
scriptService
-
pipelineTreeRoot
The root of the tree of pipeline aggregations for this request. -
consumeBucketsAndMaybeBreak
public void consumeBucketsAndMaybeBreak(int size)Addscount
buckets to the global count for the request and fails if this number is greater than the maximum number of buckets allowed in a response
-