use of com.hazelcast.util.executor.CompletableFutureTask in project hazelcast by hazelcast.
the class AbstractCacheProxyBase method submitLoadAllTask.
@SuppressWarnings("unchecked")
void submitLoadAllTask(LoadAllTask loadAllTask) {
ExecutionService executionService = nodeEngine.getExecutionService();
final CompletableFutureTask<Object> future = (CompletableFutureTask<Object>) executionService.submit("loadAll-" + nameWithPrefix, loadAllTask);
loadAllTasks.add(future);
future.andThen(new ExecutionCallback() {
@Override
public void onResponse(Object response) {
loadAllTasks.remove(future);
}
@Override
public void onFailure(Throwable t) {
loadAllTasks.remove(future);
getNodeEngine().getLogger(getClass()).warning("Problem in loadAll task", t);
}
});
}
Aggregations