Class SharedNumericThreshold

All Implemented Interfaces:
Closeable, AutoCloseable, RefCounted, Releasable

public final class SharedNumericThreshold extends SideChannel
Thread-safe, shared numeric TopN threshold for operators running on the same node.

Each NumericTopNOperator publishes the raw value at the top of its full heap. The accumulated value is monotonic: ascending sorts keep the smallest observed heap top and descending sorts keep the largest observed heap top. Readers can use that threshold to skip row groups or stripes whose min/max statistics prove they cannot contain a globally competitive row.

  • Method Details

    • offer

      public void offer(long rawTopOfHeap)
      Publish a raw heap-top value. The accumulator only tightens, never relaxes.
    • current

      public long current()
    • dominates

      public boolean dominates(long rangeMin, long rangeMax)
      Whether a min/max statistics range is strictly dominated by the current threshold. Equality is deliberately not skipped because row-position tiebreakers can still matter.
    • markNoFurtherCandidates

      public void markNoFurtherCandidates()
      Mark the source as exhausted by K nulls under NULLS FIRST and collapse the threshold to a value that dominates every ordinary min/max range.
    • noFurtherCandidates

      public boolean noFurtherCandidates()
    • offeredCount

      public long offeredCount()
    • closeSideChannel

      protected void closeSideChannel()
      Specified by:
      closeSideChannel in class SideChannel