private static List<Pair<SnapshotFileInfo, Long>> getSnapshotFiles(final Configuration conf,
    final FileSystem fs, final Path snapshotDir) throws IOException {
    SnapshotDescription snapshotDesc = SnapshotDescriptionUtils.readSnapshotInfo(fs, snapshotDir);

    final List<Pair<SnapshotFileInfo, Long>> files = new ArrayList<>();
    final TableName table = TableName.valueOf(snapshotDesc.getTable());

    // Get snapshot files
    LOG.info("Loading Snapshot '" + snapshotDesc.getName() + "' hfile list");
    Set<String> addedFiles = new HashSet<>();
    SnapshotReferenceUtil.visitReferencedFiles(conf, fs, snapshotDir, snapshotDesc,
      new SnapshotReferenceUtil.SnapshotVisitor() {
        @Override
        public void storeFile(final RegionInfo regionInfo, final String family,
          final SnapshotRegionManifest.StoreFile storeFile) throws IOException {
          Pair<SnapshotFileInfo, Long> snapshotFileAndSize = null;
          if (!storeFile.hasReference()) {
            String region = regionInfo.getEncodedName();
            String hfile = storeFile.getName();
            snapshotFileAndSize = getSnapshotFileAndSize(fs, conf, table, region, family, hfile,
              storeFile.hasFileSize() ? storeFile.getFileSize() : -1);
          } else {
            Pair<String, String> referredToRegionAndFile =
              StoreFileInfo.getReferredToRegionAndFile(storeFile.getName());
            String referencedRegion = referredToRegionAndFile.getFirst();
            String referencedHFile = referredToRegionAndFile.getSecond();
            snapshotFileAndSize = getSnapshotFileAndSize(fs, conf, table, referencedRegion, family,
              referencedHFile, storeFile.hasFileSize() ? storeFile.getFileSize() : -1);
          }
          String fileToExport = snapshotFileAndSize.getFirst().getHfile();
          if (!addedFiles.contains(fileToExport)) {
            files.add(snapshotFileAndSize);
            addedFiles.add(fileToExport);
          } else {
            LOG.debug("Skip the existing file: {}.", fileToExport);
          }
        }
      });

    return files;
  }
Extract the list of files (HFiles/WALs) to copy using Map-Reduce.
@return list of files referenced by the snapshot (pair of path and size)
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java