this.mapName = mapName;
}
public void process(EntryTaskScheduler<Data, Object> scheduler, Collection<ScheduledEntry<Data, Object>> entries) {
final Collection<Future> futures = new ArrayList<Future>(entries.size());
final ILogger logger = nodeEngine.getLogger(getClass());
for (ScheduledEntry<Data, Object> entry : entries) {
Data key = entry.getKey();
int partitionId = nodeEngine.getPartitionService().getPartitionId(key);
// execute eviction if the node is owner of the key (it can be backup)
if (nodeEngine.getThisAddress().equals(nodeEngine.getPartitionService().getPartitionOwner(partitionId))) {
Operation operation = new EvictOperation(mapName, key, true);
try {
Future f = nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME, operation, partitionId);
futures.add(f);
} catch (Throwable t) {
logger.warning(t);
}
}
}
for (Future future : futures) {
try {
future.get(30, TimeUnit.SECONDS);
} catch (TimeoutException e) {
logger.finest(e);
} catch (Exception e) {
logger.warning(e);
}
}
}