public abstract class BucketsAggregator extends AggregatorBase
Aggregator.Parser, Aggregator.SubAggCollectionMode
collectableSubAggregators, context, DEFAULT_WEIGHT, name, parent, subAggregators
NO_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.
|
buildEmptySubAggregations, context, doClose, doPostCollection, doPreCollection, getDeferringCollector, getLeafCollector, getLeafCollector, metaData, name, needsScores, parent, pipelineAggregators, postCollection, preCollection, runDeferredCollections, shouldDefer, subAggregator, subAggregators, toString
buildAggregation, buildEmptyAggregation, descendsFromBucketAggregator
wrap
public 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.IOException
public 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.IOException
public 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.IOException
public 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.IOException
protected final InternalAggregations bucketEmptyAggregations()
public final void close()
AggregatorBase
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface Releasable
close
in class AggregatorBase