Class RerankOperatorRequestIterator
java.lang.Object
org.elasticsearch.xpack.esql.inference.rerank.RerankOperatorRequestIterator
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterator<InferenceAction.Request>,org.elasticsearch.core.Releasable,BulkInferenceRequestIterator
Iterator over input data blocks to create batched inference requests for the Rerank task.
This iterator reads from a BytesRefBlock containing input documents or items to be reranked. It slices the input into batches
of configurable size and converts each batch into an InferenceAction.Request with the task type TaskType.RERANK.
-
Constructor Summary
ConstructorsConstructorDescriptionRerankOperatorRequestIterator(BytesRefBlock inputBlock, String inferenceId, String queryText, int batchSize) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
RerankOperatorRequestIterator
public RerankOperatorRequestIterator(BytesRefBlock inputBlock, String inferenceId, String queryText, int batchSize)
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceIterator<InferenceAction.Request>
-
next
- Specified by:
nextin interfaceIterator<InferenceAction.Request>
-
estimatedSize
public int estimatedSize()Description copied from interface:BulkInferenceRequestIteratorReturns an estimate of the number of requests that will be produced.This is typically used to pre-allocate buffers or output to th appropriate size.
- Specified by:
estimatedSizein interfaceBulkInferenceRequestIterator
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-