You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/03/15 17:49:53 UTC

[GitHub] merlimat opened a new pull request #1264: Refactored LAC cache in DbLedgerStorage

merlimat opened a new pull request #1264: Refactored LAC cache in DbLedgerStorage
URL: https://github.com/apache/bookkeeper/pull/1264
 
 
   The `TransientLedgerInfo` cache that holds the LAC (or explicit lac) for all ledgers has showed up in the profiler as a big contention point. 
   
   ### Modifications 
   
    * Only add an item in `TransientLedgerInfo` is someone has asked for LAC or has set explicity LAC. This will save lot of memory if many ledger are not requiring the LAC info.
    * Use `ConcurrentLongHashMap` to store the `TransientLedgerInfo`. There are few advantages: 
      - Key in the map is `long` and doesn't need boxing
      - The `get()` operation uses a stamped lock which is ideal in cases the number of `get()` is way bigger than `put()` operations, since it only needs a volatile variable read. In this case the map is only updated when new ledgers are added / removed, but we do a `get()` on each `addEntry()` operation.
     - Schedule periodical cleanup of the map for stale ledger info entries

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services