Class DeferableBucketAggregator
java.lang.Object
org.elasticsearch.search.aggregations.BucketCollector
org.elasticsearch.search.aggregations.Aggregator
org.elasticsearch.search.aggregations.AggregatorBase
org.elasticsearch.search.aggregations.bucket.BucketsAggregator
org.elasticsearch.search.aggregations.bucket.DeferableBucketAggregator
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.lucene.search.Collector
,org.elasticsearch.core.Releasable
- Direct Known Subclasses:
AbstractRareTermsAggregator
,SamplerAggregator
,TermsAggregator
,VariableWidthHistogramAggregator
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator
BucketsAggregator.BucketBuilderForFixedCount<B>, BucketsAggregator.BucketBuilderForVariable<B>, BucketsAggregator.ResultBuilderForVariable<B>, BucketsAggregator.SingleBucketResultBuilder
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.Aggregator
Aggregator.BucketComparator, Aggregator.Parser, Aggregator.SubAggCollectionMode
-
Field Summary
Fields inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator
docCountProvider
Fields inherited from class org.elasticsearch.search.aggregations.AggregatorBase
collectableSubAggregators, DEFAULT_WEIGHT, name, parent, subAggregators
Fields inherited from class org.elasticsearch.search.aggregations.BucketCollector
NO_OP_COLLECTOR
-
Constructor Summary
ModifierConstructorDescriptionprotected
DeferableBucketAggregator(String name, AggregatorFactories factories, AggregationContext context, Aggregator parent, Map<String,Object> metadata)
-
Method Summary
Modifier and TypeMethodDescriptionprotected DeferringBucketCollector
Build theDeferringBucketCollector
.void
Collect debug information to add to the profiling results.protected DeferringBucketCollector
Get the deferring collector.protected void
Can be overridden by aggregator implementation to be called back when the collection phase starts.protected void
prepareSubAggs(long[] bucketOrdsToCollect)
Hook to allow taking an action before building the sub agg results.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.Methods inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator
bucketComparator, bucketDocCount, buildAggregationsForFixedBucketCount, buildAggregationsForSingleBucket, buildAggregationsForVariableBuckets, buildSubAggsForAllBuckets, buildSubAggsForBuckets, buildSubAggsForBuckets, close, collectBucket, collectExistingBucket, descendsFromGlobalAggregator, getDocCounts, grow, incrementBucketDocCount, maxBucketOrd, preGetSubLeafCollectors, resolveSortPath, rewriteBuckets
Methods inherited from class org.elasticsearch.search.aggregations.AggregatorBase
addRequestCircuitBreakerBytes, bigArrays, buildEmptySubAggregations, doClose, doPostCollection, getLeafCollector, getLeafCollector, metadata, name, parent, pointReaderIfAvailable, postCollection, preCollection, scoreMode, searcher, subAggregator, subAggregators, topLevelQuery, toString
Methods inherited from class org.elasticsearch.search.aggregations.Aggregator
buildAggregations, buildEmptyAggregation, buildTopLevel, resolveSortPathOnValidAgg
-
Constructor Details
-
DeferableBucketAggregator
protected DeferableBucketAggregator(String name, AggregatorFactories factories, AggregationContext context, Aggregator parent, Map<String,Object> metadata) throws IOException- Throws:
IOException
-
-
Method Details
-
doPreCollection
Description copied from class:AggregatorBase
Can be overridden by aggregator implementation to be called back when the collection phase starts.- Overrides:
doPreCollection
in classAggregatorBase
- Throws:
IOException
-
deferringCollector
Get the deferring collector. -
buildDeferringCollector
Build theDeferringBucketCollector
. The default implementation replays all hits against the buckets selected by {#linkDeferringBucketCollector.prepareSelectedBuckets(long...)
. -
shouldDefer
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.- Parameters:
aggregator
- the child aggregator- Returns:
- true if the aggregator should be deferred until a first pass at collection has completed
-
prepareSubAggs
Description copied from class:BucketsAggregator
Hook to allow taking an action before building the sub agg results.- Overrides:
prepareSubAggs
in classBucketsAggregator
- Throws:
IOException
-
collectDebugInfo
Description copied from class:Aggregator
Collect debug information to add to the profiling results. This will only be called if the aggregation is being profiled.Well behaved implementations will always call the superclass implementation just in case it has something interesting. They will also only add objects which can be serialized with
StreamOutput.writeGenericValue(Object)
andXContentBuilder.value(Object)
. And they'll have an integration test.- Overrides:
collectDebugInfo
in classAggregator
-