bookkeeper
bookkeeper copied to clipboard
LedgerHandle: eliminate unnecessasary synchronization on LedgerHandle.getLength()
Motivation
I have seen that calling getLength() creates unnecessary contention with threads that are appending entries. This can be easily eliminate by using AtomicLong.
I cannot share flame graphs as I have found this on some propriatery application using BookKeeper.
Changes
- move LedgerHandle length to AtomicLong
- remove
synchronizedin LedgerHandle.getLength()