Class InferenceOperator.BulkInferenceOperation
java.lang.Object
org.elasticsearch.xpack.esql.inference.InferenceOperator.BulkInferenceOperation
- Enclosing class:
InferenceOperator
Manages the execution of inference requests for a single input page.
-
Constructor Summary
ConstructorsConstructorDescriptionBulkInferenceOperation(InferenceOperator.BulkInferenceRequestItemIterator requestItemIterator, ActionListener<List<InferenceOperator.BulkInferenceResponseItem>> completionListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidCompletes the operation if all requests have been sent and all responses have been received.voidonException(Exception exception) Handles an exception, failing the entire bulk operation.voidHandles an inference response, buffering it and draining responses in sequence order.Polls the next inference request, assigning it a sequence number for ordering.
-
Constructor Details
-
BulkInferenceOperation
public BulkInferenceOperation(InferenceOperator.BulkInferenceRequestItemIterator requestItemIterator, ActionListener<List<InferenceOperator.BulkInferenceResponseItem>> completionListener)
-
-
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
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
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()
-