Class AbstractPageMappingToIteratorOperator

java.lang.Object
org.elasticsearch.compute.operator.AbstractPageMappingToIteratorOperator
All Implemented Interfaces:
Closeable, AutoCloseable, Operator, org.elasticsearch.core.Releasable
Direct Known Subclasses:
ColumnLoadOperator, RowInTableLookupOperator, ValuesSourceReaderOperator

public abstract class AbstractPageMappingToIteratorOperator extends Object implements Operator
Maps a single Page into zero or more resulting pages.
  • Constructor Details

    • AbstractPageMappingToIteratorOperator

      public AbstractPageMappingToIteratorOperator()
  • Method Details

    • receive

      protected abstract org.elasticsearch.core.ReleasableIterator<Page> receive(Page page)
      Build and Iterator of results for a new page.
    • appendBlockArrays

      public static org.elasticsearch.core.ReleasableIterator<Page> appendBlockArrays(Page page, org.elasticsearch.core.ReleasableIterator<Block[]> toAdd)
      Append an Iterator of arrays of Blocks to a Page, one after the other. It's required that the iterator emit as many positions as there were in the page.
    • appendBlocks

      public static org.elasticsearch.core.ReleasableIterator<Page> appendBlocks(Page page, org.elasticsearch.core.ReleasableIterator<? extends Block> toAdd)
      Append an Iterator of Blocks to a Page, one after the other. It's required that the iterator emit as many positions as there were in the page.
    • toString

      public abstract String toString()
      Overrides:
      toString in class Object
    • needsInput

      public final boolean needsInput()
      Description copied from interface: Operator
      whether the given operator can accept more input pages
      Specified by:
      needsInput in interface Operator
    • addInput

      public final void addInput(Page page)
      Description copied from interface: Operator
      adds an input page to the operator. only called when needsInput() == true and isFinished() == false
      Specified by:
      addInput in interface Operator
    • finish

      public final void finish()
      Description copied from interface: Operator
      notifies the operator that it won't receive any more input pages
      Specified by:
      finish in interface Operator
    • isFinished

      public final boolean isFinished()
      Description copied from interface: Operator
      whether the operator has finished processing all input pages and made the corresponding output pages available
      Specified by:
      isFinished in interface Operator
    • canProduceMoreDataWithoutExtraInput

      public boolean canProduceMoreDataWithoutExtraInput()
      Description copied from interface: Operator
      Returns true if the operator can produce more output pages without requiring additional input pages. This is useful for operators that buffer data or have internal state that can produce multiple output pages.

      Operators that do not buffer data should return false - they cannot produce pages out of thin air. Examples of operators that may return true:

      • Operators with internal buffers (e.g., AsyncOperator with pending results)
      • Operators processing a single input page into multiple output pages
      • Aggregation operators that buffer partial results
      Specified by:
      canProduceMoreDataWithoutExtraInput in interface Operator
      Returns:
      true if the operator has buffered data that can produce output, false otherwise
    • getOutput

      public final Page getOutput()
      Description copied from interface: Operator
      returns non-null if output page available. Only called when isFinished() == false
      Specified by:
      getOutput in interface Operator
    • status

      Description copied from interface: Operator
      The status of the operator.
      Specified by:
      status in interface Operator
    • status

      protected AbstractPageMappingToIteratorOperator.Status status(long processNanos, int pagesReceived, int pagesEmitted, long rowsReceived, long rowsEmitted)
    • close

      public void close()
      Description copied from interface: Operator
      notifies the operator that it won't be used anymore (i.e. none of the other methods called), and its resources can be cleaned up
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface Operator
      Specified by:
      close in interface org.elasticsearch.core.Releasable