List<String> getSnapshotsInProgress() throws IOException {
    List<String> snapshotInProgress = Lists.newArrayList();
    // only add those files to the cache, but not to the known snapshots

    FileStatus[] snapshotsInProgress =
      CommonFSUtils.listStatus(this.workingFs, this.workingSnapshotDir);

    if (!ArrayUtils.isEmpty(snapshotsInProgress)) {
      for (FileStatus snapshot : snapshotsInProgress) {
        try {
          snapshotInProgress
            .addAll(fileInspector.filesUnderSnapshot(workingFs, snapshot.getPath()));
        } catch (CorruptedSnapshotException cse) {
          LOG.info("Corrupted in-progress snapshot file exception, ignored.", cse);
        }
      }
    }
    return snapshotInProgress;
  }
Check to see if any of the passed file names is contained in any of the snapshots. First checks
an in-memory cache of the files to keep. If its not in the cache, then the cache is refreshed
and the cache checked again for that file. This ensures that we never return files that exist.
<p>
Note this may lead to periodic false positives for the file being referenced. Periodically, the
cache is refreshed even if there are no requests to ensure that the false negatives get removed
eventually. For instance, suppose you have a file in the snapshot and it gets loaded into the
cache. Then at some point later that snapshot is deleted. If the cache has not been refreshed
at that point, cache will still think the file system contains that file and return
<tt>true</tt>, even if it is no longer present (false positive). However, if the file never was
on the filesystem, we will never find it and always return <tt>false</tt>.
@param files file to check
@return <tt>unReferencedFiles</tt> the collection of files that do not have snapshot references
@throws IOException if there is an unexpected error reaching the filesystem.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java