public abstract class BucketsAggregator extends AggregatorBase
Aggregator.Parser, Aggregator.SubAggCollectionModecollectableSubAggregators, context, DEFAULT_WEIGHT, name, parent, subAggregatorsNO_OP_COLLECTOR| Constructor and Description |
|---|
BucketsAggregator(java.lang.String name,
AggregatorFactories factories,
SearchContext context,
Aggregator parent,
java.util.List<PipelineAggregator> pipelineAggregators,
java.util.Map<java.lang.String,java.lang.Object> metaData) |
| Modifier and Type | Method and Description |
|---|---|
protected InternalAggregations |
bucketAggregations(long bucket)
Required method to build the child aggregations of the given bucket (identified by the bucket ordinal).
|
int |
bucketDocCount(long bucketOrd)
Utility method to return the number of documents that fell in the given bucket (identified by the bucket ordinal)
|
protected InternalAggregations |
bucketEmptyAggregations()
Utility method to build empty aggregations of the sub aggregators.
|
void |
close()
Called upon release of the aggregator.
|
void |
collectBucket(LeafBucketCollector subCollector,
int doc,
long bucketOrd)
Utility method to collect the given doc in the given bucket (identified by the bucket ordinal)
|
void |
collectExistingBucket(LeafBucketCollector subCollector,
int doc,
long bucketOrd)
Same as
collectBucket(LeafBucketCollector, int, long), but doesn't check if the docCounts needs to be re-sized. |
IntArray |
getDocCounts() |
void |
grow(long maxBucketOrd)
Ensure there are at least
maxBucketOrd buckets available. |
void |
incrementBucketDocCount(long bucketOrd,
int inc)
Utility method to increment the doc counts of the given bucket (identified by the bucket ordinal)
|
long |
maxBucketOrd()
Return an upper bound of the maximum bucket ordinal seen so far.
|
addRequestCircuitBreakerBytes, buildEmptySubAggregations, context, doClose, doPostCollection, doPreCollection, getLeafCollector, getLeafCollector, metaData, name, needsScores, parent, pipelineAggregators, postCollection, preCollection, subAggregator, subAggregators, toStringbuildAggregation, buildEmptyAggregation, descendsFromBucketAggregatorwrappublic BucketsAggregator(java.lang.String name,
AggregatorFactories factories,
SearchContext context,
Aggregator parent,
java.util.List<PipelineAggregator> pipelineAggregators,
java.util.Map<java.lang.String,java.lang.Object> metaData)
throws java.io.IOException
java.io.IOExceptionpublic final long maxBucketOrd()
public final void grow(long maxBucketOrd)
maxBucketOrd buckets available.public final void collectBucket(LeafBucketCollector subCollector, int doc, long bucketOrd) throws java.io.IOException
java.io.IOExceptionpublic final void collectExistingBucket(LeafBucketCollector subCollector, int doc, long bucketOrd) throws java.io.IOException
collectBucket(LeafBucketCollector, int, long), but doesn't check if the docCounts needs to be re-sized.java.io.IOExceptionpublic IntArray getDocCounts()
public final void incrementBucketDocCount(long bucketOrd,
int inc)
public final int bucketDocCount(long bucketOrd)
protected final InternalAggregations bucketAggregations(long bucket) throws java.io.IOException
java.io.IOExceptionprotected final InternalAggregations bucketEmptyAggregations()
public final void close()
AggregatorBaseclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface Releasableclose in class AggregatorBase