Module org.elasticsearch.server
Class AbstractInternalTerms<A extends AbstractInternalTerms<A,B>,B extends AbstractInternalTerms.AbstractTermsBucket<B>>
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<B>>
extends InternalMultiBucketAggregation<A,B>
Base class for terms and multi_terms aggregation that handles common reduce logic
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
InternalMultiBucketAggregation.BucketAggregationList<B extends MultiBucketsAggregation.Bucket>, InternalMultiBucketAggregation.InternalBucket, InternalMultiBucketAggregation.InternalBucketWritableNested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFieldsNested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation
MultiBucketsAggregation.BucketNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested 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_EVERYFields inherited from class org.elasticsearch.search.aggregations.InternalAggregation
metadata, nameFields inherited from interface org.elasticsearch.search.aggregations.Aggregation
TYPED_KEYS_DELIMITERFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsModifierConstructorDescriptionAbstractInternalTerms(String name, Map<String, Object> metadata) protected -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Acreate(String name, List<B> buckets, BucketOrder reduceOrder, long docCountError, long otherDocCount) Creates InternalTerms at the end of the mergeprotected abstract BcreateBucket(long docCount, InternalAggregations aggs, long docCountError, B prototype) protected static XContentBuilderdoXContentCommon(XContentBuilder builder, ToXContent.Params params, boolean showDocCountError, Long docCountError, long otherDocCount, List<? extends AbstractInternalTerms.AbstractTermsBucket<?>> buckets) finalizeSampling(SamplingContext samplingContext) Called by the parent sampling context.protected abstract Longprotected abstract longprotected abstract BucketOrdergetOrder()protected abstract BucketOrderprotected abstract intprotected abstract intprotected abstract booleanprotected abstract longprotected abstract voidsetDocCountError(long docCountError) final AggregatorReducertermsAggregationReducer(AggregationReduceContext reduceContext, int size) Methods inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
copyWithRewritenBuckets, countInnerBucket, countInnerBucket, create, createBucket, forEachBucket, getBuckets, getProperty, mustReduceOnSingleInternalAgg, reducePipelinesMethods 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, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.search.aggregations.Aggregation
getMetadata, getName, getTypeMethods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableNameMethods inherited from interface org.elasticsearch.xcontent.ToXContent
toXContentMethods 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() -
getShowDocCountError
protected abstract boolean getShowDocCountError() -
createBucket
protected abstract B createBucket(long docCount, InternalAggregations aggs, long docCountError, B prototype) -
termsAggregationReducer
public final AggregatorReducer termsAggregationReducer(AggregationReduceContext reduceContext, int size) -
finalizeSampling
Description copied from class:InternalAggregationCalled by the parent sampling context. Should only ever be called once as some aggregations scale their internal values- Overrides:
finalizeSamplingin 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, boolean showDocCountError, Long docCountError, long otherDocCount, List<? extends AbstractInternalTerms.AbstractTermsBucket<?>> buckets) throws IOException - Throws:
IOException
-