This is an automated email from the ASF dual-hosted git repository.

merlimat pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new bcb3e708f1 Skip journal flush-trace loop when debug logging is 
disabled (#4835)
bcb3e708f1 is described below

commit bcb3e708f1cab463ed83972658122531757948e4
Author: Matteo Merli <[email protected]>
AuthorDate: Tue Jul 14 08:26:05 2026 -0700

    Skip journal flush-trace loop when debug logging is disabled (#4835)
---
 .../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);

Reply via email to