Fix NPE in LazyPersistFileScrubber. Contributed by Inigo Goiri.
This commit is contained in:
parent
d81372dfad
commit
303c8dc9b6
@ -3870,11 +3870,15 @@ 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);
|
||||||
|
if (blockInfo == null) {
|
||||||
|
LOG.info("Cannot find block info for block " + b);
|
||||||
|
} else {
|
||||||
BlockCollection bc = getBlockCollection(blockInfo);
|
BlockCollection bc = getBlockCollection(blockInfo);
|
||||||
if (bc.getStoragePolicyID() == lpPolicy.getId()) {
|
if (bc.getStoragePolicyID() == lpPolicy.getId()) {
|
||||||
filesToDelete.add(bc);
|
filesToDelete.add(bc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (BlockCollection bc : filesToDelete) {
|
for (BlockCollection bc : filesToDelete) {
|
||||||
LOG.warn("Removing lazyPersist file " + bc.getName() + " with no replicas.");
|
LOG.warn("Removing lazyPersist file " + bc.getName() + " with no replicas.");
|
||||||
|
Loading…
Reference in New Issue
Block a user