Class InternalTDigestPercentileRanks
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.InternalTDigestPercentileRanks
- All Implemented Interfaces:
Iterable<Percentile>
,NamedWriteable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
,Aggregation
,NumericMetricsAggregation
,NumericMetricsAggregation.MultiValue
,PercentileRanks
public class InternalTDigestPercentileRanks
extends InternalNumericMetricsAggregation.MultiValue
implements PercentileRanks
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation
InternalNumericMetricsAggregation.MultiValue, InternalNumericMetricsAggregation.SingleValue
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalAggregation
InternalAggregation.ReduceContext, InternalAggregation.ReduceContextBuilder
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFields
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.metrics.NumericMetricsAggregation
NumericMetricsAggregation.MultiValue, NumericMetricsAggregation.SingleValue
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from class org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation
format
Fields inherited from class org.elasticsearch.search.aggregations.InternalAggregation
metadata, name
Fields inherited from interface org.elasticsearch.search.aggregations.Aggregation
TYPED_KEYS_DELIMITER
Fields inherited from interface org.elasticsearch.search.aggregations.metrics.PercentileRanks
TYPE_NAME
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionInternalTDigestPercentileRanks(String name, double[] cdfValues, TDigestState state, boolean keyed, DocValueFormat formatter, Map<String,Object> metadata)
Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.elasticsearch.search.aggregations.metrics.AbstractInternalTDigestPercentiles
createReduced(String name, double[] keys, TDigestState merged, boolean keyed, Map<String,Object> metadata)
protected void
doWriteTo(StreamOutput out)
org.elasticsearch.common.xcontent.XContentBuilder
doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
boolean
long
double[]
getKeys()
Return the keys (percentiles) requested.getState()
Return the internalTDigestState
sketch for this metric.Returns the name of the writeable objectint
hashCode()
iterator()
boolean
keyed()
Should the output be keyed.double
percent(double value)
Return the percentile for the given value.percentAsString(double value)
Return the percentile for the given value as a String.static double
percentileRank(TDigestState state, double value)
org.elasticsearch.search.aggregations.metrics.AbstractInternalTDigestPercentiles
reduce(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)
Reduces the given aggregations to a single one and returns it.double
value(double key)
double
Return the result of 1 value by nameReturn an iterable over all value names this multi value aggregation provides.Methods inherited from class org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation.MultiValue
getProperty, sortValue, valueAsString
Methods inherited from class org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation
mustReduceOnSingleInternalAgg, sortValue
Methods inherited from class org.elasticsearch.search.aggregations.InternalAggregation
copyWithRewritenBuckets, forEachBucket, getMetadata, getName, getProperty, getType, isMapped, mergePipelineTreeForBWCSerialization, pipelineAggregatorsForBwcSerialization, readSize, reducePipelines, toString, toXContent, writeSize, writeTo
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.search.aggregations.Aggregation
getMetadata, getName, getType
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.elasticsearch.search.aggregations.metrics.NumericMetricsAggregation.MultiValue
value, valueNames
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContent
toXContent
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
- See Also:
- Constant Field Values
-
keys
protected final double[] keys -
state
-
-
Constructor Details
-
InternalTDigestPercentileRanks
public InternalTDigestPercentileRanks(String name, double[] cdfValues, TDigestState state, boolean keyed, DocValueFormat formatter, Map<String,Object> metadata) -
InternalTDigestPercentileRanks
Read from a stream.- Throws:
IOException
-
-
Method Details
-
getWriteableName
Description copied from interface:NamedWriteable
Returns the name of the writeable object- Specified by:
getWriteableName
in interfaceNamedWriteable
-
iterator
- Specified by:
iterator
in interfaceIterable<Percentile>
-
percent
public double percent(double value)Description copied from interface:PercentileRanks
Return the percentile for the given value.- Specified by:
percent
in interfacePercentileRanks
-
percentAsString
Description copied from interface:PercentileRanks
Return the percentile for the given value as a String.- Specified by:
percentAsString
in interfacePercentileRanks
-
value
public double value(double key) -
createReduced
protected org.elasticsearch.search.aggregations.metrics.AbstractInternalTDigestPercentiles createReduced(String name, double[] keys, TDigestState merged, boolean keyed, Map<String,Object> metadata) -
percentileRank
-
doWriteTo
- Specified by:
doWriteTo
in classInternalAggregation
- Throws:
IOException
-
value
Description copied from interface:NumericMetricsAggregation.MultiValue
Return the result of 1 value by name- Specified by:
value
in interfaceNumericMetricsAggregation.MultiValue
- Specified by:
value
in classInternalNumericMetricsAggregation.MultiValue
- Parameters:
name
- of the value- Returns:
- the value
-
valueNames
Description copied from interface:NumericMetricsAggregation.MultiValue
Return 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..- Returns:
- iterable over all value names
-
formatter
-
getEstimatedMemoryFootprint
public long getEstimatedMemoryFootprint() -
getState
Return the internalTDigestState
sketch for this metric. -
getKeys
public double[] getKeys()Return the keys (percentiles) requested. -
keyed
public boolean keyed()Should the output be keyed. -
reduce
public org.elasticsearch.search.aggregations.metrics.AbstractInternalTDigestPercentiles reduce(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)Description copied from class:InternalAggregation
Reduces 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:
reduce
in classInternalAggregation
- See Also:
InternalAggregation.mustReduceOnSingleInternalAgg()
-
doXContentBody
public org.elasticsearch.common.xcontent.XContentBuilder doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
doXContentBody
in classInternalAggregation
- Throws:
IOException
-
equals
- Overrides:
equals
in classInternalNumericMetricsAggregation
-
hashCode
public int hashCode()- Overrides:
hashCode
in classInternalNumericMetricsAggregation
-