Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3BF79CAAC for ; Thu, 3 May 2012 01:40:11 +0000 (UTC) Received: (qmail 80112 invoked by uid 500); 3 May 2012 01:40:10 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 80054 invoked by uid 500); 3 May 2012 01:40:10 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 79847 invoked by uid 99); 3 May 2012 01:40:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 May 2012 01:40:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 May 2012 01:40:09 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 56A4A42C806 for ; Thu, 3 May 2012 01:39:49 +0000 (UTC) Date: Thu, 3 May 2012 01:39:49 +0000 (UTC) From: "Tsz Wo (Nicholas), SZE (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <1543642301.19854.1336009189356.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <834825568.1315.1333213227456.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HDFS-3171) The DatanodeID "name" field is overloaded MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HDFS-3171?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D13267= 089#comment-13267089 ]=20 Tsz Wo (Nicholas), SZE commented on HDFS-3171: ---------------------------------------------- Hi Eli, the new DataNode.getDisplayName() method may throw NPE; see HADOOP-= 8348. =20 > The DatanodeID "name" field is overloaded=20 > ------------------------------------------ > > Key: HDFS-3171 > URL: https://issues.apache.org/jira/browse/HDFS-3171 > Project: Hadoop HDFS > Issue Type: Improvement > Components: data-node > Reporter: Eli Collins > Assignee: Eli Collins > Fix For: 2.0.0 > > Attachments: hdfs-3171.txt > > > The DatanodeID "name" field is currently overloaded, when the DN creates = a DatanodeID to register with the NN it sets "name" to be the datanode host= name, which is the DN's "hostName" member. This isnot necesarily a FQDN, it= is either set explicitly or determined by the DNS class, which could retur= n the machine's hostname or the result of a DNS lookup, if configured to do= so. The NN then clobbers the "name" field of the DatanodeID with the IP pa= rt of the new DatanodeID "name" field it creates (and sets the DatanodeID "= hostName" field to the reported "name"). The DN gets the DatanodeID back fr= om the NN and clobbers its "hostName" member with the "name" field of the r= eturned DatanodeID. This makes the code hard to reason about eg DN#getMachi= ne name sometimes returns a hostname and sometimes not, depending on when i= t's called in sequence with the registration. Ditto for uses of the "name" = field. I think these contortions were originally performed because the Data= nodeID didn't have a hostName field (it was part of DatanodeInfo) and so th= ere was no way to communicate both at the same time. Now that the hostName = field is in DatanodeID (as of HDFS-3164) we can establish the invariant tha= t the "name" field always and only has an IP address and the "hostName" fie= ld always and only has a hostname. > In HDFS-3144 I'm going to rename the "name" field so its clear that it co= ntains an IP address. The above is enough scope for one change. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira