Module org.elasticsearch.compute
Class BidirectionalBatchExchangeServer
java.lang.Object
org.elasticsearch.compute.operator.exchange.BidirectionalBatchExchangeBase
org.elasticsearch.compute.operator.exchange.BidirectionalBatchExchangeServer
- All Implemented Interfaces:
Closeable,AutoCloseable,Releasable
Server-side handler for bidirectional batch exchange.
The server:
- Receives batches from the client via clientToServer exchange (using ExchangeSource)
- Sends results to the client via serverToClient exchange (using ExchangeSink)
- Uses BatchDriver to process batches
- Sends empty marker page when batch completes (via onBatchDone callback)
Only one batch can be active at a time. BatchDriver will throw an exception if multiple batches are sent concurrently.
-
Field Summary
Fields inherited from class org.elasticsearch.compute.operator.exchange.BidirectionalBatchExchangeBase
exchangeService, executor, maxBufferSize, sessionId, settings, task, transportService -
Constructor Summary
ConstructorsConstructorDescriptionBidirectionalBatchExchangeServer(String sessionId, String clientToServerId, String serverToClientId, ExchangeService exchangeService, Executor executor, int maxBufferSize, TransportService transportService, Task task, DiscoveryNode clientNode, Settings settings) Create a new BidirectionalBatchExchangeServer with explicit exchange IDs. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Get the source operator factory for use in planning.voidhandleBatchExchangeStatusRequest(BatchExchangeStatusRequest request, TransportChannel channel, Task task) Handle BatchExchangeStatusRequest from the client.voidstartWithOperators(DriverContext driverContext, ThreadContext threadContext, List<Operator> intermediateOperators, String clusterName, Releasable releasable, ActionListener<Void> readyListener) Start batch processing with the intermediate operators.Methods inherited from class org.elasticsearch.compute.operator.exchange.BidirectionalBatchExchangeBase
buildClientToServerId, buildServerToClientId, connectRemoteSink, logExchangeFailure
-
Constructor Details
-
BidirectionalBatchExchangeServer
public BidirectionalBatchExchangeServer(String sessionId, String clientToServerId, String serverToClientId, ExchangeService exchangeService, Executor executor, int maxBufferSize, TransportService transportService, Task task, DiscoveryNode clientNode, Settings settings) Create a new BidirectionalBatchExchangeServer with explicit exchange IDs. CallstartWithOperators(DriverContext, ThreadContext, List, String, Releasable, ActionListener)to complete setup and start processing after planning is complete
-
-
Method Details
-
getSourceOperatorFactory
Get the source operator factory for use in planning. This can be called after construction to get the factory before calling startWithOperators.- Returns:
- the source operator factory
-
startWithOperators
public void startWithOperators(DriverContext driverContext, ThreadContext threadContext, List<Operator> intermediateOperators, String clusterName, Releasable releasable, ActionListener<Void> readyListener) Start batch processing with the intermediate operators. This must be called after planning is complete. -
handleBatchExchangeStatusRequest
public void handleBatchExchangeStatusRequest(BatchExchangeStatusRequest request, TransportChannel channel, Task task) Handle BatchExchangeStatusRequest from the client. Called by ExchangeService's singleton handler which routes requests to the appropriate server.The server stores the response channel BEFORE starting processing, ensuring it can always reply if an error occurs. Processing only starts after this request is received.
-
close
public void close()
-