HBASE-8540 SnapshotFileCache logs too many times if snapshot dir doesn't exists

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1483024 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
mbertozzi 2013-05-15 19:25:31 +00:00
parent dc9caa9f46
commit 3c4645e7e5
1 changed files with 6 additions and 1 deletions

View File

@ -188,6 +188,9 @@ public class SnapshotFileCache implements Stoppable {
try { try {
status = fs.getFileStatus(snapshotDir); status = fs.getFileStatus(snapshotDir);
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
if (this.cache.size() > 0) {
LOG.error("Snapshot directory: " + snapshotDir + " doesn't exist");
}
return; return;
} }
// if the snapshot directory wasn't modified since we last check, we are done // if the snapshot directory wasn't modified since we last check, we are done
@ -209,7 +212,9 @@ public class SnapshotFileCache implements Stoppable {
FileStatus[] snapshots = FSUtils.listStatus(fs, snapshotDir); FileStatus[] snapshots = FSUtils.listStatus(fs, snapshotDir);
if (snapshots == null) { if (snapshots == null) {
// remove all the remembered snapshots because we don't have any left // remove all the remembered snapshots because we don't have any left
if (LOG.isDebugEnabled() && this.snapshots.size() > 0) {
LOG.debug("No snapshots on-disk, cache empty"); LOG.debug("No snapshots on-disk, cache empty");
}
this.snapshots.clear(); this.snapshots.clear();
return; return;
} }