Skip to content

Commit

Permalink
HDDS-11782. ozone debug ldb --with-keys defaults to false instead of …
Browse files Browse the repository at this point in the history
…true (apache#7521)
  • Loading branch information
Tejaskriya authored Dec 4, 2024
1 parent cb0a402 commit e8ad7ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug-ldb.robot
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ Test ozone debug ldb scan
Should contain ${output} testfile1
Should contain ${output} testfile2
Should contain ${output} testfile3
# test key is included with --with-keys
${output1} = Execute ozone debug ldb --db=/data/metadata/om.db scan --cf=keyTable | jq '."\/cli-debug-volume\/cli-debug-bucket\/testfile1"'
${output2} = Execute ozone debug ldb --db=/data/metadata/om.db scan --cf=keyTable --with-keys | jq '."\/cli-debug-volume\/cli-debug-bucket\/testfile1"'
${output3} = Execute ozone debug ldb --db=/data/metadata/om.db scan --cf=keyTable --with-keys=true | jq '."\/cli-debug-volume\/cli-debug-bucket\/testfile1"'
Should contain ${output1} testfile1
Should Be Equal ${output1} ${output2}
Should Be Equal ${output1} ${output3}
# test key is ommitted with --with-keys set to false
${output} = Execute and Ignore Error ozone debug ldb --db=/data/metadata/om.db scan --cf=keyTable --with-keys=false | jq '."\/cli-debug-volume\/cli-debug-bucket\/testfile1"'
Should contain ${output} Cannot index array with string
# test startkey option
${output} = Execute ozone debug ldb --db=/data/metadata/om.db scan --cf=keyTable --startkey="/cli-debug-volume/cli-debug-bucket/testfile2"
Should not contain ${output} testfile1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public class DBScanner implements Callable<Void>, SubcommandWithParent {
@CommandLine.Option(names = {"--with-keys"},
description = "Print a JSON object of key->value pairs (default)"
+ " instead of a JSON array of only values.",
defaultValue = "true")
defaultValue = "true", fallbackValue = "true")
private boolean withKey;

@CommandLine.Option(names = {"--length", "--limit", "-l"},
Expand Down

0 comments on commit e8ad7ad

Please sign in to comment.