[ 
https://issues.apache.org/jira/browse/HADOOP-6397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806187#action_12806187
 ] 

Scott Chen commented on HADOOP-6397:
------------------------------------

The patch looks good to me.
A simple unit test would be using "localhost" and "127.0.0.1" to provide the 
basic checking.

In FsNamesystems.java resolveNetworkLocation():
    if (dnsToSwitchMapping instanceof CachedDNSToSwitchMapping) {
      // get the node's IP address
      names.add(node.getHost());
    } else {
This kind of logics should be hidden in the interface. The interface should be 
getting the same input (hostnames).
The above code pass IP to CachedDNSToSwitchMapping but pass hostname to other 
instances.
It would be good if this part can also be fixed in this patch.

> topology script called with host names instead of IP addresses
> --------------------------------------------------------------
>
>                 Key: HADOOP-6397
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6397
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.20.1
>            Reporter: Christian Kunz
>         Attachments: HADOOP-6397.patch
>
>
> According to the 'Hadoop Rack Awareness' section on 
> http://hadoop.apache.org/common/docs/r0.20.0/cluster_setup.html the 
> script/program topology.script.file.name can assume that names are passed in 
> as IP addresses.
> This seems to work for hdfs, but the rack-awareness of the JobTracker does 
> not always work, depending on the hostnames of the cluster, because of a bug 
> in the method normalizeHostName of org.apache.hadoop.net.NetUtils.java:
> It returns the host name as-is when it decides that the string passed-in is 
> already an IP but actually it checks whether the string starts with a valid 
> hex character!
> There is no need to check at all, because InetAddress.getByName is smart 
> enough to not do a dns lookup when the name is an IP address.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to