sijie commented on a change in pull request #220: BOOKKEEPER-1095: Long Poll - 
Server and Client Side Changes
URL: https://github.com/apache/bookkeeper/pull/220#discussion_r127829654
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java
 ##########
 @@ -102,14 +101,34 @@ synchronized Long getLastAddConfirmed() {
         return lac;
     }
 
-    synchronized long setLastAddConfirmed(long lac) {
-        if (null == this.lac || this.lac < lac) {
-            this.lac = lac;
+    long setLastAddConfirmed(long lac) {
+        long lacToReturn;
+        synchronized (this) {
+            if (null == this.lac || this.lac < lac) {
+                this.lac = lac;
+                setChanged();
+            }
+            lacToReturn = this.lac;
+        }
+        LOG.trace("Updating LAC {} , {}", lacToReturn, lac);
+
+
+        notifyObservers(new LastAddConfirmedUpdateNotification(lacToReturn));
 
 Review comment:
   @merlimat it is a bit hard to that at this moment, because #notifyObservers 
is a method of Observable. unless we changed the implementation to not use 
Observable. I will leave it for now and change it later.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to