reddycharan commented on a change in pull request #1225: Issue #570: getting
rid of unnecessary synchronization in InterleavedLedgerStorage
URL: https://github.com/apache/bookkeeper/pull/1225#discussion_r171960386
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/InterleavedLedgerStorage.java
##########
@@ -360,10 +362,10 @@ public void checkpoint(Checkpoint checkpoint) throws
IOException {
@Override
public synchronized void flush() throws IOException {
- if (!somethingWritten) {
+ if (!somethingWritten.get()) {
Review comment:
changing it to compareAndSet.
but yeah I considered removing synchronized for flush method, but it is not
clear regarding the transactional guarantees of the underlying methods (methods
which get called by ILS.flush). So I didn't change this, moreover it is called
by requestFlush, which is called by SyncThread.shutdown and SyncThread.start,
which are one time events and not related to this work item. So left unchanged.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services