Class TDigestHolder

java.lang.Object
org.elasticsearch.compute.data.TDigestHolder
All Implemented Interfaces:
GenericNamedWriteable, NamedWriteable, VersionedNamedWriteable, Writeable, org.elasticsearch.tdigest.TDigestReadView

public class TDigestHolder extends Object implements GenericNamedWriteable, org.elasticsearch.tdigest.TDigestReadView
This is a TDigestReadView annotated with some extra information: The sum, min and max of all observations. In addition, it stores the size as a dedicated field for faster access. The TDigest is represented a list of centroids and their counts, encoded in a byte array. This class does not own the underlying memory used to store the digest, it is merely a pointer/accessor for e.g. a single value in a TDigestBlock or in BreakingTDigestHolder.
This class supports serialization, but this is only intended for use in ES|QL Literals, as it uses untracked memory on deserialization.
  • Field Details

  • Constructor Details

  • Method Details

    • reset

      public void reset(org.apache.lucene.util.BytesRef encodedDigest, double min, double max, double sum, long valueCount)
    • empty

      public static TDigestHolder empty()
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getEncodedDigest

      public org.apache.lucene.util.BytesRef getEncodedDigest()
    • getMax

      public double getMax()
      Specified by:
      getMax in interface org.elasticsearch.tdigest.TDigestReadView
    • getMin

      public double getMin()
      Specified by:
      getMin in interface org.elasticsearch.tdigest.TDigestReadView
    • size

      public long size()
      Specified by:
      size in interface org.elasticsearch.tdigest.TDigestReadView
    • centroids

      public Collection<org.elasticsearch.tdigest.Centroid> centroids()
      Specified by:
      centroids in interface org.elasticsearch.tdigest.TDigestReadView
    • centroidCount

      public int centroidCount()
      Specified by:
      centroidCount in interface org.elasticsearch.tdigest.TDigestReadView
    • getSum

      public double getSum()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getWriteableName

      public String getWriteableName()
      Specified by:
      getWriteableName in interface NamedWriteable
      Specified by:
      getWriteableName in interface VersionedNamedWriteable
    • getMinimalSupportedVersion

      public TransportVersion getMinimalSupportedVersion()
      Specified by:
      getMinimalSupportedVersion in interface VersionedNamedWriteable