Class BucketsAggregator

All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable, org.apache.lucene.search.Collector, Releasable
Direct Known Subclasses:
AdjacencyMatrixAggregator, BinaryRangeAggregator, DeferableBucketAggregator, FilterAggregator, FiltersAggregator, GeoGridAggregator, GlobalAggregator, MissingAggregator, NestedAggregator, RangeAggregator, RangeHistogramAggregator, ReverseNestedAggregator, SignificantTextAggregator

public abstract class BucketsAggregator
extends AggregatorBase
  • Constructor Details

  • Method Details

    • maxBucketOrd

      public final long maxBucketOrd()
      Return an upper bound of the maximum bucket ordinal seen so far.
    • grow

      public final void grow​(long maxBucketOrd)
      Ensure there are at least maxBucketOrd buckets available.
    • collectBucket

      public final void collectBucket​(LeafBucketCollector subCollector, int doc, long bucketOrd) throws java.io.IOException
      Utility method to collect the given doc in the given bucket (identified by the bucket ordinal)
      Throws:
      java.io.IOException
    • collectExistingBucket

      public final void collectExistingBucket​(LeafBucketCollector subCollector, int doc, long bucketOrd) throws java.io.IOException
      Same as collectBucket(LeafBucketCollector, int, long), but doesn't check if the docCounts needs to be re-sized.
      Throws:
      java.io.IOException
    • mergeBuckets

      public final void mergeBuckets​(long[] mergeMap, long newNumBuckets)
    • getDocCounts

      public IntArray getDocCounts()
    • incrementBucketDocCount

      public final void incrementBucketDocCount​(long bucketOrd, int inc)
      Utility method to increment the doc counts of the given bucket (identified by the bucket ordinal)
    • bucketDocCount

      public final int bucketDocCount​(long bucketOrd)
      Utility method to return the number of documents that fell in the given bucket (identified by the bucket ordinal)
    • consumeBucketsAndMaybeBreak

      protected final void consumeBucketsAndMaybeBreak​(int count)
      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
    • bucketAggregations

      protected final InternalAggregations bucketAggregations​(long bucket) throws java.io.IOException
      Required method to build the child aggregations of the given bucket (identified by the bucket ordinal).
      Throws:
      java.io.IOException
    • bucketEmptyAggregations

      protected final InternalAggregations bucketEmptyAggregations()
      Utility method to build empty aggregations of the sub aggregators.
    • close

      public final void close()
      Description copied from class: AggregatorBase
      Called upon release of the aggregator.
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable
      Specified by:
      close in interface Releasable
      Overrides:
      close in class AggregatorBase