Class ChangePointOperator

java.lang.Object
org.elasticsearch.compute.operator.ChangePointOperator
All Implemented Interfaces:
Closeable, AutoCloseable, Operator, Releasable

public class ChangePointOperator extends Object implements Operator
Find spikes, dips and change points in a list of values.

In grouped mode the operator streams output per group: as soon as a group boundary is detected in the grouped input, the completed group is flushed through the change-point detector, annotated, and queued for output.

In non-grouped mode all input is buffered until finish() because the single implicit group cannot complete earlier.

Warning: even in grouped mode the operator cannot handle large groups! It buffers all data for the current group, runs the change point detector (which is a compute-heavy process), and then outputs the annotated data.

  • Field Details

    • INPUT_VALUE_COUNT_LIMIT

      public static final int INPUT_VALUE_COUNT_LIMIT
      See Also:
  • Constructor Details

  • Method Details

    • needsInput

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

      public 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 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 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 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
    • 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
    • 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 Releasable
    • toString

      public String toString()
      Overrides:
      toString in class Object