Module org.elasticsearch.compute
Class BatchDriver
java.lang.Object
org.elasticsearch.compute.operator.Driver
org.elasticsearch.compute.operator.exchange.BatchDriver
- All Implemented Interfaces:
Closeable,AutoCloseable,Describable,org.elasticsearch.core.Releasable
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
-
Field Summary
Fields inherited from class org.elasticsearch.compute.operator.Driver
activeOperators, DEFAULT_MAX_ITERATIONS, DEFAULT_STATUS_INTERVAL, DEFAULT_TIME_BEFORE_YIELDING, shortDescription -
Constructor Summary
ConstructorsConstructorDescriptionBatchDriver(String sessionId, String shortDescription, String clusterName, String nodeName, long startTime, long startNanos, DriverContext driverContext, Supplier<String> description, ExchangeSourceOperator source, List<Operator> intermediateOperators, SinkOperator sink, org.elasticsearch.core.TimeValue statusInterval, org.elasticsearch.core.Releasable releasable) -
Method Summary
Modifier and TypeMethodDescriptionGet the batch context.longGet the current batch ID.protected voidCalled when no pages were moved in a loop iteration.static org.elasticsearch.compute.operator.exchange.PageToBatchPageOperatorwrapSink(SinkOperator sink) Wraps a sink operator to convert Pages to BatchPages.Methods inherited from class org.elasticsearch.compute.operator.Driver
abort, cancel, close, closeEarlyFinishedOperators, describe, drainAndCloseOperators, driverContext, finishAllActiveOperators, profile, sessionId, start, status, toString
-
Constructor Details
-
BatchDriver
public BatchDriver(String sessionId, String shortDescription, String clusterName, String nodeName, long startTime, long startNanos, DriverContext driverContext, Supplier<String> description, ExchangeSourceOperator source, List<Operator> intermediateOperators, SinkOperator sink, org.elasticsearch.core.TimeValue statusInterval, org.elasticsearch.core.Releasable releasable)
-
-
Method Details
-
wrapSink
public static org.elasticsearch.compute.operator.exchange.PageToBatchPageOperator wrapSink(SinkOperator sink) Wraps a sink operator to convert Pages to BatchPages. -
getBatchContext
Get the batch context. -
getBatchId
public long getBatchId()Get the current batch ID. -
onNoPagesMoved
protected void onNoPagesMoved()Description copied from class:DriverCalled when no pages were moved in a loop iteration. Subclasses can override this to detect when the driver is idle/empty.- Overrides:
onNoPagesMovedin classDriver
-