HDFS-14799. Do Not Call Map containsKey In Conjunction with get. Contributed by hemanthboyina.
This commit is contained in:
parent
9a931b823e
commit
e04b8a46c3
6
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java
Normal file → Executable file
6
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java
Normal file → Executable file
|
@ -112,18 +112,12 @@ class InvalidateBlocks {
|
|||
}
|
||||
|
||||
private LightWeightHashSet<Block> getBlocksSet(final DatanodeInfo dn) {
|
||||
if (nodeToBlocks.containsKey(dn)) {
|
||||
return nodeToBlocks.get(dn);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private LightWeightHashSet<Block> getECBlocksSet(final DatanodeInfo dn) {
|
||||
if (nodeToECBlocks.containsKey(dn)) {
|
||||
return nodeToECBlocks.get(dn);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private LightWeightHashSet<Block> getBlocksSet(final DatanodeInfo dn,
|
||||
final Block block) {
|
||||
|
|
Loading…
Reference in New Issue