Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-14268

Improve KeyLocker

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.2.0, 1.3.0, 2.0.0
    • util
    • None
    • Reviewed

    Description

      1. In the implementation of KeyLocker it uses atomic variables inside a synchronized block, which doesn't make sense. Moreover, logic inside the synchronized block is not trivial so that it makes less performance in heavy multi-threaded environment.
      2. KeyLocker gives an instance of RentrantLock which is already locked, but it doesn't follow the contract of ReentrantLock because you are not allowed to freely invoke lock/unlock methods under that contract. That introduces a potential risk; Whenever you see a variable of the type RentrantLock, you should pay attention to what the included instance is coming from.

      Attachments

        1. ReferenceTestApp.java
          0.9 kB
          Hiroshi Ikeda
        2. KeyLockerPerformance.java
          2 kB
          Hiroshi Ikeda
        3. KeyLockerIncrKeysPerformance.java
          1 kB
          Hiroshi Ikeda
        4. HBASE-14268-V7.patch
          18 kB
          Hiroshi Ikeda
        5. HBASE-14268-V7.patch
          18 kB
          Hiroshi Ikeda
        6. HBASE-14268-V7.patch
          18 kB
          Hiroshi Ikeda
        7. HBASE-14268-V7.patch
          18 kB
          Hiroshi Ikeda
        8. HBASE-14268-V7.patch
          18 kB
          Michael Stack
        9. HBASE-14268-V7.patch
          18 kB
          Michael Stack
        10. HBASE-14268-V7.patch
          18 kB
          Michael Stack
        11. HBASE-14268-V6.patch
          18 kB
          Hiroshi Ikeda
        12. HBASE-14268-V5.patch
          17 kB
          Hiroshi Ikeda
        13. HBASE-14268-V5.patch
          17 kB
          Hiroshi Ikeda
        14. HBASE-14268-V4.patch
          17 kB
          Hiroshi Ikeda
        15. HBASE-14268-V3.patch
          11 kB
          Hiroshi Ikeda
        16. HBASE-14268-V2.patch
          8 kB
          Hiroshi Ikeda
        17. HBASE-14268.patch
          8 kB
          Hiroshi Ikeda
        18. HBASE-14268.addendum.patch
          0.7 kB
          Yu Li
        19. 14268-V5.patch
          17 kB
          Ted Yu

        Issue Links

          Activity

            People

              ikeda Hiroshi Ikeda
              ikeda Hiroshi Ikeda
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: