Gargi-jais11 opened a new pull request, #9712:
URL: https://github.com/apache/ozone/pull/9712
## 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]
```
--
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]