Module org.elasticsearch.compute
Class BatchContext
java.lang.Object
org.elasticsearch.compute.operator.exchange.BatchContext
Shared context for batch state management between BatchDriver and PageToBatchPageOperator.
Batch lifecycle states:
NOT_STARTED ──► ACTIVE ──► DRAINING ──► IDLE ──► ACTIVE ──► DRAINING ──► IDLE ...
(first batch) (subsequent batches)
Thread safety: This class is designed for single-threaded driver execution.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGet the current batch ID.getState()Get the current batch state.booleanCheck if a batch is currently active (ACTIVE or DRAINING).
-
Constructor Details
-
BatchContext
public BatchContext()
-
-
Method Details
-
getState
Get the current batch state. -
getBatchId
public long getBatchId()Get the current batch ID.- Returns:
- the current batch ID, or
UNDEFINED_BATCH_IDif no batch is active
-
isBatchActive
public boolean isBatchActive()Check if a batch is currently active (ACTIVE or DRAINING).
-