Search in sources :

Example 1 with ProcessingOperation

use of com.hazelcast.mapreduce.impl.operation.ProcessingOperation in project hazelcast by hazelcast.

the class MapReduceService method sendNotification.

public void sendNotification(Address address, MapReduceNotification notification) {
    try {
        ProcessingOperation operation = new FireNotificationOperation(notification);
        processRequest(address, operation);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : ProcessingOperation(com.hazelcast.mapreduce.impl.operation.ProcessingOperation) ExecutionException(java.util.concurrent.ExecutionException) FireNotificationOperation(com.hazelcast.mapreduce.impl.operation.FireNotificationOperation)

Example 2 with ProcessingOperation

use of com.hazelcast.mapreduce.impl.operation.ProcessingOperation in project hazelcast by hazelcast.

the class MapReduceService method registerJobSupervisorCancellation.

public boolean registerJobSupervisorCancellation(String name, String jobId, Address jobOwner) {
    NodeJobTracker jobTracker = (NodeJobTracker) createDistributedObject(name);
    if (jobTracker.registerJobSupervisorCancellation(jobId) && getLocalAddress().equals(jobOwner)) {
        for (Member member : clusterService.getMembers()) {
            if (!member.getAddress().equals(jobOwner)) {
                try {
                    ProcessingOperation operation = new CancelJobSupervisorOperation(name, jobId);
                    processRequest(member.getAddress(), operation);
                } catch (Exception ignore) {
                    LOGGER.finest("Member might be already unavailable", ignore);
                }
            }
        }
        return true;
    }
    return false;
}
Also used : ProcessingOperation(com.hazelcast.mapreduce.impl.operation.ProcessingOperation) Member(com.hazelcast.core.Member) CancelJobSupervisorOperation(com.hazelcast.mapreduce.impl.operation.CancelJobSupervisorOperation) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

ProcessingOperation (com.hazelcast.mapreduce.impl.operation.ProcessingOperation)2 ExecutionException (java.util.concurrent.ExecutionException)2 Member (com.hazelcast.core.Member)1 CancelJobSupervisorOperation (com.hazelcast.mapreduce.impl.operation.CancelJobSupervisorOperation)1 FireNotificationOperation (com.hazelcast.mapreduce.impl.operation.FireNotificationOperation)1