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

View File

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