Module org.elasticsearch.server
Class AbstractInternalTerms<A extends AbstractInternalTerms<A,B>,B extends AbstractInternalTerms.AbstractTermsBucket>
java.lang.Object
org.elasticsearch.search.aggregations.InternalAggregation
org.elasticsearch.search.aggregations.InternalMultiBucketAggregation<A,B>
org.elasticsearch.search.aggregations.bucket.terms.AbstractInternalTerms<A,B>
- All Implemented Interfaces:
NamedWriteable
,Writeable
,Aggregation
,MultiBucketsAggregation
,ToXContent
,ToXContentFragment
- Direct Known Subclasses:
InternalTerms
public abstract class AbstractInternalTerms<A extends AbstractInternalTerms<A,B>,B extends AbstractInternalTerms.AbstractTermsBucket>
extends InternalMultiBucketAggregation<A,B>
Base class for terms and multi_terms aggregation that handles common reduce logic
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
InternalMultiBucketAggregation.BucketAggregationList<B extends MultiBucketsAggregation.Bucket>, InternalMultiBucketAggregation.InternalBucket
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFields
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation
MultiBucketsAggregation.Bucket
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
REPORT_EMPTY_EVERY
Fields inherited from class org.elasticsearch.search.aggregations.InternalAggregation
metadata, name
Fields inherited from interface org.elasticsearch.search.aggregations.Aggregation
TYPED_KEYS_DELIMITER
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
ModifierConstructorDescriptionAbstractInternalTerms
(String name, Map<String, Object> metadata) protected
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract A
create
(String name, List<B> buckets, BucketOrder reduceOrder, long docCountError, long otherDocCount) Creates InternalTerms at the end of the mergeprotected abstract B
createBucket
(long docCount, InternalAggregations aggs, long docCountError, B prototype) doReduce
(List<InternalAggregation> aggregations, AggregationReduceContext reduceContext) protected static XContentBuilder
doXContentCommon
(XContentBuilder builder, ToXContent.Params params, Long docCountError, long otherDocCount, List<? extends AbstractInternalTerms.AbstractTermsBucket> buckets) finalizeSampling
(SamplingContext samplingContext) Called by the parent sampling context.protected abstract Long
protected abstract long
protected abstract BucketOrder
getOrder()
protected abstract BucketOrder
protected abstract int
protected abstract int
protected abstract long
protected abstract void
setDocCountError
(long docCountError) Methods inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
copyWithRewritenBuckets, countInnerBucket, countInnerBucket, create, createBucket, forEachBucket, getBuckets, getProperty, mustReduceOnSingleInternalAgg, reducePipelines
Methods inherited from class org.elasticsearch.search.aggregations.InternalAggregation
canLeadReduction, doWriteTo, doXContentBody, equals, getLeaderReducer, getMetadata, getName, getProperty, getReducer, getType, hashCode, readSize, sortValue, sortValue, toString, toXContent, writeSize, writeTo
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.search.aggregations.Aggregation
getMetadata, getName, getType
Methods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableName
Methods inherited from interface org.elasticsearch.xcontent.ToXContent
toXContent
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
AbstractInternalTerms
-
AbstractInternalTerms
- Throws:
IOException
-
-
Method Details
-
create
protected abstract A create(String name, List<B> buckets, BucketOrder reduceOrder, long docCountError, long otherDocCount) Creates InternalTerms at the end of the merge -
getShardSize
protected abstract int getShardSize() -
getReduceOrder
-
getOrder
-
getSumOfOtherDocCounts
protected abstract long getSumOfOtherDocCounts() -
getDocCountError
-
setDocCountError
protected abstract void setDocCountError(long docCountError) -
getMinDocCount
protected abstract long getMinDocCount() -
getRequiredSize
protected abstract int getRequiredSize() -
createBucket
protected abstract B createBucket(long docCount, InternalAggregations aggs, long docCountError, B prototype) -
doReduce
public InternalAggregation doReduce(List<InternalAggregation> aggregations, AggregationReduceContext reduceContext) -
finalizeSampling
Description copied from class:InternalAggregation
Called by the parent sampling context. Should only ever be called once as some aggregations scale their internal values- Overrides:
finalizeSampling
in classInternalAggregation
- Parameters:
samplingContext
- the current sampling context- Returns:
- new aggregation with the sampling context applied, could be the same aggregation instance if nothing needs to be done
-
doXContentCommon
protected static XContentBuilder doXContentCommon(XContentBuilder builder, ToXContent.Params params, Long docCountError, long otherDocCount, List<? extends AbstractInternalTerms.AbstractTermsBucket> buckets) throws IOException - Throws:
IOException
-