Class AggregationReduceContext

java.lang.Object
org.elasticsearch.search.aggregations.AggregationReduceContext
Direct Known Subclasses:
AggregationReduceContext.ForFinal, AggregationReduceContext.ForPartial

public abstract sealed class AggregationReduceContext extends Object permits AggregationReduceContext.ForPartial, AggregationReduceContext.ForFinal
Dependencies used to reduce aggs.
  • Method Details

    • isFinalReduce

      public abstract boolean isFinalReduce()
      Returns true iff the current reduce phase is the final reduce phase. This indicates if operations like pipeline aggregations should be applied or if specific features like minDocCount should be taken into account. Operations that are potentially losing information can only be applied during the final reduce phase.
    • bigArrays

      public final BigArrays bigArrays()
    • scriptService

      public final ScriptService scriptService()
    • isCanceled

      public final Supplier<Boolean> isCanceled()
    • builder

      public AggregationBuilder builder()
      Builder for the agg being processed or null if this context was built for the top level or a pipeline aggregation.
    • pipelineTreeRoot

      public abstract PipelineAggregator.PipelineTree pipelineTreeRoot()
      The root of the tree of pipeline aggregations for this request.
    • consumeBucketsAndMaybeBreak

      public final void consumeBucketsAndMaybeBreak(int size)
      Adds count 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
    • consumeBucketCountAndMaybeBreak

      protected abstract void consumeBucketCountAndMaybeBreak(int size)
    • forAgg

      public final AggregationReduceContext forAgg(String name)
      Build a AggregationReduceContext for a sub-aggregation.
    • forSubAgg

      protected abstract AggregationReduceContext forSubAgg(AggregationBuilder sub)