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_r127828574
########## 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)); + return lacToReturn; + } + + synchronized Observable waitForLastAddConfirmedUpdate(long previousLAC, Observer observe) { + if ((null != lac && lac > previousLAC) + || isClosed || ((stateBits & STATE_FENCED_BIT) == STATE_FENCED_BIT)) { + LOG.trace("Wait For LAC {} , {}", this.lac, previousLAC); Review comment: done ---------------------------------------------------------------- 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