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
FieldsFields inherited from class org.opensearch.search.aggregations.BucketCollector
NO_OP_COLLECTOR -
Constructor Summary
ConstructorsConstructorDescriptionCountingAggregator(AtomicInteger collectCounter, org.opensearch.search.aggregations.Aggregator delegate) -
Method Summary
Modifier and TypeMethodDescriptionorg.opensearch.search.aggregations.InternalAggregation[]buildAggregations(long[] owningBucketOrds) org.opensearch.search.aggregations.InternalAggregationvoidclose()org.opensearch.search.internal.SearchContextcontext()org.opensearch.search.aggregations.LeafBucketCollectorgetLeafCollector(org.apache.lucene.index.LeafReaderContext ctx) org.opensearch.search.aggregations.LeafBucketCollectorname()org.opensearch.search.aggregations.Aggregatorparent()voidvoidorg.apache.lucene.search.ScoreModevoidsetWeight(org.apache.lucene.search.Weight weight) org.opensearch.search.aggregations.AggregatorsubAggregator(String name) Methods inherited from class org.opensearch.search.aggregations.Aggregator
bucketComparator, buildTopLevel, buildTopLevelBatch, collectDebugInfo, getPostCollectionAggregation, resolveSortPath, resolveSortPathOnValidAggMethods inherited from class org.opensearch.search.aggregations.BucketCollector
reset
-
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
-
getSelectedCollector
public org.opensearch.search.aggregations.LeafBucketCollector getSelectedCollector() -
close
public void close() -
name
- Specified by:
namein classorg.opensearch.search.aggregations.Aggregator
-
context
public org.opensearch.search.internal.SearchContext context()- Specified by:
contextin classorg.opensearch.search.aggregations.Aggregator
-
parent
public org.opensearch.search.aggregations.Aggregator parent()- Specified by:
parentin classorg.opensearch.search.aggregations.Aggregator
-
subAggregator
- Specified by:
subAggregatorin classorg.opensearch.search.aggregations.Aggregator
-
buildAggregations
public org.opensearch.search.aggregations.InternalAggregation[] buildAggregations(long[] owningBucketOrds) throws IOException - Specified by:
buildAggregationsin classorg.opensearch.search.aggregations.Aggregator- Throws:
IOException
-
buildEmptyAggregation
public org.opensearch.search.aggregations.InternalAggregation buildEmptyAggregation()- Specified by:
buildEmptyAggregationin classorg.opensearch.search.aggregations.Aggregator
-
getLeafCollector
public org.opensearch.search.aggregations.LeafBucketCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx) throws IOException - Specified by:
getLeafCollectorin interfaceorg.apache.lucene.search.Collector- Specified by:
getLeafCollectorin classorg.opensearch.search.aggregations.BucketCollector- Throws:
IOException
-
scoreMode
public org.apache.lucene.search.ScoreMode scoreMode() -
preCollection
- Specified by:
preCollectionin classorg.opensearch.search.aggregations.BucketCollector- Throws:
IOException
-
postCollection
- Specified by:
postCollectionin classorg.opensearch.search.aggregations.BucketCollector- Throws:
IOException
-
setWeight
public void setWeight(org.apache.lucene.search.Weight weight)
-