HDFS-14799. Do Not Call Map containsKey In Conjunction with get. Contributed by hemanthboyina.
This commit is contained in:
parent
9a931b823e
commit
e04b8a46c3
10
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java
Normal file → Executable file
10
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java
Normal file → Executable file
|
@ -112,17 +112,11 @@ class InvalidateBlocks {
|
||||||
}
|
}
|
||||||
|
|
||||||
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,
|
||||||
|
|
Loading…
Reference in New Issue