Search in sources :

Example 1 with JobRequest

use of io.crate.action.job.JobRequest in project crate by crate.

the class ExecutionPhasesTask method sendJobRequests.

private void sendJobRequests(String localNodeId, Map<String, Collection<NodeOperation>> operationByServer, List<PageBucketReceiver> pageBucketReceivers, List<Tuple<ExecutionPhase, BatchConsumer>> handlerPhases, int bucketIdx, InitializationTracker initializationTracker) {
    for (Map.Entry<String, Collection<NodeOperation>> entry : operationByServer.entrySet()) {
        String serverNodeId = entry.getKey();
        JobRequest request = new JobRequest(jobId(), localNodeId, entry.getValue());
        if (hasDirectResponse) {
            transportJobAction.execute(serverNodeId, request, new SetBucketActionListener(pageBucketReceivers, bucketIdx, initializationTracker));
        } else {
            transportJobAction.execute(serverNodeId, request, new FailureOnlyResponseListener(handlerPhases, initializationTracker));
        }
        bucketIdx++;
    }
}
Also used : JobRequest(io.crate.action.job.JobRequest)

Aggregations

JobRequest (io.crate.action.job.JobRequest)1