Class BucketMetricsPipelineAggregator
- java.lang.Object
-
- org.elasticsearch.search.aggregations.pipeline.PipelineAggregator
-
- org.elasticsearch.search.aggregations.pipeline.SiblingPipelineAggregator
-
- org.elasticsearch.search.aggregations.pipeline.bucketmetrics.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
-
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
-
Constructor Summary
Constructors Modifier Constructor Description protected
BucketMetricsPipelineAggregator(java.lang.String name, java.lang.String[] bucketsPaths, BucketHelpers.GapPolicy gapPolicy, DocValueFormat format, java.util.Map<java.lang.String,java.lang.Object> metaData)
protected
BucketMetricsPipelineAggregator(StreamInput in)
Read from a stream.
-
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableName
-
-
-
-
Field Detail
-
format
protected final DocValueFormat format
-
gapPolicy
protected final BucketHelpers.GapPolicy gapPolicy
-
-
Constructor Detail
-
BucketMetricsPipelineAggregator
protected BucketMetricsPipelineAggregator(java.lang.String name, java.lang.String[] bucketsPaths, BucketHelpers.GapPolicy gapPolicy, DocValueFormat format, java.util.Map<java.lang.String,java.lang.Object> metaData)
-
BucketMetricsPipelineAggregator
protected BucketMetricsPipelineAggregator(StreamInput in) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
doWriteTo
public final void doWriteTo(StreamOutput out) throws java.io.IOException
- Specified by:
doWriteTo
in classPipelineAggregator
- Throws:
java.io.IOException
-
innerWriteTo
protected void innerWriteTo(StreamOutput out) throws java.io.IOException
- 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
-
-