Class CompleteInputCollectorOperator

java.lang.Object
org.elasticsearch.compute.operator.CompleteInputCollectorOperator
All Implemented Interfaces:
Closeable, AutoCloseable, Operator, org.elasticsearch.core.Releasable
Direct Known Subclasses:
ChangePointOperator, LinearScoreEvalOperator, MMROperator

public abstract class CompleteInputCollectorOperator extends Object implements Operator
A base class that loads in and works across all input pages for an operator
  • Field Details

    • finished

      protected boolean finished
    • inputPages

      protected final Deque<Page> inputPages
    • pagesReceived

      protected int pagesReceived
    • rowsReceived

      protected long rowsReceived
  • Constructor Details

    • CompleteInputCollectorOperator

      protected CompleteInputCollectorOperator()
  • Method Details

    • 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
    • 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
    • close

      public final 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
    • onFinished

      protected abstract void onFinished()
      Called when he base finish() call is completed
    • isOperatorFinished

      protected abstract boolean isOperatorFinished()
      Adds any additional checks to ensure the subclass is finished
      Returns:
      true if the subclass is finished
    • onGetOutput

      protected abstract Page onGetOutput()
      Implementation to retrieve the output pages. Will only run if `isFinished()` is true
      Returns:
      the output page (or null if not ready or none)
    • onClose

      protected abstract void onClose()
      Additional implementation for closing out the subclass