Module org.elasticsearch.server
Class HistogramUnionState
java.lang.Object
org.elasticsearch.search.aggregations.metrics.HistogramUnionState
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.lucene.util.Accountable,Releasable
public class HistogramUnionState
extends Object
implements Releasable, org.apache.lucene.util.Accountable
A state for holding potentially mixed data of exponential histogram and T-Digests.
If the data is not mixed, the querying methods will just delegate to
ExponentialHistogramState or TDigestState as appropriate.
Otherwise the T-Digest data will be converted to exponential histogram and will be merged
with the existing exponential histogram data to serve queries.
This conversion will happen lazily: All T-Digests will be merged with each other and all exponential histograms
will be merged with each other first, to preserve accuracy as much as possible.
Only when a query is made that requires both data types, the conversion will happen.-
Field Summary
FieldsFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(double value) voidadd(double value, long count) voidadd(ExponentialHistogram histogram) voidadd(HistogramUnionState other) voidadd(TDigestState tdigest) final doublecdf(double x) final Collection<Centroid> voidclose()final voidcompress()doublestatic HistogramUnionStatecreate(CircuitBreaker breaker, double tDigestCompression) static HistogramUnionStatecreate(CircuitBreaker breaker, TDigestExecutionHint executionHint, double tDigestCompression) static HistogramUnionStatecreate(CircuitBreaker breaker, TDigestState.Type type, double tDigestCompression) static HistogramUnionStatecreateUsingParamsFrom(HistogramUnionState otherState) booleanfinal doublegetMax()final doublegetMin()inthashCode()final doublequantile(double q) longstatic HistogramUnionStateread(CircuitBreaker breaker, StreamInput in) static HistogramUnionStatereadAsPureTDigest(CircuitBreaker breaker, StreamInput in) Reads aHistogramUnionStateserialized viawriteAsPureTDigestTo(StreamOutput).final longsize()static HistogramUnionStatewrap(CircuitBreaker breaker, TDigestState tdigest) voidWrites this state so that it can be deserialized viaTDigestState.read(StreamInput).voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
EMPTY
-
NOOP_BREAKER
-
-
Method Details
-
create
-
create
public static HistogramUnionState create(CircuitBreaker breaker, TDigestState.Type type, double tDigestCompression) -
create
public static HistogramUnionState create(CircuitBreaker breaker, TDigestExecutionHint executionHint, double tDigestCompression) -
createUsingParamsFrom
-
wrap
-
add
-
add
-
add
public void add(double value) -
add
public void add(double value, long count) -
add
-
compression
public double compression() -
compress
public final void compress() -
size
public final long size() -
cdf
public final double cdf(double x) -
quantile
public final double quantile(double q) -
centroids
-
getMin
public final double getMin() -
getMax
public final double getMax() -
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsedin interfaceorg.apache.lucene.util.Accountable
-
writeTo
- Throws:
IOException
-
read
- Throws:
IOException
-
writeAsPureTDigestTo
Writes this state so that it can be deserialized viaTDigestState.read(StreamInput).- Throws:
IOException
-
readAsPureTDigest
public static HistogramUnionState readAsPureTDigest(CircuitBreaker breaker, StreamInput in) throws IOException Reads aHistogramUnionStateserialized viawriteAsPureTDigestTo(StreamOutput). This means it is also capable of serializing data which was written viaTDigestState.write(TDigestState, StreamOutput).- Throws:
IOException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceReleasable
-
equals
-
hashCode
public int hashCode()
-