/** * Returns the map of store files based on path for all snapshots * @param conf the {@link Configuration} to use * @param uniqueHFilesArchiveSize pass out the size for store files in archive * @param uniqueHFilesSize pass out the size for store files shared * @param uniqueHFilesMobSize pass out the size for mob store files shared * @return the map of store files */ public static Map<Path, Integer> getSnapshotsFilesMap(final Configuration conf, AtomicLong uniqueHFilesArchiveSize, AtomicLong uniqueHFilesSize, AtomicLong uniqueHFilesMobSize) throws IOException { List<SnapshotDescription> snapshotList = getSnapshotList(conf); if (snapshotList.isEmpty()) { return Collections.emptyMap(); } ConcurrentHashMap<Path, Integer> fileMap = new ConcurrentHashMap<>(); ExecutorService exec = SnapshotManifest.createExecutor(conf, "SnapshotsFilesMapping"); try { for (final SnapshotDescription snapshot : snapshotList) { getSnapshotFilesMap(conf, snapshot, exec, fileMap, uniqueHFilesArchiveSize, uniqueHFilesSize, uniqueHFilesMobSize); } } finally { exec.shutdown(); } return fileMap; }