Class SharedMinCompetitive

java.lang.Object
org.elasticsearch.core.AbstractRefCounted
org.elasticsearch.compute.operator.SideChannel
org.elasticsearch.compute.operator.topn.SharedMinCompetitive
All Implemented Interfaces:
Closeable, AutoCloseable, org.elasticsearch.core.RefCounted, org.elasticsearch.core.Releasable

public class SharedMinCompetitive extends SideChannel
A thread safe, shared holder for the min competitive value from a set of TopNOperators.
  • 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. false here means the minimum value in the local top n is greater than or equal to the minimum competitive value already recorded
    • get

      @Nullable public Page get(BlockFactory blockFactory)
      Read the min competitive value. This will return null if there isn't yet a min competitive value. Otherwise, this will return a Page that contains single-position, single-valued Blocks.
    • closeSideChannel

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