Class DeferableBucketAggregator

All Implemented Interfaces:, java.lang.AutoCloseable,, Releasable
Direct Known Subclasses:
AbstractRareTermsAggregator, SamplerAggregator, TermsAggregator, VariableWidthHistogramAggregator

public abstract class DeferableBucketAggregator
extends BucketsAggregator
  • Constructor Details

    • DeferableBucketAggregator

      protected DeferableBucketAggregator​(java.lang.String name, AggregatorFactories factories, AggregationContext context, Aggregator parent, java.util.Map<java.lang.String,​java.lang.Object> metadata) throws
  • Method Details

    • doPreCollection

      protected void doPreCollection() throws
      Description copied from class: AggregatorBase
      Can be overridden by aggregator implementation to be called back when the collection phase starts.
      doPreCollection in class AggregatorBase
    • deferringCollector

      protected DeferringBucketCollector deferringCollector()
      Get the deferring collector.
    • buildDeferringCollector

      protected DeferringBucketCollector buildDeferringCollector()
      Build the DeferringBucketCollector. The default implementation replays all hits against the buckets selected by {#link DeferringBucketCollector.prepareSelectedBuckets(long...).
    • shouldDefer

      protected boolean shouldDefer​(Aggregator aggregator)
      This method should be overridden by subclasses that want to defer calculation of a child aggregation until a first pass is complete and a set of buckets has been pruned.
      aggregator - the child aggregator
      true if the aggregator should be deferred until a first pass at collection has completed
    • prepareSubAggs

      protected final void prepareSubAggs​(long[] bucketOrdsToCollect) throws
      Description copied from class: BucketsAggregator
      Hook to allow taking an action before building the sub agg results.
      prepareSubAggs in class BucketsAggregator
    • collectDebugInfo

      public void collectDebugInfo​(java.util.function.BiConsumer<java.lang.String,​java.lang.Object> add)
      Description copied from class: Aggregator
      Collect debug information to add to the profiling results. This will only be called if the aggregation is being profiled.

      Well behaved implementations will always call the superclass implementation just in case it has something interesting. They will also only add objects which can be serialized with StreamOutput.writeGenericValue(Object) and XContentBuilder.value(Object). And they'll have an integration test.

      collectDebugInfo in class Aggregator