Fix NPE in LazyPersistFileScrubber. Contributed by Inigo Goiri.

This commit is contained in:
Inigo Goiri 2017-05-26 13:15:44 -07:00 committed by Konstantin V Shvachko
parent d81372dfad
commit 303c8dc9b6
1 changed files with 7 additions and 3 deletions

View File

@ -3870,9 +3870,13 @@ private void clearCorruptLazyPersistFiles()
while (it.hasNext()) { while (it.hasNext()) {
Block b = it.next(); Block b = it.next();
BlockInfo blockInfo = blockManager.getStoredBlock(b); BlockInfo blockInfo = blockManager.getStoredBlock(b);
BlockCollection bc = getBlockCollection(blockInfo); if (blockInfo == null) {
if (bc.getStoragePolicyID() == lpPolicy.getId()) { LOG.info("Cannot find block info for block " + b);
filesToDelete.add(bc); } else {
BlockCollection bc = getBlockCollection(blockInfo);
if (bc.getStoragePolicyID() == lpPolicy.getId()) {
filesToDelete.add(bc);
}
} }
} }