sodonnel opened a new pull request, #6170:
URL: https://github.com/apache/ozone/pull/6170

   ## What changes were proposed in this pull request?
   
   The current status command only shows nodes where the disk balancer is 
RUNNING. The different states can be filtered via the -s switch (RUNNING, 
STOPPED, UNKNOWN).
   
   It would be better to just output all the states by default and then allow 
them to be filtered with the -s switch.
   
   This change also simplifies the code in the CLI command a little by using an 
enum for the status state value, rather than a string, which can result in 
better errors if a wrong value is given.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-10299
   
   ## How was this patch tested?
   
   Manually via docker compose. Now the output by default looks like:
   
   ```
   sodonnell@sodonnell-MBP16 ozone % docker exec -it ozone_scm_1 /bin/bash
   bash-4.2$ ozone admin datanode diskbalancer status
   Status result:
   Datanode                                           VolumeDensity Status 
Threshold BandwidthInMB ParallelThread
   ozone_datanode_1.ozone_default                     0.0 UNKNOWN 0.0 0 0
   ```
   
   If you give an incorrect status, you get a reasonable error:
   
   ```
   bash-4.2$ ozone admin datanode diskbalancer status --state RUNNI
   Invalid value for option '--state': expected one of [RUNNING, STOPPED, 
UNKNOWN] (case-sensitive) but was 'RUNNI'
   Usage: ozone admin datanode diskbalancer status [-hV] [-id=<scmServiceId>]
          [-s=<state>] [--scm=<scm>] [-d=<hosts>]...
   Get Datanode DiskBalancer Status
     -d, --datanodes=<hosts>   Get diskBalancer status on specific datanodes.
     -h, --help                Show this help message and exit.
         -id, --service-id=<scmServiceId>
                               ServiceId of SCM HA Cluster
     -s, --state=<state>       Display only datanodes with the given status:
                                 RUNNING, STOPPED, UNKNOWN.
         --scm=<scm>           The destination scm (host:port)
     -V, --version             Print version information and exit.
   ```


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