HBASE-18808 Ineffective config check in BackupLogCleaner#getDeletableFiles()
Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
parent
03eefa8aa5
commit
2903938153
|
@ -76,8 +76,10 @@ public class BackupLogCleaner extends BaseLogCleanerDelegate {
|
||||||
// all members of this class are null if backup is disabled,
|
// all members of this class are null if backup is disabled,
|
||||||
// so we cannot filter the files
|
// so we cannot filter the files
|
||||||
if (this.getConf() == null || !BackupManager.isBackupEnabled(getConf())) {
|
if (this.getConf() == null || !BackupManager.isBackupEnabled(getConf())) {
|
||||||
LOG.warn("Backup is not enabled. Check your " + BackupRestoreConstants.BACKUP_ENABLE_KEY
|
if (LOG.isDebugEnabled()) {
|
||||||
+ " setting");
|
LOG.debug("Backup is not enabled. Check your "
|
||||||
|
+ BackupRestoreConstants.BACKUP_ENABLE_KEY + " setting");
|
||||||
|
}
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,12 +119,11 @@ public class BackupLogCleaner extends BaseLogCleanerDelegate {
|
||||||
@Override
|
@Override
|
||||||
public void setConf(Configuration config) {
|
public void setConf(Configuration config) {
|
||||||
// If backup is disabled, keep all members null
|
// If backup is disabled, keep all members null
|
||||||
|
super.setConf(config);
|
||||||
if (!config.getBoolean(BackupRestoreConstants.BACKUP_ENABLE_KEY,
|
if (!config.getBoolean(BackupRestoreConstants.BACKUP_ENABLE_KEY,
|
||||||
BackupRestoreConstants.BACKUP_ENABLE_DEFAULT)) {
|
BackupRestoreConstants.BACKUP_ENABLE_DEFAULT)) {
|
||||||
LOG.warn("Backup is disabled - allowing all wals to be deleted");
|
LOG.warn("Backup is disabled - allowing all wals to be deleted");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
super.setConf(config);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue