Search in sources :

Example 1 with JobRequest

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++;
    }
}
Also used : JobRequest(io.crate.execution.jobs.transport.JobRequest) Collection(java.util.Collection) Map(java.util.Map)

Aggregations

JobRequest (io.crate.execution.jobs.transport.JobRequest)1 Collection (java.util.Collection)1 Map (java.util.Map)1