hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [hadoop] ChenSammi commented on a change in pull request #937: HDDS-1663. Add datanode to network topology cluster during node regis…
Date Tue, 11 Jun 2019 02:38:08 GMT
ChenSammi commented on a change in pull request #937: HDDS-1663. Add datanode to network topology
cluster during node regis…
URL: https://github.com/apache/hadoop/pull/937#discussion_r292258632
 
 

 ##########
 File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java
 ##########
 @@ -228,14 +251,27 @@ public RegisteredCommand register(
       datanodeDetails.setIpAddress(dnAddress.getHostAddress());
     }
     try {
+      String location;
+      if (useHostname) {
+        datanodeDetails.setNetworkName(datanodeDetails.getHostName());
+        location = nodeResolve(datanodeDetails.getHostName());
+      } else {
+        datanodeDetails.setNetworkName(datanodeDetails.getIpAddress());
+        location = nodeResolve(datanodeDetails.getIpAddress());
+      }
+      if (location != null) {
 
 Review comment:
   All current implemented DNSToSwitchMapping classes which resolve node to location will
return "/default-rack" if can not find a match location. But this behavior is clearly defined
in the interface definition. So the location null check is kept here to avoid future break
of this assumption if new DNSToSwitchMapping class is introduced. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message