Class SharedMinCompetitive
- All Implemented Interfaces:
Closeable,AutoCloseable,RefCounted,Releasable
TopNOperators.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic classNested classes/interfaces inherited from class org.elasticsearch.compute.operator.SideChannel
SideChannel.Status -
Field Summary
Fields inherited from class org.elasticsearch.core.AbstractRefCounted
ALREADY_CLOSED_MESSAGE, INVALID_DECREF_MESSAGEFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigs()get(BlockFactory blockFactory) Read the min competitive value.voidSignal that the source feeding this channel can stop entirely: no row it could still produce can be competitive.org.apache.lucene.util.BytesRefDecode the competitive bound of a single sort key into its rawBytesRefform, suitable for comparing directly against a format reader's column min/max statistics.booleanbooleanoffer(org.apache.lucene.util.BytesRef minCompetitive) Offer an update to the min competitive value.Methods inherited from class org.elasticsearch.compute.operator.SideChannel
close, closeInternalMethods inherited from class org.elasticsearch.core.AbstractRefCounted
alreadyClosed, decRef, hasReferences, incRef, mustIncRef, of, refCount, touch, tryIncRef
-
Method Details
-
configs
-
offer
public boolean offer(org.apache.lucene.util.BytesRef minCompetitive) Offer an update to the min competitive value.- Parameters:
minCompetitive- if it is accepted then the bytes are copied- Returns:
- whether the update was accepted.
falsehere means the minimum value in the local top n is greater than or equal to the minimum competitive value already recorded
-
markNoFurtherCandidates
public void markNoFurtherCandidates()Signal that the source feeding this channel can stop entirely: no row it could still produce can be competitive. The genericTopNOperatorcalls this for a single-keyNULLS FIRSTsort once its top-K heap is saturated with nulls. -
noFurtherCandidates
public boolean noFurtherCandidates() -
get
-
minCompetitiveValue
Decode the competitive bound of a single sort key into its rawBytesRefform, suitable for comparing directly against a format reader's column min/max statistics.Returns
nullwhen nothing has been offered yet, or when the most-competitive row's key is itselfnull— in that case there is no usable byte bound, because every non-null value may still be competitive (under NULLS LAST) and we must not skip any range.The returned
BytesRefis an independent, read-only view over an immutable byte array that is never mutated in place. Callers may safely retain it after this method returns and across subsequentoffer(org.apache.lucene.util.BytesRef)calls from other threads (a new offer publishes a fresh array and leaves earlier ones untouched), but must not mutate it: concurrent readers may view the same backing bytes.Only valid when this channel tracks exactly one key; a multi-key TopN does not expose a single comparable bound.
-
closeSideChannel
protected void closeSideChannel()- Specified by:
closeSideChannelin classSideChannel
-