Class DeferableBucketAggregator

All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable, org.apache.lucene.search.Collector, Releasable
Direct Known Subclasses:
AbstractRareTermsAggregator, SamplerAggregator, TermsAggregator

public abstract class DeferableBucketAggregator
extends BucketsAggregator
  • Constructor Details

  • Method Details

    • doPreCollection

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

      public static boolean descendsFromGlobalAggregator​(Aggregator parent)
    • getDeferringCollector

      public DeferringBucketCollector getDeferringCollector()
    • 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. Deferring collection will require the recording of all doc/bucketIds from the first pass and then the sub class should call runDeferredCollections(long...) for the selected set of buckets that survive the pruning.
      Parameters:
      aggregator - the child aggregator
      Returns:
      true if the aggregator should be deferred until a first pass at collection has completed
    • runDeferredCollections

      protected final void runDeferredCollections​(long... bucketOrds) throws java.io.IOException
      Throws:
      java.io.IOException