use of io.crate.execution.jobs.transport.JobRequest in project crate by crate.
the class JobLauncher method sendJobRequests.
private void sendJobRequests(TransactionContext txnCtx, String localNodeId, Map<String, Collection<NodeOperation>> operationByServer, List<PageBucketReceiver> pageBucketReceivers, List<Tuple<ExecutionPhase, RowConsumer>> handlerPhases, int bucketIdx, InitializationTracker initializationTracker) {
for (Map.Entry<String, Collection<NodeOperation>> entry : operationByServer.entrySet()) {
String serverNodeId = entry.getKey();
JobRequest request = new JobRequest(jobId, txnCtx.sessionSettings(), localNodeId, entry.getValue(), enableProfiling);
if (hasDirectResponse) {
transportJobAction.execute(serverNodeId, request, BucketForwarder.asActionListener(pageBucketReceivers, bucketIdx, initializationTracker));
} else {
transportJobAction.execute(serverNodeId, request, new FailureOnlyResponseListener(handlerPhases, initializationTracker));
}
bucketIdx++;
}
}
Aggregations