You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/01/15 21:14:49 UTC

[GitHub] athanatos commented on a change in pull request #968: Journal: add stat for cb queue size

athanatos commented on a change in pull request #968: Journal: add stat for cb queue size
URL: https://github.com/apache/bookkeeper/pull/968#discussion_r161616108
 
 

 ##########
 File path: bookkeeper-server/src/test/java/org/apache/bookkeeper/test/TestStatsProvider.java
 ##########
 @@ -62,12 +64,31 @@ public void dec() {
         @Override
         public void add(long delta) {
             val.addAndGet(delta);
+            updateMax();
         }
 
         @Override
         public Long get() {
             return val.get();
         }
+
+        public void updateMax() {
+            while (true) {
+                long curMax = max.get();
+                long curVal = val.get();
+                if (curVal <= curMax) {
+                    break;
+                } else {
+                    if (max.compareAndSet(curMax, curVal)) {
 
 Review comment:
   @eolivelli Ok, how about this version?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services