From 3c4645e7e5342c44c153283cd355139bac12f1dd Mon Sep 17 00:00:00 2001 From: mbertozzi Date: Wed, 15 May 2013 19:25:31 +0000 Subject: [PATCH] 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 --- .../hadoop/hbase/master/snapshot/SnapshotFileCache.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java index 2d3b1eb6726..3e321c65554 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java @@ -188,6 +188,9 @@ public class SnapshotFileCache implements Stoppable { try { status = fs.getFileStatus(snapshotDir); } catch (FileNotFoundException e) { + if (this.cache.size() > 0) { + LOG.error("Snapshot directory: " + snapshotDir + " doesn't exist"); + } return; } // 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); if (snapshots == null) { // remove all the remembered snapshots because we don't have any left - LOG.debug("No snapshots on-disk, cache empty"); + if (LOG.isDebugEnabled() && this.snapshots.size() > 0) { + LOG.debug("No snapshots on-disk, cache empty"); + } this.snapshots.clear(); return; }