huaxiangsun commented on a change in pull request #1791: URL: https://github.com/apache/hbase/pull/1791#discussion_r434223497
########## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java ########## @@ -251,6 +260,25 @@ private void refreshCache() throws IOException { this.snapshots.putAll(newSnapshots); } + @VisibleForTesting + 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(fs, + new Path(snapshotDir, SnapshotDescriptionUtils.SNAPSHOT_TMP_DIR_NAME)); + + if (!ArrayUtils.isEmpty(snapshotsInProgress)) { + for (FileStatus snapshot : snapshotsInProgress) { + try { + snapshotInProgress.addAll(fileInspector.filesUnderSnapshot(snapshot.getPath())); + } catch (CorruptedSnapshotException cse) { + LOG.debug("Corrupted in-progress snapshot file exception, ignored.", cse); Review comment: yeah, it has multiple constructors, in this specific case, there is no SnapshotDescription provided (reading SnapshotDescription results into IOException due to corrupted/missing files). I changed log level from debug to info ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org