guluo2016 commented on code in PR #8340:
URL: https://github.com/apache/hbase/pull/8340#discussion_r3404690273
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java:
##########
@@ -628,6 +628,9 @@ public static List<SnapshotDescription>
getSnapshotList(final Configuration conf
Path rootDir = CommonFSUtils.getRootDir(conf);
FileSystem fs = FileSystem.get(rootDir.toUri(), conf);
Path snapshotDir = SnapshotDescriptionUtils.getSnapshotsDir(rootDir);
+ if (!fs.exists(snapshotDir)) {
+ return Collections.emptyList();
+ }
FileStatus[] snapshots = fs.listStatus(snapshotDir,
Review Comment:
Good point, thanks.
I checked the code again and luckily found that `CommonFSUtils.listStatus`
can handle this case directly, so let me update the code, thanks again.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]