Class DynamicThreshold
java.lang.Object
org.elasticsearch.xpack.esql.datasources.spi.DynamicThreshold
- All Implemented Interfaces:
Closeable,AutoCloseable,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
longbound through aSharedNumericThresholdfed by theNumericTopNOperator; BYTES_REFsort keys (keyword/text) publish an encoded competitive bound through aSharedMinCompetitivefed by the genericTopNOperator. The encoded bound is decoded back to a rawBytesRefon demand so readers can compare it directly against a column's min/max string statistics.
elementType() and call the matching dominates overload.-
Constructor Summary
ConstructorsConstructorDescriptionDynamicThreshold(String columnName, boolean ascending, boolean nullsFirst, SharedMinCompetitive channel) DynamicThreshold(String columnName, ElementType elementType, boolean ascending, boolean nullsFirst, SharedNumericThreshold channel) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longcurrent()booleandominates(long rangeMin, long rangeMax) booleandominates(long rangeMin, long rangeMax, long nullCount) booleandominates(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 currentBYTES_REFcompetitive bound.booleandominates(org.apache.lucene.util.BytesRef rangeMin, org.apache.lucene.util.BytesRef rangeMax, long nullCount) booleandominatesNulls(long nullCount) booleanhasBound()booleanboolean
-
Constructor Details
-
Method Details
-
columnName
-
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 currentBYTES_REFcompetitive bound. Mirrorsdominates(long, long): equality is deliberately not skipped because row-position tiebreakers can still matter. Returnsfalsewhen 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceReleasable
-