adoroszlai commented on code in PR #3835:
URL: https://github.com/apache/ozone/pull/3835#discussion_r1406370234
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java:
##########
@@ -379,34 +380,31 @@ public RegisteredCommand register(
datanodeDetails.setIpAddress(dnAddress.getHostAddress());
}
- String dnsName;
- String networkLocation;
+ final String ipAddress = datanodeDetails.getIpAddress();
+ final String hostName = datanodeDetails.getHostName();
datanodeDetails.setNetworkName(datanodeDetails.getUuidString());
- if (useHostname) {
- dnsName = datanodeDetails.getHostName();
- } else {
- dnsName = datanodeDetails.getIpAddress();
- }
- networkLocation = nodeResolve(dnsName);
+ String networkLocation = nodeResolve(useHostname ? hostName : ipAddress);
if (networkLocation != null) {
datanodeDetails.setNetworkLocation(networkLocation);
}
+ final UUID uuid = datanodeDetails.getUuid();
if (!isNodeRegistered(datanodeDetails)) {
try {
clusterMap.add(datanodeDetails);
nodeStateManager.addNode(datanodeDetails, layoutInfo);
// Check that datanode in nodeStateManager has topology parent set
DatanodeDetails dn = nodeStateManager.getNode(datanodeDetails);
Preconditions.checkState(dn.getParent() != null);
- addToDnsToUuidMap(dnsName, datanodeDetails.getUuid());
+ addToDnsToUuidMap(ipAddress, uuid);
Review Comment:
Thanks @sadanand48, updated.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]