public class DeferringBucketCollector extends BucketCollector implements Releasable
RecordingBucketCollector is to allow
the possibility of alternative recorder impl choices while keeping the logic in here for
setting AggregationContext's setNextReader method and preparing the appropriate choice
of filtering logic for stream replay. These felt like agg-specific functions that should be kept away
from the RecordingBucketCollector impl which is concentrated on efficient storage of doc and bucket IDsBucketCollector.BucketAnalysisCollectorNO_OP_COLLECTOR| Constructor and Description |
|---|
DeferringBucketCollector(BucketCollector deferred,
AggregationContext context) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
collect(int docId,
long bucketOrdinal)
Called during the query phase, to collect & aggregate the given document.
|
void |
gatherAnalysis(BucketCollector.BucketAnalysisCollector analysisCollector,
long bucketOrdinal)
Called post-collection to gather the results from surviving buckets.
|
void |
postCollection()
Post collection callback.
|
void |
prepareSelectedBuckets(long... survivingBucketOrds)
Plays a selection of the data cached from previous collect calls to the
deferred collector.
|
void |
setNextReader(org.apache.lucene.index.AtomicReaderContext reader) |
wrappublic DeferringBucketCollector(BucketCollector deferred, AggregationContext context)
public void setNextReader(org.apache.lucene.index.AtomicReaderContext reader)
setNextReader in interface ReaderContextAwarepublic void collect(int docId,
long bucketOrdinal)
throws IOException
BucketCollectorcollect in class BucketCollectorbucketOrdinal - The ordinal of the bucket this aggregator belongs to, assuming this aggregator is not a top level aggregator.
Typically, aggregators with #bucketAggregationMode set to Aggregator.BucketAggregationMode.MULTI_BUCKETS
will heavily depend on this ordinal. Other aggregators may or may not use it and can see this ordinal as just
an extra information for the aggregation context. For top level aggregators, the ordinal will always be
equal to 0.IOExceptionpublic void postCollection()
throws IOException
BucketCollectorpostCollection in class BucketCollectorIOExceptionpublic void prepareSelectedBuckets(long... survivingBucketOrds)
survivingBucketOrds - the valid bucket ords for which deferred collection should be
attemptedpublic void close()
throws ElasticsearchException
close in interface AutoCloseableclose in interface ReleasableElasticsearchExceptionpublic void gatherAnalysis(BucketCollector.BucketAnalysisCollector analysisCollector, long bucketOrdinal)
BucketCollectorgatherAnalysis in class BucketCollectorCopyright © 2009–2016. All rights reserved.