Class InternalAggregation.ReduceContext
java.lang.Object
org.elasticsearch.search.aggregations.InternalAggregation.ReduceContext
- Enclosing class:
- InternalAggregation
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 responseforFinalReduction(BigArrays bigArrays, ScriptService scriptService, IntConsumer multiBucketConsumer, PipelineAggregator.PipelineTree pipelineTreeRoot)
Build a InternalAggregation.ReduceContext to perform the final reduction.forPartialReduction(BigArrays bigArrays, ScriptService scriptService, Supplier<PipelineAggregator.PipelineTree> pipelineTreeForBwcSerialization)
Build a InternalAggregation.ReduceContext to perform a partial reduction.boolean
Returnstrue
iff the current reduce phase is the final reduce phase.Supplies the pipelines when the result of the reduce is serialized to node versions that need pipeline aggregators to be serialized to them.The root of the tree of pipeline aggregations for this request.
-
Method Details
-
forPartialReduction
public static InternalAggregation.ReduceContext forPartialReduction(BigArrays bigArrays, ScriptService scriptService, Supplier<PipelineAggregator.PipelineTree> pipelineTreeForBwcSerialization)Build a InternalAggregation.ReduceContext to perform a partial reduction. -
forFinalReduction
public static InternalAggregation.ReduceContext forFinalReduction(BigArrays bigArrays, ScriptService scriptService, 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. -
pipelineTreeForBwcSerialization
Supplies the pipelines when the result of the reduce is serialized to node versions that need pipeline aggregators to be serialized to them. -
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
-