ChenSammi commented on code in PR #9712:
URL: https://github.com/apache/ozone/pull/9712#discussion_r2908998365


##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerReportSubcommand.java:
##########
@@ -91,15 +95,20 @@ private String 
generateReport(List<DatanodeDiskBalancerInfoProto> protos) {
         Double.compare(b.getCurrentVolumeDensitySum(), 
a.getCurrentVolumeDensitySum()));
 
     StringBuilder formatBuilder = new StringBuilder("Report result:%n" +
-        "%-50s %s%n");
+        "%-60s %s%n");
 
     List<String> contentList = new ArrayList<>();
     contentList.add("Datanode");
     contentList.add("VolumeDensity");
 
     for (DatanodeDiskBalancerInfoProto proto : sortedProtos) {
-      formatBuilder.append("%-50s %s%n");
-      contentList.add(proto.getNode().getHostName());
+      formatBuilder.append("%-60s %s%n");
+      // Format datanode string with hostname and IP address
+      String[] hostnameIpPort = 
DiskBalancerSubCommandUtil.extractHostIpAndPort(

Review Comment:
   It looks like extractHostIpAndPort and getDatanodeHostAndIp can be merged as 
one function, so you don't need to convert the port from int to string, then 
string to int. 



-- 
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]

Reply via email to