[ 
https://issues.apache.org/jira/browse/HDDS-14195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gargi Jaiswal updated HDDS-14195:
---------------------------------
    Description: 
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:
{code:java}
bash-5.1$ ozone admin datanode diskbalancer status ozone-datanode-1 
ozone-datanode-3 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-3.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" : 0
} ] {code}
Secondly, Instead of showing ip-address in json cli output show both 
*ipaddress* and *dnHostName* for better clarity.
{code:java}
bash-5.1$ ozone admin datanode diskbalancer stop --in-service-datanodes --json
[ {
  "datanode" : "172.18.0.5:19864",
  "action" : "stop",
  "status" : "success"
}, {
  "datanode" : "172.18.0.9:19864",
  "action" : "stop",
  "status" : "success"
}, {
  "datanode" : "172.18.0.10:19864",
  "action" : "stop",
  "status" : "success"
}, {
  "datanode" : "172.18.0.8:19864",
  "action" : "stop",
  "status" : "success"
}]
 {code}
{{ }}

  was:
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:
{code:java}
bash-5.1$ ozone admin datanode diskbalancer status ozone-datanode-1 
ozone-datanode-3 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-3.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" : 0
} ] {code}
Secondly, Instead of showing ip-address in json cli output show dnHostName for 
better clarity.
{code:java}
bash-5.1$ ozone admin datanode diskbalancer stop --in-service-datanodes --json
[ {
  "datanode" : "172.18.0.5:19864",
  "action" : "stop",
  "status" : "success"
}, {
  "datanode" : "172.18.0.9:19864",
  "action" : "stop",
  "status" : "success"
}, {
  "datanode" : "172.18.0.10:19864",
  "action" : "stop",
  "status" : "success"
}, {
  "datanode" : "172.18.0.8:19864",
  "action" : "stop",
  "status" : "success"
}]
 {code}
{{ }}


> [DiskBalancer] Improve DiskBalancer CLI Output Readability and Usability
> ------------------------------------------------------------------------
>
>                 Key: HDDS-14195
>                 URL: https://issues.apache.org/jira/browse/HDDS-14195
>             Project: Apache Ozone
>          Issue Type: Sub-task
>            Reporter: Gargi Jaiswal
>            Assignee: Gargi Jaiswal
>            Priority: Major
>              Labels: pull-request-available
>
> 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:
> {code:java}
> bash-5.1$ ozone admin datanode diskbalancer status ozone-datanode-1 
> ozone-datanode-3 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-3.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" : 0
> } ] {code}
> Secondly, Instead of showing ip-address in json cli output show both 
> *ipaddress* and *dnHostName* for better clarity.
> {code:java}
> bash-5.1$ ozone admin datanode diskbalancer stop --in-service-datanodes --json
> [ {
>   "datanode" : "172.18.0.5:19864",
>   "action" : "stop",
>   "status" : "success"
> }, {
>   "datanode" : "172.18.0.9:19864",
>   "action" : "stop",
>   "status" : "success"
> }, {
>   "datanode" : "172.18.0.10:19864",
>   "action" : "stop",
>   "status" : "success"
> }, {
>   "datanode" : "172.18.0.8:19864",
>   "action" : "stop",
>   "status" : "success"
> }]
>  {code}
> {{ }}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to