HDFS-2572. Remove Unnecessary double-check in DN#getHostName (harsh)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1204177 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Harsh J 2011-11-20 15:18:14 +00:00
parent 5573b691d5
commit 67f25b0a1b
2 changed files with 3 additions and 4 deletions

View File

@ -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)

View File

@ -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,