errose28 commented on code in PR #6420:
URL: https://github.com/apache/ozone/pull/6420#discussion_r1540200869
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java:
##########
@@ -288,6 +309,9 @@ private void processRecords(ManagedRocksIterator iterator,
batch = new ArrayList<>(batchSize);
sequenceId++;
}
+ if ((preFileRecords > 0) && (count >= preFileRecords)) {
+ break;
+ }
Review Comment:
What's the expected behavior when this new `--max-records-per-file` flag is
used without `--out`? Right now it looks like the choice that `stdout` is
considered "one file" and so this flag overrides the `--length` option:
```
# The DB here has many more than 3 entries
$ ./ozone debug ldb --db=om.db scan --column_family=fileTable -l3
--max-records-per-file=2 | jq '.[].keyName' | wc -l
2
$ ./ozone debug ldb --db=om.db scan --column_family=fileTable -l2
--max-records-per-file=3 | jq '.[].keyName' | wc -l
2
```
Maybe we should disallow `--max-records-per-file` without `--out`.
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java:
##########
@@ -288,6 +309,9 @@ private void processRecords(ManagedRocksIterator iterator,
batch = new ArrayList<>(batchSize);
sequenceId++;
}
+ if ((preFileRecords > 0) && (count >= preFileRecords)) {
+ break;
+ }
Review Comment:
`-l` is also broken with this new option and I got a bit of a surprise
trying to test this 😄 I would have expected 5 files, here not 57 thousand.
```
$ ./ozone debug ldb --db=om.db scan --column_family=fileTable -l10
--max-records-per-file=2 --out=foo
^C
$ ls -l | grep foo | wc -l
57343
```
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java:
##########
@@ -148,6 +150,11 @@ public class DBScanner implements Callable<Void>,
SubcommandWithParent {
defaultValue = "10")
private int threadCount;
+ @CommandLine.Option(names = {"--max-records-per-file"},
+ description = "The number of print records per file.",
Review Comment:
```suggestion
description = "The number of records to print per file.",
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]