private void removeCachedFiles(Map<String, Future<Path>> entries, FileCache fileCache) { // cancel and release all distributed cache files try { for (Map.Entry<String, Future<Path>> entry : entries.entrySet()) { String name = entry.getKey(); try { fileCache.deleteTmpFile(name, jobId); } catch (Exception e) { // unpleasant, but we continue LOG.error("Distributed Cache could not remove cached file registered under '" + name + "'.", e); } } } catch (Throwable t) { LOG.error("Error while removing cached local files from distributed cache."); } }