Class InferenceOperator.BulkInferenceOperation

java.lang.Object
org.elasticsearch.xpack.esql.inference.InferenceOperator.BulkInferenceOperation
Enclosing class:
InferenceOperator

public static class InferenceOperator.BulkInferenceOperation extends Object
Manages the execution of inference requests for a single input page.
  • Constructor Details

  • Method Details

    • pollNextRequest

      Polls the next inference request, assigning it a sequence number for ordering.
      Returns:
      The next request item with sequence number, or null if no more requests or operation is finished.
    • onInferenceResponse

      public void onInferenceResponse(InferenceOperator.BulkInferenceResponseItem response)
      Handles an inference response, buffering it and draining responses in sequence order. Responses are reordered using the checkpoint tracker to maintain correct sequencing.
      Parameters:
      response - The inference response to process.
    • onException

      public void onException(Exception exception)
      Handles an exception, failing the entire bulk operation. Only the first exception is recorded; subsequent exceptions are ignored.
      Parameters:
      exception - The exception that occurred.
    • completeIfFinished

      public void completeIfFinished()
      Completes the operation if all requests have been sent and all responses have been received. Calls the completion listener exactly once when the operation finishes successfully.
    • clearBuffers

      public void clearBuffers()