Ethan Rose created HDDS-11782:
---------------------------------

             Summary: ozone debug ldb --with-keys defaults to false instead of 
true
                 Key: HDDS-11782
                 URL: https://issues.apache.org/jira/browse/HDDS-11782
             Project: Apache Ozone
          Issue Type: Bug
            Reporter: Ethan Rose


*Observed Behavior:*
Using {{ozone debug ldb}} {{--with-keys=true}}  or no {{--with-keys}}  flag 
will print the keys, but {{--with-keys}}  will not print the keys, defaulting 
to the same as {{{}--with-keys=false{}}}.

*Explanation*
We use PicoCLI for our CLI and when we define options like {{--with-keys}} 
there are two options we can set:
 * 
[defaultValue|https://picocli.info/apidocs/picocli/CommandLine.Option.html#defaultValue--]:
 What will be used when the {{--with-keys}}  flag is not specified at all
 * 
[fallbackValue|https://picocli.info/apidocs/picocli/CommandLine.Option.html#fallbackValue--]:
 What will be used when {{--with-keys}}  is specified with no argument

In the 
[code|https://github.com/apache/ozone/blob/256aad9df2121946c307daceb512588a8319a81a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java#L109]
 we only set the {{defaultValue}}  to {{true}}  which leaves the 
{{fallbackValue}}  as {{false}}  leading to this unexpected behavior. We should 
check other CLI flags for this behavior and use acceptance tests to verify 
proper end-to-end interpretation of CLI flags.



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