private void cleanup() {
    try {
      if (fs.exists(this.restoreDir)) {
        if (!fs.delete(this.restoreDir, true)) {
          LOG.warn(
            "Delete restore directory for the snapshot failed. restoreDir: " + this.restoreDir);
        }
      }
    } catch (IOException ex) {
      LOG.warn(
        "Could not delete restore directory for the snapshot. restoreDir: " + this.restoreDir, ex);
    }
  }
Creates a TableSnapshotScanner.
@param conf                    the configuration
@param rootDir                 root directory for HBase.
@param restoreDir              a temporary directory to copy the snapshot files into. Current
                               user should have write permissions to this directory, and this
                               should not be a subdirectory of rootdir. The scanner deletes the
                               contents of the directory once the scanner is closed.
@param snapshotName            the name of the snapshot to read from
@param scan                    a Scan representing scan parameters
@param snapshotAlreadyRestored true to indicate that snapshot has been restored.
@throws IOException in case of error
hbase-server/src/main/java/org/apache/hadoop/hbase/client/TableSnapshotScanner.java