From 2903938153d381caf8eb7fb6c4a0ca402c12625d Mon Sep 17 00:00:00 2001 From: Reid Chan Date: Mon, 18 Sep 2017 14:51:09 +0800 Subject: [PATCH] HBASE-18808 Ineffective config check in BackupLogCleaner#getDeletableFiles() Signed-off-by: tedyu --- .../hadoop/hbase/backup/master/BackupLogCleaner.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java index 08a7ebaf1c8..0f1722fd6c6 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java @@ -76,8 +76,10 @@ public class BackupLogCleaner extends BaseLogCleanerDelegate { // all members of this class are null if backup is disabled, // so we cannot filter the files if (this.getConf() == null || !BackupManager.isBackupEnabled(getConf())) { - LOG.warn("Backup is not enabled. Check your " + BackupRestoreConstants.BACKUP_ENABLE_KEY - + " setting"); + if (LOG.isDebugEnabled()) { + LOG.debug("Backup is not enabled. Check your " + + BackupRestoreConstants.BACKUP_ENABLE_KEY + " setting"); + } return files; } @@ -117,12 +119,11 @@ public class BackupLogCleaner extends BaseLogCleanerDelegate { @Override public void setConf(Configuration config) { // If backup is disabled, keep all members null + super.setConf(config); if (!config.getBoolean(BackupRestoreConstants.BACKUP_ENABLE_KEY, BackupRestoreConstants.BACKUP_ENABLE_DEFAULT)) { LOG.warn("Backup is disabled - allowing all wals to be deleted"); - return; } - super.setConf(config); } @Override