HBASE-20609 SnapshotHFileCleaner#init should check that params is not null

This commit is contained in:
tedyu 2018-05-21 18:36:38 -07:00
parent c9f8c3436f
commit 6c1097e92f
2 changed files with 2 additions and 1 deletions

View File

@ -76,7 +76,7 @@ public class SnapshotHFileCleaner extends BaseHFileCleanerDelegate {
@Override
public void init(Map<String, Object> params) {
if (params.containsKey(HMaster.MASTER)) {
if (params != null && params.containsKey(HMaster.MASTER)) {
this.master = (MasterServices) params.get(HMaster.MASTER);
}
}

View File

@ -375,6 +375,7 @@ public class TestHFileArchiving {
// The cleaner should be looping without long pauses to reproduce the race condition.
HFileCleaner cleaner = new HFileCleaner(1, stoppable, conf, fs, archiveDir);
assertFalse("cleaner should not be null", cleaner == null);
try {
choreService.scheduleChore(cleaner);