protected void copyMetaData(FileSystem fs, Path tmpBackupDir, Path backupDirPath)
    throws IOException {
    RemoteIterator<LocatedFileStatus> it = fs.listFiles(tmpBackupDir, true);
    List<Path> toKeep = new ArrayList<Path>();
    while (it.hasNext()) {
      Path p = it.next().getPath();
      if (fs.isDirectory(p)) {
        continue;
      }
      // Keep meta
      String fileName = p.toString();
      if (
        fileName.indexOf(FSTableDescriptors.TABLEINFO_DIR) > 0
          || fileName.indexOf(HRegionFileSystem.REGION_INFO_FILE) > 0
          || fileName.indexOf(BackupManifest.MANIFEST_FILE_NAME) > 0
      ) {
        toKeep.add(p);
      }
    }
    // Copy meta to destination
    for (Path p : toKeep) {
      Path newPath = convertToDest(p, backupDirPath);
      LOG.info("Copying tmp metadata from {} to {}", p, newPath);
      copyFile(fs, p, newPath);
    }
  }
Copy meta data to of a backup session
@param fs            file system
@param tmpBackupDir  temp backup directory, where meta is locaed
@param backupDirPath new path for backup
@throws IOException exception
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/mapreduce/MapReduceBackupMergeJob.java