use of com.hazelcast.spi.TaskScheduler in project hazelcast by hazelcast.
the class JobSupervisor method asyncCancelRemoteOperations.
private void asyncCancelRemoteOperations(final Set<Address> addresses) {
final NodeEngine nodeEngine = mapReduceService.getNodeEngine();
TaskScheduler taskScheduler = nodeEngine.getExecutionService().getGlobalTaskScheduler();
taskScheduler.execute(new Runnable() {
@Override
public void run() {
String name = getConfiguration().getName();
String jobId = getConfiguration().getJobId();
for (Address address : addresses) {
try {
CancelJobSupervisorOperation operation = new CancelJobSupervisorOperation(name, jobId);
mapReduceService.processRequest(address, operation);
} catch (Exception ignore) {
// We can ignore this exception since we just want to cancel the job
// and the member may be crashed or unreachable in some way
ILogger logger = nodeEngine.getLogger(JobSupervisor.class);
logger.finest("Remote node may already be down", ignore);
}
}
}
});
}
use of com.hazelcast.spi.TaskScheduler in project hazelcast by hazelcast.
the class LockStoreContainer method createScheduler.
private EntryTaskScheduler<Data, Integer> createScheduler(ObjectNamespace namespace) {
NodeEngine nodeEngine = lockService.getNodeEngine();
LockEvictionProcessor entryProcessor = new LockEvictionProcessor(nodeEngine, namespace);
TaskScheduler globalScheduler = nodeEngine.getExecutionService().getGlobalTaskScheduler();
return EntryTaskSchedulerFactory.newScheduler(globalScheduler, entryProcessor, ScheduleType.FOR_EACH);
}
Aggregations