HDFS-14799. Do Not Call Map containsKey In Conjunction with get. Contributed by hemanthboyina.

This commit is contained in:
Ayush Saxena 2019-09-14 10:39:20 +05:30
parent 9a931b823e
commit e04b8a46c3
1 changed files with 2 additions and 8 deletions

View File

@ -112,17 +112,11 @@ class InvalidateBlocks {
}
private LightWeightHashSet<Block> getBlocksSet(final DatanodeInfo dn) {
if (nodeToBlocks.containsKey(dn)) {
return nodeToBlocks.get(dn);
}
return null;
return nodeToBlocks.get(dn);
}
private LightWeightHashSet<Block> getECBlocksSet(final DatanodeInfo dn) {
if (nodeToECBlocks.containsKey(dn)) {
return nodeToECBlocks.get(dn);
}
return null;
return nodeToECBlocks.get(dn);
}
private LightWeightHashSet<Block> getBlocksSet(final DatanodeInfo dn,