Module org.elasticsearch.server
Class DelayedBucket<B extends InternalMultiBucketAggregation.InternalBucket>
java.lang.Object
org.elasticsearch.search.aggregations.DelayedBucket<B>
public final class DelayedBucket<B extends InternalMultiBucketAggregation.InternalBucket>
extends Object
A wrapper around reducing buckets with the same key that can delay that reduction
as long as possible. It's stateful and not even close to thread safe.
It is responsibility of the caller to account for buckets created using DelayedBucket.
It should call nonCompetitive(org.elasticsearch.search.aggregations.AggregationReduceContext)
to release any possible sub-bucket creation if
a bucket is rejected from the final response.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
Count the documents in the buckets.reduced
(BiFunction<List<B>, AggregationReduceContext, B> reduce, AggregationReduceContext reduceContext) The reduced bucket.toString()
-
Constructor Details
-
DelayedBucket
Build a delayed bucket.
-
-
Method Details
-
reduced
public B reduced(BiFunction<List<B>, AggregationReduceContext, B> reduce, AggregationReduceContext reduceContext) The reduced bucket. If the bucket hasn't been reduced already this will reduce the sub-aggs and throw out the list to reduce. -
getDocCount
public long getDocCount()Count the documents in the buckets. -
toString
-