Class BucketMetricsPipelineAggregator
java.lang.Object
org.elasticsearch.search.aggregations.pipeline.PipelineAggregator
org.elasticsearch.search.aggregations.pipeline.SiblingPipelineAggregator
org.elasticsearch.search.aggregations.pipeline.BucketMetricsPipelineAggregator
- All Implemented Interfaces:
NamedWriteable
,Writeable
- Direct Known Subclasses:
AvgBucketPipelineAggregator
,ExtendedStatsBucketPipelineAggregator
,MaxBucketPipelineAggregator
,MinBucketPipelineAggregator
,PercentilesBucketPipelineAggregator
,StatsBucketPipelineAggregator
,SumBucketPipelineAggregator
public abstract class BucketMetricsPipelineAggregator extends SiblingPipelineAggregator
A class of sibling pipeline aggregations which calculate metrics across the
buckets of a sibling aggregation
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.pipeline.PipelineAggregator
PipelineAggregator.Parser, PipelineAggregator.PipelineTree
Nested 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 protected DocValueFormat
format
protected BucketHelpers.GapPolicy
gapPolicy
-
Method Summary
Modifier and Type Method Description protected abstract InternalAggregation
buildAggregation(java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metadata)
Called after a collection run is finished to build the aggregation for the collected state.protected abstract void
collectBucketValue(java.lang.String bucketKey, java.lang.Double bucketValue)
Called for each bucket with a value so the state can be modified based on the key and metric value for this bucketInternalAggregation
doReduce(Aggregations aggregations, InternalAggregation.ReduceContext context)
void
doWriteTo(StreamOutput out)
protected void
innerWriteTo(StreamOutput out)
protected void
preCollection()
Called before initial collection and between successive collection runs.Methods inherited from class org.elasticsearch.search.aggregations.pipeline.SiblingPipelineAggregator
reduce
Methods inherited from class org.elasticsearch.search.aggregations.pipeline.PipelineAggregator
bucketsPaths, metaData, name, writeTo
-
Field Details
-
Method Details
-
doWriteTo
- Specified by:
doWriteTo
in classPipelineAggregator
- Throws:
java.io.IOException
-
innerWriteTo
- Throws:
java.io.IOException
-
doReduce
public final InternalAggregation doReduce(Aggregations aggregations, InternalAggregation.ReduceContext context)- Specified by:
doReduce
in classSiblingPipelineAggregator
-
preCollection
protected void preCollection()Called before initial collection and between successive collection runs. A chance to initialize or re-initialize state -
buildAggregation
protected abstract InternalAggregation buildAggregation(java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metadata)Called after a collection run is finished to build the aggregation for the collected state.- Parameters:
pipelineAggregators
- the pipeline aggregators to add to the resulting aggregationmetadata
- the metadata to add to the resulting aggregation
-
collectBucketValue
protected abstract void collectBucketValue(java.lang.String bucketKey, java.lang.Double bucketValue)Called for each bucket with a value so the state can be modified based on the key and metric value for this bucket- Parameters:
bucketKey
- the key for this bucket as a StringbucketValue
- the value of the metric specified inbucketsPath
for this bucket
-