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

sijie 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 20fc51c  Fixed journalQueueSize counter increment
20fc51c is described below

commit 20fc51cfddc5e271385795d7b180cf5d35b75a3e
Author: Matteo Merli <[email protected]>
AuthorDate: Fri Mar 16 20:41:03 2018 -0700

    Fixed journalQueueSize counter increment
    
    The `journalQueueSize` counter was only decremented.
    
    Moved the increment in the common method that is called in every path when 
adding to journal.
    
    Author: Matteo Merli <[email protected]>
    
    Reviewers: Enrico Olivelli <[email protected]>, Sijie Guo 
<[email protected]>
    
    This closes #1271 from merlimat/journal-stat
---
 .../src/main/java/org/apache/bookkeeper/bookie/Journal.java             | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 6173936..3d79acb 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
@@ -854,7 +854,6 @@ public class Journal extends BookieCriticalThread 
implements CheckpointSource {
     public void logAddEntry(ByteBuf entry, boolean ackBeforeSync, 
WriteCallback cb, Object ctx) {
         long ledgerId = entry.getLong(entry.readerIndex() + 0);
         long entryId = entry.getLong(entry.readerIndex() + 8);
-        journalQueueSize.inc();
         logAddEntry(ledgerId, entryId, entry, ackBeforeSync, cb, ctx);
     }
 
@@ -864,6 +863,7 @@ public class Journal extends BookieCriticalThread 
implements CheckpointSource {
         //Retain entry until it gets written to journal
         entry.retain();
 
+        journalQueueSize.inc();
         queue.add(QueueEntry.create(
                 entry, ackBeforeSync,  ledgerId, entryId, cb, ctx, 
MathUtils.nowInNano(),
                 journalAddEntryStats, journalQueueSize));

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to