Module org.elasticsearch.server
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,- Aggregation,- NumericMetricsAggregation,- NumericMetricsAggregation.MultiValue,- Stats,- ToXContent,- ToXContentFragment
- Direct Known Subclasses:
- InternalExtendedStats,- InternalStatsBucket
- 
Nested Class SummaryNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregationInternalNumericMetricsAggregation.MultiValue, InternalNumericMetricsAggregation.SingleValueNested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.AggregationAggregation.CommonFieldsNested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.metrics.NumericMetricsAggregationNumericMetricsAggregation.MultiValue, NumericMetricsAggregation.SingleValueNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContentToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.WriteableWriteable.Reader<V>, Writeable.Writer<V>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final longprotected final doubleprotected final doubleprotected final doubleFields inherited from class org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregationformatFields inherited from class org.elasticsearch.search.aggregations.InternalAggregationmetadata, nameFields inherited from interface org.elasticsearch.search.aggregations.AggregationTYPED_KEYS_DELIMITERFields inherited from interface org.elasticsearch.xcontent.ToXContentEMPTY_PARAMS
- 
Constructor SummaryConstructorsConstructorDescriptionInternalStats(String name, long count, double sum, double min, double max, DocValueFormat formatter, Map<String, Object> metadata) Read from a stream.
- 
Method SummaryModifier and TypeMethodDescriptionprotected final voiddoWriteTo(StreamOutput out) doXContentBody(XContentBuilder builder, ToXContent.Params params) booleanfinalizeSampling(SamplingContext samplingContext) Called by the parent sampling context.doublegetAvg()longgetCount()doublegetMax()doublegetMin()doublegetSum()Returns the name of the writeable objectinthashCode()protected XContentBuilderotherStatsToXContent(XContentBuilder builder, ToXContent.Params params) reduce(List<InternalAggregation> aggregations, AggregationReduceContext reduceContext) Reduces the given aggregations to a single one and returns it.doubleReturn the result of 1 value by nameReturn an iterable over all value names this multi value aggregation provides.protected voidMethods inherited from class org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation.MultiValuegetProperty, sortValue, valueAsStringMethods inherited from class org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregationmustReduceOnSingleInternalAgg, sortValueMethods inherited from class org.elasticsearch.search.aggregations.InternalAggregationcopyWithRewritenBuckets, forEachBucket, getMetadata, getName, getProperty, getType, isMapped, readSize, reducePipelines, toString, toXContent, writeSize, writeToMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.search.aggregations.AggregationgetMetadata, getName, getTypeMethods inherited from interface org.elasticsearch.xcontent.ToXContenttoXContentMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragmentisFragment
- 
Field Details- 
countprotected final long count
- 
minprotected final double min
- 
maxprotected final double max
- 
sumprotected final double sum
 
- 
- 
Constructor Details- 
InternalStatspublic InternalStats(String name, long count, double sum, double min, double max, DocValueFormat formatter, Map<String, Object> metadata) 
- 
InternalStatsRead from a stream.- Throws:
- IOException
 
 
- 
- 
Method Details- 
doWriteTo- Specified by:
- doWriteToin class- InternalAggregation
- Throws:
- IOException
 
- 
writeOtherStatsTo- Throws:
- IOException
 
- 
getWriteableNameDescription copied from interface:NamedWriteableReturns the name of the writeable object- Specified by:
- getWriteableNamein interface- NamedWriteable
 
- 
getCountpublic long getCount()
- 
getMinpublic double getMin()
- 
getMaxpublic double getMax()
- 
getAvgpublic double getAvg()
- 
getSumpublic double getSum()
- 
getMinAsString- Specified by:
- getMinAsStringin interface- Stats
- Returns:
- The minimum value of all aggregated values as a String.
 
- 
getMaxAsString- Specified by:
- getMaxAsStringin interface- Stats
- Returns:
- The maximum value of all aggregated values as a String.
 
- 
getAvgAsString- Specified by:
- getAvgAsStringin interface- Stats
- Returns:
- The avg value over all aggregated values as a String.
 
- 
getSumAsString- Specified by:
- getSumAsStringin interface- Stats
- Returns:
- The sum of aggregated values as a String.
 
- 
valueDescription copied from interface:NumericMetricsAggregation.MultiValueReturn the result of 1 value by name- Specified by:
- valuein interface- NumericMetricsAggregation.MultiValue
- Specified by:
- valuein class- InternalNumericMetricsAggregation.MultiValue
- Parameters:
- name- of the value
- Returns:
- the value
 
- 
valueNamesDescription copied from interface:NumericMetricsAggregation.MultiValueReturn an iterable over all value names this multi value aggregation provides. The iterable might be created on the fly, if you need to call this multiple times, please cache the result in a variable on caller side..- Specified by:
- valueNamesin interface- NumericMetricsAggregation.MultiValue
- Returns:
- iterable over all value names
 
- 
reducepublic InternalStats reduce(List<InternalAggregation> aggregations, AggregationReduceContext 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 class- InternalAggregation
- See Also:
 
- 
finalizeSamplingDescription copied from class:InternalAggregationCalled by the parent sampling context. Should only ever be called once as some aggregations scale their internal values- Overrides:
- finalizeSamplingin class- InternalAggregation
- Parameters:
- samplingContext- the current sampling context
- Returns:
- new aggregation with the sampling context applied, could be the same aggregation instance if nothing needs to be done
 
- 
doXContentBodypublic XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
- doXContentBodyin class- InternalAggregation
- Throws:
- IOException
 
- 
otherStatsToXContentprotected XContentBuilder otherStatsToXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
- IOException
 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- InternalNumericMetricsAggregation
 
- 
equals- Overrides:
- equalsin class- InternalNumericMetricsAggregation
 
 
-