@Override
  public void run(Path[] dirPaths, TableName[] tableNames, Path restoreRootDir,
    TableName[] newTableNames, boolean fullBackupRestore) throws IOException {
    String bulkOutputConfKey;

    player = new MapReduceHFileSplitterJob();
    bulkOutputConfKey = MapReduceHFileSplitterJob.BULK_OUTPUT_CONF_KEY;
    // Player reads all files in arbitrary directory structure and creates
    // a Map task for each file
    String dirs = StringUtils.join(dirPaths, ",");

    if (LOG.isDebugEnabled()) {
      LOG.debug("Restore " + (fullBackupRestore ? "full" : "incremental")
        + " backup from directory " + dirs + " from hbase tables "
        + StringUtils.join(tableNames, BackupRestoreConstants.TABLENAME_DELIMITER_IN_COMMAND)
        + " to tables "
        + StringUtils.join(newTableNames, BackupRestoreConstants.TABLENAME_DELIMITER_IN_COMMAND));
    }

    for (int i = 0; i < tableNames.length; i++) {
      LOG.info("Restore " + tableNames[i] + " into " + newTableNames[i]);
      Path bulkOutputPath = BackupUtils.getBulkOutputDir(restoreRootDir,
        BackupUtils.getFileNameCompatibleString(newTableNames[i]), getConf());
      Configuration conf = getConf();
      conf.set(bulkOutputConfKey, bulkOutputPath.toString());
      String[] playerArgs = { dirs, newTableNames[i].getNameAsString() };
      int result;
      try {

        player.setConf(getConf());
        result = player.run(playerArgs);
        if (succeeded(result)) {
          // do bulk load
          BulkLoadHFiles loader = BackupUtils.createLoader(getConf());
          if (LOG.isDebugEnabled()) {
            LOG.debug("Restoring HFiles from directory " + bulkOutputPath);
          }

          loader.bulkLoad(newTableNames[i], bulkOutputPath);
        } else {
          throw new IOException("Can not restore from backup directory " + dirs
            + " (check Hadoop/MR and HBase logs). Player return code =" + result);
        }
        LOG.debug("Restore Job finished:" + result);
      } catch (Exception e) {
        LOG.error(e.toString(), e);
        throw new IOException(
          "Can not restore from backup directory " + dirs + " (check Hadoop and HBase logs) ", e);
      }
    }
  }
MapReduce implementation of {@link RestoreJob} For backup restore, it runs
{@link MapReduceHFileSplitterJob} job and creates HFiles which are aligned with a region
boundaries of a table being restored. The resulting HFiles then are loaded using HBase bulk load
tool {@link BulkLoadHFiles}.
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/mapreduce/MapReduceRestoreJob.java