public class InternalAvg extends InternalNumericMetricsAggregation.SingleValue implements Avg
InternalNumericMetricsAggregation.MultiValue, InternalNumericMetricsAggregation.SingleValueInternalAggregation.CommonFields, InternalAggregation.ReduceContext, InternalAggregation.TypeNumericMetricsAggregation.MultiValue, NumericMetricsAggregation.SingleValueToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params| Modifier and Type | Field and Description |
|---|---|
static AggregationStreams.Stream |
STREAM |
static InternalAggregation.Type |
TYPE |
valueFormatternameEMPTY_PARAMS| Constructor and Description |
|---|
InternalAvg(String name,
double sum,
long count,
ValueFormatter formatter) |
| Modifier and Type | Method and Description |
|---|---|
XContentBuilder |
doXContentBody(XContentBuilder builder,
ToXContent.Params params) |
double |
getValue()
The average value.
|
void |
readFrom(StreamInput in) |
InternalAvg |
reduce(InternalAggregation.ReduceContext reduceContext)
Reduces the given addAggregation to a single one and returns it.
|
static void |
registerStreams() |
InternalAggregation.Type |
type() |
double |
value() |
void |
writeTo(StreamOutput out) |
getValueAsStringgetName, readSize, toXContent, writeSizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetValueAsStringgetNamepublic static final InternalAggregation.Type TYPE
public static final AggregationStreams.Stream STREAM
public InternalAvg(String name, double sum, long count, @Nullable ValueFormatter formatter)
public static void registerStreams()
public double value()
value in interface NumericMetricsAggregation.SingleValuepublic double getValue()
Avgpublic InternalAggregation.Type type()
type in class InternalAggregationInternalAggregation.Type of this aggregationpublic InternalAvg reduce(InternalAggregation.ReduceContext reduceContext)
InternalAggregationreduce in class InternalAggregationpublic void readFrom(StreamInput in) throws IOException
readFrom in interface StreamableIOExceptionpublic void writeTo(StreamOutput out) throws IOException
writeTo in interface StreamableIOExceptionpublic XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws IOException
doXContentBody in class InternalAggregationIOExceptionCopyright © 2009–2016. All rights reserved.