java.io.Closeable
, java.lang.AutoCloseable
, Releasable
, SingleBucketAggregator
DiversifiedBytesHashSamplerAggregator
, DiversifiedMapSamplerAggregator
, DiversifiedNumericSamplerAggregator
, DiversifiedOrdinalsSamplerAggregator
public class SamplerAggregator extends DeferableBucketAggregator implements SingleBucketAggregator
Modifier and Type | Class | Description |
---|---|---|
static class |
SamplerAggregator.ExecutionMode |
Aggregator.Parser, Aggregator.SubAggCollectionMode
Modifier and Type | Field | Description |
---|---|---|
protected BestDocsDeferringCollector |
bdd |
|
static ParseField |
EXECUTION_HINT_FIELD |
|
static ParseField |
MAX_DOCS_PER_VALUE_FIELD |
|
static ParseField |
SHARD_SIZE_FIELD |
|
protected int |
shardSize |
collectableSubAggregators, context, DEFAULT_WEIGHT, name, parent, subAggregators
NO_OP_COLLECTOR
Modifier and Type | Method | Description |
---|---|---|
InternalAggregation |
buildAggregation(long owningBucketOrdinal) |
Build an aggregation for data that has been collected into
bucket . |
InternalAggregation |
buildEmptyAggregation() |
Build an empty aggregation.
|
protected void |
doClose() |
Release instance-specific data.
|
DeferringBucketCollector |
getDeferringCollector() |
|
protected LeafBucketCollector |
getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx,
LeafBucketCollector sub) |
Get a
LeafBucketCollector for the given ctx, which should
delegate to the given collector. |
boolean |
needsScores() |
Most aggregators don't need scores, make sure to extend this method if
your aggregator needs them.
|
protected boolean |
shouldDefer(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.
|
descendsFromBucketAggregator
addRequestCircuitBreakerBytes, buildEmptySubAggregations, context, doPostCollection, getLeafCollector, metaData, name, parent, pipelineAggregators, postCollection, preCollection, preGetSubLeafCollectors, subAggregator, subAggregators, toString
wrap
bucketAggregations, bucketDocCount, bucketEmptyAggregations, close, collectBucket, collectExistingBucket, consumeBucketsAndMaybeBreak, getDocCounts, grow, incrementBucketDocCount, maxBucketOrd
descendsFromGlobalAggregator, doPreCollection, runDeferredCollections
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
bucketDocCount
public static final ParseField SHARD_SIZE_FIELD
public static final ParseField MAX_DOCS_PER_VALUE_FIELD
public static final ParseField EXECUTION_HINT_FIELD
protected final int shardSize
protected BestDocsDeferringCollector bdd
public boolean needsScores()
AggregatorBase
needsScores
in class AggregatorBase
public DeferringBucketCollector getDeferringCollector()
getDeferringCollector
in class DeferableBucketAggregator
protected boolean shouldDefer(Aggregator aggregator)
DeferableBucketAggregator
DeferableBucketAggregator.runDeferredCollections(long...)
for the selected set
of buckets that survive the pruning.shouldDefer
in class DeferableBucketAggregator
aggregator
- the child aggregatorpublic InternalAggregation buildAggregation(long owningBucketOrdinal) throws java.io.IOException
Aggregator
bucket
.buildAggregation
in class Aggregator
java.io.IOException
public InternalAggregation buildEmptyAggregation()
Aggregator
buildEmptyAggregation
in class Aggregator
protected LeafBucketCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx, LeafBucketCollector sub) throws java.io.IOException
AggregatorBase
LeafBucketCollector
for the given ctx, which should
delegate to the given collector.getLeafCollector
in class AggregatorBase
java.io.IOException
protected void doClose()
AggregatorBase
doClose
in class AggregatorBase