From e04b8a46c3088d13bf010f2959062e1440332bcc Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Sat, 14 Sep 2019 10:39:20 +0530 Subject: [PATCH] HDFS-14799. Do Not Call Map containsKey In Conjunction with get. Contributed by hemanthboyina. --- .../hdfs/server/blockmanagement/InvalidateBlocks.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) mode change 100644 => 100755 hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java old mode 100644 new mode 100755 index 7c837920c9..247ea62081 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java @@ -112,17 +112,11 @@ long getECBlocks() { } private LightWeightHashSet getBlocksSet(final DatanodeInfo dn) { - if (nodeToBlocks.containsKey(dn)) { - return nodeToBlocks.get(dn); - } - return null; + return nodeToBlocks.get(dn); } private LightWeightHashSet getECBlocksSet(final DatanodeInfo dn) { - if (nodeToECBlocks.containsKey(dn)) { - return nodeToECBlocks.get(dn); - } - return null; + return nodeToECBlocks.get(dn); } private LightWeightHashSet getBlocksSet(final DatanodeInfo dn,