public static void setInput(Configuration conf, String snapshotName, Path restoreDir,
    RegionSplitter.SplitAlgorithm splitAlgo, int numSplitsPerRegion) throws IOException {
    conf.set(SNAPSHOT_NAME_KEY, snapshotName);
    if (numSplitsPerRegion < 1) {
      throw new IllegalArgumentException(
        "numSplits must be >= 1, " + "illegal numSplits : " + numSplitsPerRegion);
    }
    if (splitAlgo == null && numSplitsPerRegion > 1) {
      throw new IllegalArgumentException("Split algo can't be null when numSplits > 1");
    }
    if (splitAlgo != null) {
      conf.set(SPLIT_ALGO, splitAlgo.getClass().getName());
    }
    conf.setInt(NUM_SPLITS_PER_REGION, numSplitsPerRegion);
    Path rootDir = CommonFSUtils.getRootDir(conf);
    FileSystem fs = rootDir.getFileSystem(conf);

    restoreDir = new Path(restoreDir, UUID.randomUUID().toString());

    RestoreSnapshotHelper.copySnapshotForScanner(conf, fs, rootDir, restoreDir, snapshotName);
    conf.set(RESTORE_DIR_KEY, restoreDir.toString());
  }
Configures the job to use TableSnapshotInputFormat to read from a snapshot.
@param conf               the job to configure
@param snapshotName       the name of the snapshot to read from
@param restoreDir         a temporary directory to restore the snapshot into. Current user
                          should have write permissions to this directory, and this should not
                          be a subdirectory of rootdir. After the job is finished, restoreDir
                          can be deleted.
@param numSplitsPerRegion how many input splits to generate per one region
@param splitAlgo          SplitAlgorithm to be used when generating InputSplits
@throws IOException if an error occurs
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatImpl.java