HDDS-10299. [DiskBalancer] Status command should output all statuses by default #6170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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). The current CLI gives no way to list "all nodes".
It would be better to just output all the states by default and then allow them to be filtered with the -s switch. That way, we can list all nodes, or filter down by a specific status.
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:
If you give an incorrect status, you get a reasonable error: