Module org.elasticsearch.server
Class TDigestState
java.lang.Object
org.elasticsearch.search.aggregations.metrics.TDigestState
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.lucene.util.Accountable
,Releasable
- Direct Known Subclasses:
EmptyTDigestState
Decorates
TDigest
with custom serialization. The underlying implementation for TDigest is selected
through factory method params, providing one optimized for performance (e.g. MergingDigest or HybridDigest) by default, or optionally one
that produces highly accurate results regardless of input size but its construction over the sample population takes 2x-10x longer.-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TDigestState
(CircuitBreaker breaker, TDigestState.Type type, double compression) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(double x) void
add
(double x, long w) void
add
(TDigestState other) final double
cdf
(double x) final int
final Collection
<Centroid> void
close()
final void
compress()
final double
static TDigestState
create
(CircuitBreaker breaker, double compression) Default factory for TDigestState.static TDigestState
create
(CircuitBreaker breaker, double compression, TDigestExecutionHint executionHint) Factory for TDigestState.static TDigestState
Factory for TDigestState.static TDigestState
createWithoutCircuitBreaking
(double compression) Deprecated.No-op circuit-breaked factory for TDigestState.static TDigestState
createWithoutCircuitBreaking
(double compression, TDigestExecutionHint executionHint) Deprecated.No-op circuit-breaked factory for TDigestState.boolean
final double
getMax()
final double
getMin()
int
hashCode()
final double
quantile
(double q) long
static TDigestState
read
(CircuitBreaker breaker, StreamInput in) static TDigestState
read
(StreamInput in) Deprecated.No-op circuit-breaked factory for TDigestState.final long
size()
static void
write
(TDigestState state, StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Constructor Details
-
TDigestState
-
-
Method Details
-
createWithoutCircuitBreaking
Deprecated.No-op circuit-breaked factory for TDigestState. Used in _search aggregations. Please use thecreate(CircuitBreaker, double)
method instead on new usages. -
create
Default factory for TDigestState. The underlyingTDigest
implementation is optimized for performance, potentially providing slightly inaccurate results compared to other, substantially slower implementations.- Parameters:
compression
- the compression factor for the underlyingTDigest
object- Returns:
- a TDigestState object that's optimized for performance
-
createWithoutCircuitBreaking
@Deprecated public static TDigestState createWithoutCircuitBreaking(double compression, TDigestExecutionHint executionHint) Deprecated.No-op circuit-breaked factory for TDigestState. Used in _search aggregations. Please use thecreate(CircuitBreaker, double, TDigestExecutionHint)
method instead on new usages. -
create
public static TDigestState create(CircuitBreaker breaker, double compression, TDigestExecutionHint executionHint) Factory for TDigestState. The underlyingTDigest
implementation is either optimized for performance (default), potentially providing slightly inaccurate results for large populations, or optimized for accuracy but taking 2x-10x more to build.- Parameters:
compression
- the compression factor for the underlyingTDigest
objectexecutionHint
- controls which implementation is used; accepted values are 'high_accuracy' and '' (default)- Returns:
- a TDigestState object
-
createUsingParamsFrom
Factory for TDigestState. Uses the same initialization params as the passed TDigestState object. No data loading happens, and the input TDigestState object doesn't get altered in any way.- Parameters:
state
- the TDigestState object providing the initialization params- Returns:
- a TDigestState object
-
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsed
in interfaceorg.apache.lucene.util.Accountable
-
compression
public final double compression() -
write
- Throws:
IOException
-
read
Deprecated.No-op circuit-breaked factory for TDigestState. Used in _search aggregations. Please use theread(CircuitBreaker, StreamInput)
method instead on new usages.- Throws:
IOException
-
read
- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
add
-
add
public void add(double x, long w) -
add
public void add(double x) -
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
-
centroidCount
public final int centroidCount() -
getMin
public final double getMin() -
getMax
public final double getMax() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceReleasable
-