Skip to content

HDDs-14195. [DiskBalancer] Improve DiskBalancer CLI Output Readability and Usability#9712

Open
Gargi-jais11 wants to merge 5 commits intoapache:masterfrom
Gargi-jais11:HDDS-14195
Open

HDDs-14195. [DiskBalancer] Improve DiskBalancer CLI Output Readability and Usability#9712
Gargi-jais11 wants to merge 5 commits intoapache:masterfrom
Gargi-jais11:HDDS-14195

Conversation

@Gargi-jais11
Copy link
Contributor

What changes were proposed in this pull request?

There are few issues with usability and readability of diskbalancer cli output:

Firstly, used set instead of list to store dnHostName for cli output so that it doesn't display duplicate hostnames if user give any diskbalancer command for same hostname twice like below:

bash-5.1$ ozone admin datanode diskbalancer status ozone-datanode-1 ozone-datanode-1 --json
[ {
  "datanode" : "ozone-datanode-1.ozone_default",
  "action" : "status",
  "status" : "success",
  "serviceStatus" : "RUNNING",
  "threshold" : 10.0,
  "bandwidthInMB" : 10,
  "threads" : 5,
  "stopAfterDiskEven" : false,
  "successMove" : 0,
  "failureMove" : 0,
  "bytesMovedMB" : 0,
  "estBytesToMoveMB" : 0,
  "estTimeLeftMin" : 0
}, {
"datanode" : "ozone-datanode-1.ozone_default",
  "action" : "status",
  "status" : "success",
  "serviceStatus" : "RUNNING",
  "threshold" : 10.0,
  "bandwidthInMB" : 10,
  "threads" : 5,
  "stopAfterDiskEven" : false,
  "successMove" : 0,
  "failureMove" : 0,
  "bytesMovedMB" : 0,
  "estBytesToMoveMB" : 0,
  "estTimeLeftMin" 

Secondly, Instead of showing ip-address in json cli output show both ipaddress and dnHostName for better clarity.

bash-5.1$ ozone admin datanode diskbalancer stop --in-service-datanodes --json
[ {
"datanode" : "ozone-datanode-1 (172.18.0.5:19864)",
"action" : "stop",
"status" : "success"
}, {
"datanode" : "ozone-datanode-2 (172.18.0.9:19864)",
"action" : "stop",
"status" : "success"
}, {
"datanode" : "ozone-datanode-3 (172.18.0.10:19864)",
"action" : "stop",
"status" : "success"
}]

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14195

How was this patch tested?

Updated exisitng test cases.
Manually tested on docker cluster:

bash-5.1$ ozone admin datanode diskbalancer report --in-service-datanodes
Report result:
Datanode                                           VolumeDensity
ozone-datanode-4.ozone_default (172.19.0.10:19864) 0.0
ozone-datanode-2.ozone_default (172.19.0.5:19864)  0.0
ozone-datanode-5.ozone_default (172.19.0.8:19864)  0.0

bash-5.1$ ozone admin datanode diskbalancer status --in-service-datanodes
Status result:
Datanode                                                Status          Threshold(%)    BandwidthInMB   Threads      StopAfterDiskEven    SuccessMove  FailureMove  BytesMoved(MB)  EstBytesToMove(MB) EstTimeLeft(min)    
ozone-datanode-4.ozone_default (172.19.0.10:19864)      STOPPED         10.0000         10              5            true                 0            0            0               0                  0                   
ozone-datanode-2.ozone_default (172.19.0.5:19864)       STOPPED         10.0000         10              5            true                 0            0            0               0                  0                   
ozone-datanode-5.ozone_default (172.19.0.8:19864)       STOPPED         10.0000         10              5            true                 0            0            0               0                  0                   

bash-5.1$ ozone admin datanode diskbalancer start 172.19.0.9:19864                                  
Started DiskBalancer on nodes: [172.19.0.9:19864]

@Gargi-jais11 Gargi-jais11 marked this pull request as ready for review February 5, 2026 08:37
@Gargi-jais11 Gargi-jais11 marked this pull request as draft February 5, 2026 08:38
@Gargi-jais11 Gargi-jais11 marked this pull request as draft February 5, 2026 08:38
@Gargi-jais11 Gargi-jais11 marked this pull request as ready for review February 5, 2026 08:40
@Gargi-jais11
Copy link
Contributor Author

@ChenSammi Please review the PR. I have closed the last PR and opened a fresh one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant