java.lang.Object
org.elasticsearch.compute.operator.Driver
org.elasticsearch.compute.operator.exchange.BatchDriver
All Implemented Interfaces:
Closeable, AutoCloseable, Describable, org.elasticsearch.core.Releasable

public final class BatchDriver extends Driver
Driver that processes batches on the server side of a BidirectionalBatchExchange. Extends Driver to handle batch-specific logic.

This driver:

  • Reads pages from the client-to-server exchange
  • Executes operators (from factories) on those pages
  • Writes results to the server-to-client exchange
  • Detects batch boundaries from BatchPage
  • Tracks batch state via BatchContext
  • Constructor Details

  • Method Details

    • wrapSink

      public static org.elasticsearch.compute.operator.exchange.PageToBatchPageOperator wrapSink(SinkOperator sink)
      Wraps a sink operator to convert Pages to BatchPages.
    • getBatchContext

      public BatchContext getBatchContext()
      Get the batch context.
    • getBatchId

      public long getBatchId()
      Get the current batch ID.
    • onNoPagesMoved

      protected void onNoPagesMoved()
      Description copied from class: Driver
      Called when no pages were moved in a loop iteration. Subclasses can override this to detect when the driver is idle/empty.
      Overrides:
      onNoPagesMoved in class Driver