Class InternalAggregations
java.lang.Object
org.elasticsearch.search.aggregations.Aggregations
org.elasticsearch.search.aggregations.InternalAggregations
- All Implemented Interfaces:
java.lang.Iterable<Aggregation>,Writeable,ToXContent,ToXContentFragment
public final class InternalAggregations extends Aggregations implements Writeable
An internal implementation of
Aggregations.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.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 Modifier and Type Field Description static InternalAggregationsEMPTYFields inherited from class org.elasticsearch.search.aggregations.Aggregations
aggregations, AGGREGATIONS_FIELD -
Constructor Summary
Constructors Constructor Description InternalAggregations(java.util.List<InternalAggregation> aggregations)Constructs a new aggregation.InternalAggregations(java.util.List<InternalAggregation> aggregations, java.util.List<SiblingPipelineAggregator> topLevelPipelineAggregators)Constructs a new aggregation providing itsInternalAggregations andSiblingPipelineAggregatorsInternalAggregations(StreamInput in) -
Method Summary
Modifier and Type Method Description java.util.List<SiblingPipelineAggregator>getTopLevelPipelineAggregators()Returns the top-level pipeline aggregators.static InternalAggregationsreduce(java.util.List<InternalAggregations> aggregationsList, InternalAggregation.ReduceContext context)Reduces the given list of aggregations as well as the top-level pipeline aggregators extracted from the firstInternalAggregationsobject found in the list.static InternalAggregationstopLevelReduce(java.util.List<InternalAggregations> aggregationsList, InternalAggregation.ReduceContext context)Begin the reduction process.voidwriteTo(StreamOutput out)Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.aggregations.Aggregations
asList, asMap, equals, fromXContent, get, getAsMap, hashCode, iterator, toXContent, toXContentInternal
-
Field Details
-
Constructor Details
-
InternalAggregations
Constructs a new aggregation. -
InternalAggregations
public InternalAggregations(java.util.List<InternalAggregation> aggregations, java.util.List<SiblingPipelineAggregator> topLevelPipelineAggregators)Constructs a new aggregation providing itsInternalAggregations andSiblingPipelineAggregators -
InternalAggregations
- Throws:
java.io.IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput. -
getTopLevelPipelineAggregators
Returns the top-level pipeline aggregators. Note that top-level pipeline aggregators become normal aggregation once the final reduction has been performed, after which they become part of the list ofInternalAggregations. -
topLevelReduce
public static InternalAggregations topLevelReduce(java.util.List<InternalAggregations> aggregationsList, InternalAggregation.ReduceContext context)Begin the reduction process. This should be the entry point for the "first" reduction, e.g. called by SearchPhaseController or anywhere else that wants to initiate a reduction. It _should not_ be called as an intermediate reduction step (e.g. in the middle of an aggregation tree). This method first reduces the aggregations, and if it is the final reduce, then reduce the pipeline aggregations (both embedded parent/sibling as well as top-level sibling pipelines) -
reduce
public static InternalAggregations reduce(java.util.List<InternalAggregations> aggregationsList, InternalAggregation.ReduceContext context)Reduces the given list of aggregations as well as the top-level pipeline aggregators extracted from the firstInternalAggregationsobject found in the list. Note that pipeline aggregations _are not_ reduced by this method. Pipelines are handled separately bytopLevelReduce(List, ReduceContext)
-