Class DynamicThreshold

java.lang.Object
org.elasticsearch.xpack.esql.datasources.spi.DynamicThreshold
All Implemented Interfaces:
Closeable, AutoCloseable, Releasable

public final class DynamicThreshold extends Object implements Releasable
Per-query descriptor for the live TopN threshold exposed to format readers.

A descriptor is backed by exactly one side-channel, selected by elementType():

  • fixed-width numeric sort keys (LONG, INT, DOUBLE, BOOLEAN) publish a raw long bound through a SharedNumericThreshold fed by the NumericTopNOperator;
  • BYTES_REF sort keys (keyword/text) publish an encoded competitive bound through a SharedMinCompetitive fed by the generic TopNOperator. The encoded bound is decoded back to a raw BytesRef on demand so readers can compare it directly against a column's min/max string statistics.
Readers branch on elementType() and call the matching dominates overload.
  • Constructor Details

  • Method Details

    • columnName

      public String columnName()
    • elementType

      public ElementType elementType()
    • nullsFirst

      public boolean nullsFirst()
    • dominates

      public boolean dominates(long rangeMin, long rangeMax)
    • dominates

      public boolean dominates(long rangeMin, long rangeMax, long nullCount)
    • dominates

      public boolean dominates(org.apache.lucene.util.BytesRef rangeMin, org.apache.lucene.util.BytesRef rangeMax)
      Whether the [rangeMin, rangeMax] string statistics of a row group/stripe are strictly dominated by the current BYTES_REF competitive bound. Mirrors dominates(long, long): equality is deliberately not skipped because row-position tiebreakers can still matter. Returns false when no usable bound has been published yet (or the bound is a null key).
    • dominates

      public boolean dominates(org.apache.lucene.util.BytesRef rangeMin, org.apache.lucene.util.BytesRef rangeMax, long nullCount)
    • dominatesNulls

      public boolean dominatesNulls(long nullCount)
    • noFurtherCandidates

      public boolean noFurtherCandidates()
    • current

      public long current()
    • hasBound

      public boolean hasBound()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface Releasable