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.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)
Write the body of the aggregation to the wire.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, getWriteableName, metadata, name, writeTo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
format
-
gapPolicy
-
-
Method Details
-
doWriteTo
Description copied from class:PipelineAggregator
Write the body of the aggregation to the wire.- Overrides:
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.Map<java.lang.String,java.lang.Object> metadata)Called after a collection run is finished to build the aggregation for the collected state.- Parameters:
metadata
- 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
-