You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by mm...@apache.org on 2026/07/14 15:30:13 UTC
(bookkeeper) 05/05: Skip journal flush-trace loop when debug logging is disabled (#4835)
This is an automated email from the ASF dual-hosted git repository.
merlimat pushed a commit to branch branch-4.18
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
commit 8fe398538c3a1d1f1a5c2549705003c99eb05378
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Tue Jul 14 08:26:05 2026 -0700
Skip journal flush-trace loop when debug logging is disabled (#4835)
(cherry picked from commit bcb3e708f1cab463ed83972658122531757948e4)
---
.../main/java/org/apache/bookkeeper/bookie/Journal.java | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java
index ad637f0156..44c392ed3f 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java
@@ -1151,14 +1151,17 @@ public class Journal implements CheckpointSource {
journalFlushWatcher.stop().elapsed(TimeUnit.NANOSECONDS), TimeUnit.NANOSECONDS);
// Trace the lifetime of entries through persistence
- for (QueueEntry e : toFlush) {
- if (e != null) {
- log.debug()
- .attr("ledgerId", e.ledgerId)
- .attr("entryId", e.entryId)
- .log("Written and queuing for flush");
+ RecyclableArrayList<QueueEntry> flushedEntries = toFlush;
+ log.debug(e -> {
+ for (QueueEntry entry : flushedEntries) {
+ if (entry != null) {
+ log.debug()
+ .attr("ledgerId", entry.ledgerId)
+ .attr("entryId", entry.entryId)
+ .log("Written and queuing for flush");
+ }
}
- }
+ });
journalStats.getForceWriteBatchEntriesStats()
.registerSuccessfulValue(numEntriesToFlush);