Class InternalStats
java.lang.Object
org.elasticsearch.search.aggregations.InternalAggregation
org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation
org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation.MultiValue
org.elasticsearch.search.aggregations.metrics.InternalStats
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment,Aggregation,NumericMetricsAggregation,NumericMetricsAggregation.MultiValue,Stats
- Direct Known Subclasses:
InternalExtendedStats,InternalStatsBucket
public class InternalStats extends InternalNumericMetricsAggregation.MultiValue implements Stats
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation
InternalNumericMetricsAggregation.MultiValue, InternalNumericMetricsAggregation.SingleValueNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalAggregation
InternalAggregation.ReduceContextNested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFieldsNested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.metrics.NumericMetricsAggregation
NumericMetricsAggregation.MultiValue, NumericMetricsAggregation.SingleValueNested 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 protected longcountprotected doublemaxprotected doubleminprotected doublesumFields inherited from class org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation
formatFields inherited from class org.elasticsearch.search.aggregations.InternalAggregation
metaData, nameFields inherited from interface org.elasticsearch.search.aggregations.Aggregation
TYPED_KEYS_DELIMITER -
Constructor Summary
Constructors Constructor Description InternalStats(java.lang.String name, long count, double sum, double min, double max, DocValueFormat formatter, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData)InternalStats(StreamInput in)Read from a stream. -
Method Summary
Modifier and Type Method Description protected voiddoWriteTo(StreamOutput out)XContentBuilderdoXContentBody(XContentBuilder builder, ToXContent.Params params)booleanequals(java.lang.Object obj)doublegetAvg()java.lang.StringgetAvgAsString()longgetCount()doublegetMax()java.lang.StringgetMaxAsString()doublegetMin()java.lang.StringgetMinAsString()doublegetSum()java.lang.StringgetSumAsString()java.lang.StringgetWriteableName()Returns the name of the writeable objectinthashCode()protected XContentBuilderotherStatsToXContent(XContentBuilder builder, ToXContent.Params params)InternalStatsreduce(java.util.List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)Reduces the given aggregations to a single one and returns it.doublevalue(java.lang.String name)protected voidwriteOtherStatsTo(StreamOutput out)Methods inherited from class org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation.MultiValue
getProperty, valueAsStringMethods inherited from class org.elasticsearch.search.aggregations.InternalAggregation
getMetaData, getName, getProperty, getType, isMapped, pipelineAggregators, readSize, reducePipelines, 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, getType
-
Field Details
-
Constructor Details
-
InternalStats
public InternalStats(java.lang.String name, long count, double sum, double min, double max, DocValueFormat formatter, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData) -
InternalStats
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteToin classInternalAggregation- Throws:
java.io.IOException
-
writeOtherStatsTo
- Throws:
java.io.IOException
-
getWriteableName
public java.lang.String getWriteableName()Description copied from interface:NamedWriteableReturns the name of the writeable object- Specified by:
getWriteableNamein interfaceNamedWriteable
-
getCount
public long getCount() -
getMin
public double getMin() -
getMax
public double getMax() -
getAvg
public double getAvg() -
getSum
public double getSum() -
getMinAsString
public java.lang.String getMinAsString()- Specified by:
getMinAsStringin interfaceStats- Returns:
- The minimum value of all aggregated values as a String.
-
getMaxAsString
public java.lang.String getMaxAsString()- Specified by:
getMaxAsStringin interfaceStats- Returns:
- The maximum value of all aggregated values as a String.
-
getAvgAsString
public java.lang.String getAvgAsString()- Specified by:
getAvgAsStringin interfaceStats- Returns:
- The avg value over all aggregated values as a String.
-
getSumAsString
public java.lang.String getSumAsString()- Specified by:
getSumAsStringin interfaceStats- Returns:
- The sum of aggregated values as a String.
-
value
public double value(java.lang.String name)- Specified by:
valuein classInternalNumericMetricsAggregation.MultiValue
-
reduce
public InternalStats reduce(java.util.List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)Description copied from class:InternalAggregationReduces the given aggregations to a single one and returns it. In most cases, the assumption will be the all given aggregations are of the same type (the same type as this aggregation). For best efficiency, when implementing, try reusing an existing instance (typically the first in the given list) to save on redundant object construction.- Specified by:
reducein classInternalAggregation
-
doXContentBody
public XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
doXContentBodyin classInternalAggregation- Throws:
java.io.IOException
-
otherStatsToXContent
protected XContentBuilder otherStatsToXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Throws:
java.io.IOException
-
hashCode
public int hashCode()- Overrides:
hashCodein classInternalNumericMetricsAggregation
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classInternalNumericMetricsAggregation
-