diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index c1ce60ebd8..e6cd46118e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -55,6 +55,8 @@ Trunk (unreleased changes) HDFS-2564. Cleanup unnecessary exceptions thrown and unnecessary casts. (Hari Mankude via eli) + HDFS-2572. Remove unnecessary double-check in DN#getHostName. (harsh) + OPTIMIZATIONS HDFS-2477. Optimize computing the diff between a block report and the namenode state. (Tomasz Nykiel via hairong) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java index 5cb94d1e83..917fe86206 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java @@ -454,11 +454,8 @@ private synchronized void setClusterId(String cid) throws IOException { private static String getHostName(Configuration config) throws UnknownHostException { - String name = null; // use configured nameserver & interface to get local hostname - if (config.get(DFS_DATANODE_HOST_NAME_KEY) != null) { - name = config.get(DFS_DATANODE_HOST_NAME_KEY); - } + String name = config.get(DFS_DATANODE_HOST_NAME_KEY); if (name == null) { name = DNS .getDefaultHost(config.get(DFS_DATANODE_DNS_INTERFACE_KEY,