Class MetricsAggregator
java.lang.Object
org.opensearch.search.aggregations.BucketCollector
org.opensearch.search.aggregations.Aggregator
org.opensearch.search.aggregations.AggregatorBase
org.opensearch.search.aggregations.metrics.MetricsAggregator
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.lucene.search.Collector
,org.opensearch.common.lease.Releasable
- Direct Known Subclasses:
NumericMetricsAggregator
Base aggregator to aggregate all docs into a single metric
- Opensearch.internal:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensearch.search.aggregations.Aggregator
Aggregator.BucketComparator, Aggregator.Parser, Aggregator.SubAggCollectionMode
-
Field Summary
Fields inherited from class org.opensearch.search.aggregations.AggregatorBase
collectableSubAggregators, context, DEFAULT_WEIGHT, name, parent, subAggregators
Fields inherited from class org.opensearch.search.aggregations.BucketCollector
NO_OP_COLLECTOR
-
Constructor Summary
ModifierConstructorDescriptionprotected
MetricsAggregator
(String name, SearchContext context, Aggregator parent, Map<String, Object> metadata) -
Method Summary
Modifier and TypeMethodDescriptionabstract InternalAggregation
buildAggregation
(long owningBucketOrd) Build an aggregation for data that has been collected intoowningBucketOrd
.final InternalAggregation[]
buildAggregations
(long[] owningBucketOrds) Build the results of this aggregation.Methods inherited from class org.opensearch.search.aggregations.AggregatorBase
addRequestCircuitBreakerBytes, buildEmptySubAggregations, close, context, doClose, doPostCollection, doPreCollection, getLeafCollector, getLeafCollector, metadata, name, parent, pointReaderIfAvailable, postCollection, preCollection, preGetSubLeafCollectors, scoreMode, subAggregator, subAggregators, toString
Methods inherited from class org.opensearch.search.aggregations.Aggregator
bucketComparator, buildEmptyAggregation, buildTopLevel, collectDebugInfo, getPostCollectionAggregation, resolveSortPath, resolveSortPathOnValidAgg
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.lucene.search.Collector
setWeight
-
Constructor Details
-
MetricsAggregator
protected MetricsAggregator(String name, SearchContext context, Aggregator parent, Map<String, Object> metadata) throws IOException- Throws:
IOException
-
-
Method Details
-
buildAggregation
Build an aggregation for data that has been collected intoowningBucketOrd
.- Throws:
IOException
-
buildAggregations
Description copied from class:Aggregator
Build the results of this aggregation.- Specified by:
buildAggregations
in classAggregator
- Parameters:
owningBucketOrds
- the ordinals of the buckets that we want to collect from this aggregation- Returns:
- the results for each ordinal, in the same order as the array of ordinals
- Throws:
IOException
-