hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndimi...@apache.org
Subject hbase git commit: HBASE-12539 HFileLinkCleaner logs are uselessly noisy
Date Wed, 19 Nov 2014 22:54:06 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 1591fa9f1 -> 2d4a3ff2d


HBASE-12539 HFileLinkCleaner logs are uselessly noisy


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2d4a3ff2
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2d4a3ff2
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2d4a3ff2

Branch: refs/heads/0.98
Commit: 2d4a3ff2db947773fa7353c44b6ed33b43040b4a
Parents: 1591fa9
Author: Nick Dimiduk <ndimiduk@apache.org>
Authored: Wed Nov 19 23:38:37 2014 +0100
Committer: Nick Dimiduk <ndimiduk@apache.org>
Committed: Wed Nov 19 23:52:21 2014 +0100

----------------------------------------------------------------------
 .../hbase/master/cleaner/HFileLinkCleaner.java  | 22 +++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/2d4a3ff2/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/HFileLinkCleaner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/HFileLinkCleaner.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/HFileLinkCleaner.java
index 8475574..e8fba43 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/HFileLinkCleaner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/HFileLinkCleaner.java
@@ -55,21 +55,29 @@ public class HFileLinkCleaner extends BaseHFileCleanerDelegate {
     // The back ref can be deleted only if the referenced file doesn't exists.
     Path parentDir = filePath.getParent();
     if (HFileLink.isBackReferencesDir(parentDir)) {
+      Path hfilePath = null;
       try {
-        Path hfilePath = HFileLink.getHFileFromBackReference(getConf(), filePath);
+        hfilePath = HFileLink.getHFileFromBackReference(getConf(), filePath);
         return !fs.exists(hfilePath);
       } catch (IOException e) {
-        LOG.error("Couldn't verify if the referenced file still exists, keep it just in case");
+        if (LOG.isDebugEnabled()) {
+          LOG.debug("Couldn't verify if the referenced file still exists, keep it just in
case: "
+              + hfilePath);
+        }
         return false;
       }
     }
 
     // HFile is deletable only if has no links
+    Path backRefDir = null;
     try {
-      Path backRefDir = HFileLink.getBackReferencesDir(parentDir, filePath.getName());
+      backRefDir = HFileLink.getBackReferencesDir(parentDir, filePath.getName());
       return FSUtils.listStatus(fs, backRefDir) == null;
     } catch (IOException e) {
-      LOG.error("Couldn't get the references, not deleting file, just in case");
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Couldn't get the references, not deleting file, just in case. filePath="
+            + filePath + ", backRefDir=" + backRefDir);
+      }
       return false;
     }
   }
@@ -82,7 +90,11 @@ public class HFileLinkCleaner extends BaseHFileCleanerDelegate {
     try {
       this.fs = FileSystem.get(this.getConf());
     } catch (IOException e) {
-      LOG.error("Couldn't instantiate the file system, not deleting file, just in case");
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Couldn't instantiate the file system, not deleting file, just in case.
"
+            + FileSystem.FS_DEFAULT_NAME_KEY + "="
+            + getConf().get(FileSystem.FS_DEFAULT_NAME_KEY, FileSystem.DEFAULT_FS));
+      }
     }
   }
 }


Mime
View raw message