zymap commented on code in PR #3675:
URL: https://github.com/apache/bookkeeper/pull/3675#discussion_r1034236457
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/client/SimpleTestCommand.java:
##########
@@ -102,10 +105,15 @@ protected void run(BookKeeper bk, Flags flags) throws
Exception {
}
}
LOG.info("{} entries written to ledger {}", flags.numEntries,
wh.getId());
- if (flags.cleanup) {
- LOG.info("Cleaning up the ledger {}", wh.getId());
-
result(bk.newDeleteLedgerOp().withLedgerId(wh.getId()).execute());
+
+ try (ReadHandle rh =
result(bk.newOpenLedgerOp().withLedgerId(wh.getId()).withDigestType(DigestType.CRC32C)
+ .withPassword(new byte[0]).execute())) {
+ LedgerEntries ledgerEntries = rh.read(0, flags.numEntries);
+ for (LedgerEntry ledgerEntry : ledgerEntries) {
+ assert Arrays.equals(ledgerEntry.getEntryBytes(), data);
Review Comment:
The `assert` is always used to check whether the argument is null or not.
And we need to enable it with `-ea` when executing the program. Does it make
more sense to log errors or throw exceptions?
--
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]