From 46612c7a5135d20b20403780b47dd00654aab057 Mon Sep 17 00:00:00 2001 From: Haohui Mai Date: Fri, 12 Dec 2014 11:51:17 -0800 Subject: [PATCH] HDFS-7517. Remove redundant non-null checks in FSNamesystem#getBlockLocations. Contributed by Haohui Mai. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 5977ed79d22..9cd5b0591c1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -579,6 +579,9 @@ Release 2.7.0 - UNRELEASED HDFS-7497. Inconsistent report of decommissioning DataNodes between dfsadmin and NameNode webui. (Yongjun Zhang via wang) + HDFS-7517. Remove redundant non-null checks in FSNamesystem# + getBlockLocations. (wheat9) + Release 2.6.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index c17c4f51e1d..5dd5920c06d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -1782,10 +1782,6 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, logAuditEvent(true, "open", src); - if (res == null) { - return null; - } - if (res.updateAccessTime()) { writeLock(); final long now = now();