From 202db381b910548260c6bbfbeaa0af2b3573d670 Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Wed, 19 Nov 2014 21:06:21 +0100 Subject: [PATCH] HBASE-12539 HFileLinkCleaner logs are uselessly noisy --- .../hadoop/hbase/master/cleaner/HFileLinkCleaner.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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..f3e0e71 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,25 @@ 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"); + 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"); + LOG.debug("Couldn't get the references, not deleting file, just in case. filePath=" + + filePath + ", backRefDir=" + backRefDir); return false; } } @@ -82,7 +86,9 @@ 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"); + 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)); } } } -- 1.9.3 (Apple Git-50)