Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-11782. ozone debug ldb --with-keys defaults to false instead of true #7521

Merged
merged 4 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The third equivalent option to test here is --with-keys=true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review, I have added this case too now

${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
Loading