Class AggregatorTestCase.CountingAggregator

java.lang.Object
org.opensearch.search.aggregations.BucketCollector
org.opensearch.search.aggregations.Aggregator
org.opensearch.search.aggregations.AggregatorTestCase.CountingAggregator
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.lucene.search.Collector, org.opensearch.common.lease.Releasable
Enclosing class:
AggregatorTestCase

protected static class AggregatorTestCase.CountingAggregator extends org.opensearch.search.aggregations.Aggregator
Wrapper around Aggregator class Maintains a count for times collect() is invoked - number of documents visited
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.opensearch.search.aggregations.Aggregator

    org.opensearch.search.aggregations.Aggregator.BucketComparator, org.opensearch.search.aggregations.Aggregator.Parser, org.opensearch.search.aggregations.Aggregator.SubAggCollectionMode
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final org.opensearch.search.aggregations.Aggregator
     

    Fields inherited from class org.opensearch.search.aggregations.BucketCollector

    NO_OP_COLLECTOR
  • Constructor Summary

    Constructors
    Constructor
    Description
    CountingAggregator(AtomicInteger collectCounter, org.opensearch.search.aggregations.Aggregator delegate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.opensearch.search.aggregations.InternalAggregation[]
    buildAggregations(long[] owningBucketOrds)
     
    org.opensearch.search.aggregations.InternalAggregation
     
    void
     
    org.opensearch.search.internal.SearchContext
     
     
    org.opensearch.search.aggregations.LeafBucketCollector
    getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx)
     
    org.opensearch.search.aggregations.LeafBucketCollector
     
     
    org.opensearch.search.aggregations.Aggregator
     
    void
     
    void
     
    org.apache.lucene.search.ScoreMode
     
    void
    setWeight(org.apache.lucene.search.Weight weight)
     
    org.opensearch.search.aggregations.Aggregator
     

    Methods inherited from class org.opensearch.search.aggregations.Aggregator

    bucketComparator, buildTopLevel, buildTopLevelBatch, collectDebugInfo, getPostCollectionAggregation, resolveSortPath, resolveSortPathOnValidAgg

    Methods inherited from class org.opensearch.search.aggregations.BucketCollector

    reset

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • delegate

      public final org.opensearch.search.aggregations.Aggregator delegate
  • Constructor Details

    • CountingAggregator

      public CountingAggregator(AtomicInteger collectCounter, org.opensearch.search.aggregations.Aggregator delegate)
  • Method Details

    • getCollectCount

      public AtomicInteger getCollectCount()
    • getSelectedCollector

      public org.opensearch.search.aggregations.LeafBucketCollector getSelectedCollector()
    • close

      public void close()
    • name

      public String name()
      Specified by:
      name in class org.opensearch.search.aggregations.Aggregator
    • context

      public org.opensearch.search.internal.SearchContext context()
      Specified by:
      context in class org.opensearch.search.aggregations.Aggregator
    • parent

      public org.opensearch.search.aggregations.Aggregator parent()
      Specified by:
      parent in class org.opensearch.search.aggregations.Aggregator
    • subAggregator

      public org.opensearch.search.aggregations.Aggregator subAggregator(String name)
      Specified by:
      subAggregator in class org.opensearch.search.aggregations.Aggregator
    • buildAggregations

      public org.opensearch.search.aggregations.InternalAggregation[] buildAggregations(long[] owningBucketOrds) throws IOException
      Specified by:
      buildAggregations in class org.opensearch.search.aggregations.Aggregator
      Throws:
      IOException
    • buildEmptyAggregation

      public org.opensearch.search.aggregations.InternalAggregation buildEmptyAggregation()
      Specified by:
      buildEmptyAggregation in class org.opensearch.search.aggregations.Aggregator
    • getLeafCollector

      public org.opensearch.search.aggregations.LeafBucketCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx) throws IOException
      Specified by:
      getLeafCollector in interface org.apache.lucene.search.Collector
      Specified by:
      getLeafCollector in class org.opensearch.search.aggregations.BucketCollector
      Throws:
      IOException
    • scoreMode

      public org.apache.lucene.search.ScoreMode scoreMode()
    • preCollection

      public void preCollection() throws IOException
      Specified by:
      preCollection in class org.opensearch.search.aggregations.BucketCollector
      Throws:
      IOException
    • postCollection

      public void postCollection() throws IOException
      Specified by:
      postCollection in class org.opensearch.search.aggregations.BucketCollector
      Throws:
      IOException
    • setWeight

      public void setWeight(org.apache.lucene.search.Weight weight)