reddycharan commented on a change in pull request #1228: Issue #570: Move logic of unpersistedbytes to bufferedchannel URL: https://github.com/apache/bookkeeper/pull/1228#discussion_r172291826
########## File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannel.java ########## @@ -188,4 +246,12 @@ public synchronized void clear() { super.clear(); writeBuffer.clear(); } -} + + public synchronized int getNumOfBytesInWriteBuffer() { Review comment: actually I'm not seeing that method being used by either product code or by testcode, so will consider removing it (not sure why I added, probably used it in some testcode earlier). But if this is needed, then it should be synchronized because it is returning/getting the state of shared resource - "writeBuffer". "writeBuffer" is accessed within synchronized block in all other places in this class. ---------------------------------------------------------------- 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