-
Notifications
You must be signed in to change notification settings - Fork 502
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-11476. Implement lesser/greater operation for --filter option of ldb scan command #7222
Conversation
"<operator> is (EQUALS,MAX or MIN) and " + | ||
"<operator> is (EQUALS,LESSER or GREATER) and " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are removing MAX
& MIN
operators? that too in the scope of introducing 2 new operators?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to implement MAX and MIN, some code refactoring would be required. We would not be able to do batch processing as max/min cannot be calculated in batches. This could severely affect the performance. So having lesser/greater than operators could perform as a substitute for min/max.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since MIN/MAX operation do not match doing parallel processing of records in batches and generating output, so dropping this. But having alternative with < , > can be tuned to provide similar functionality of matching.
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
Show resolved
Hide resolved
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
Show resolved
Hide resolved
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/debug/TestLDBCli.java
Show resolved
Hide resolved
@ayushtkn thank you for the review. I have addressed the comments. Could you please review the updated patch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tejaskriya LGTM
"<operator> is (EQUALS,MAX or MIN) and " + | ||
"<operator> is (EQUALS,LESSER or GREATER) and " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since MIN/MAX operation do not match doing parallel processing of records in batches and generating output, so dropping this. But having alternative with < , > can be tuned to provide similar functionality of matching.
What changes were proposed in this pull request?
A --filter option was added recently which selects records that have a given value for a particular field will make debugging easier. (as a part of #7167)
Adding support for lesser/greater than operations will be useful while debugging
For example, if a value has many fields like [name, location->[address, DN, IP], version, lastUpdateTime],
A list of fields along with the value it should be compared to is given to the command, and only those records passing the condition it will be shown.
eg.) ozone debug ldb --db=/data/metadata/om.db scan --cf=volumeTable --filter="usedNamespace:greater:2,adminName:equals:impala"
In this PR, apart from adding the support for these 2 operations, some code refactoring is also done.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-11476
How was this patch tested?
Added tests in TestLDBCli
Tested locally with a local DB: