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.SingleBucketResultBuilderNested 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
docCountProviderFields inherited from class org.elasticsearch.search.aggregations.AggregatorBase
collectableSubAggregators, DEFAULT_WEIGHT, name, parent, subAggregatorsFields inherited from class org.elasticsearch.search.aggregations.BucketCollector
NO_OP_COLLECTOR -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeferableBucketAggregator(String name, AggregatorFactories factories, AggregationContext context, Aggregator parent, Map<String,Object> metadata) -
Method Summary
Modifier and TypeMethodDescriptionprotected DeferringBucketCollectorBuild theDeferringBucketCollector.voidCollect debug information to add to the profiling results.protected DeferringBucketCollectorGet the deferring collector.protected voidCan be overridden by aggregator implementation to be called back when the collection phase starts.protected voidprepareSubAggs(long[] bucketOrdsToCollect)Hook to allow taking an action before building the sub agg results.protected booleanshouldDefer(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, rewriteBucketsMethods 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, toStringMethods 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:AggregatorBaseCan be overridden by aggregator implementation to be called back when the collection phase starts.- Overrides:
doPreCollectionin 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:BucketsAggregatorHook to allow taking an action before building the sub agg results.- Overrides:
prepareSubAggsin classBucketsAggregator- Throws:
IOException
-
collectDebugInfo
Description copied from class:AggregatorCollect 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:
collectDebugInfoin classAggregator
-