@Override
  public void close() {
    if (currentRegionScanner != null) {
      currentRegionScanner.close();
    }
    // if snapshotAlreadyRestored is true, then we should invoke cleanup() method by hand.
    if (!this.snapshotAlreadyRestored) {
      cleanup();
    }
  }
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