lhotari commented on code in PR #25127:
URL: https://github.com/apache/pulsar/pull/25127#discussion_r2767614874
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpScan.java:
##########
Review Comment:
Please change the log level to `info`.
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpScan.java:
##########
@@ -69,29 +69,23 @@ public void readEntriesComplete(List<Entry> entries, Object
ctx) {
try {
Position lastPositionForBatch = entries.get(entries.size() -
1).getPosition();
lastSeenPosition = lastPositionForBatch;
- // filter out the entry if it has been already deleted
- // filterReadEntries will call entry.release if the entry is
filtered out
- List<Entry> entriesFiltered =
this.cursor.filterReadEntries(entries);
- int skippedEntries = entries.size() - entriesFiltered.size();
- remainingEntries.addAndGet(-skippedEntries);
- if (!entriesFiltered.isEmpty()) {
- for (Entry entry : entriesFiltered) {
- if (remainingEntries.decrementAndGet() <= 0) {
- log.warn("[{}] Scan abort after reading too many
entries", OpScan.this.cursor);
- callback.scanComplete(lastSeenPosition,
ScanOutcome.ABORTED, OpScan.this.ctx);
- return;
- }
- if (!condition.test(entry)) {
- log.warn("[{}] Scan abort due to user code",
OpScan.this.cursor);
- callback.scanComplete(lastSeenPosition,
ScanOutcome.USER_INTERRUPTED, OpScan.this.ctx);
- return;
- }
+ for (Entry entry : entries) {
+ if (remainingEntries.getAndDecrement() <= 0) {
+ log.warn("[{}] Scan abort after reading too many entries",
OpScan.this.cursor);
Review Comment:
It's not a problem caused by this PR, but I think that `warn` level is too
high for this log message. It would be expected that the broker would scan a
certain amount of entries in a single request and therefore there's no need to
warn about it.
Please change the log level to `info`.
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpScan.java:
##########
Review Comment:
Please change the log level to `info`.
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpScan.java:
##########
@@ -69,29 +69,23 @@ public void readEntriesComplete(List<Entry> entries, Object
ctx) {
try {
Position lastPositionForBatch = entries.get(entries.size() -
1).getPosition();
lastSeenPosition = lastPositionForBatch;
- // filter out the entry if it has been already deleted
- // filterReadEntries will call entry.release if the entry is
filtered out
- List<Entry> entriesFiltered =
this.cursor.filterReadEntries(entries);
- int skippedEntries = entries.size() - entriesFiltered.size();
- remainingEntries.addAndGet(-skippedEntries);
- if (!entriesFiltered.isEmpty()) {
- for (Entry entry : entriesFiltered) {
- if (remainingEntries.decrementAndGet() <= 0) {
- log.warn("[{}] Scan abort after reading too many
entries", OpScan.this.cursor);
- callback.scanComplete(lastSeenPosition,
ScanOutcome.ABORTED, OpScan.this.ctx);
- return;
- }
- if (!condition.test(entry)) {
- log.warn("[{}] Scan abort due to user code",
OpScan.this.cursor);
- callback.scanComplete(lastSeenPosition,
ScanOutcome.USER_INTERRUPTED, OpScan.this.ctx);
- return;
- }
+ for (Entry entry : entries) {
+ if (remainingEntries.getAndDecrement() <= 0) {
+ log.warn("[{}] Scan abort after reading too many entries",
OpScan.this.cursor);
+ callback.scanComplete(lastSeenPosition,
ScanOutcome.ABORTED, OpScan.this.ctx);
+ return;
+ }
+ if (!condition.test(entry)) {
+ log.warn("[{}] Scan abort due to user code",
OpScan.this.cursor);
Review Comment:
Please change the log level to `info`.
--
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]