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

Change ServerManager#onlineServers from ConcurrentHashMap to ConcurrentSkipListMap

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.4.0, 0.98.21, 2.0.0
    • None
    • None

    Description

      In Class ServerManager, onlineServers is declared as ConcurrentHashMap. In findServerWithSameHostnamePortWithLock(), it has to do a loop to find if there is a ServerName with same host:port pair. If replaced with ConcurrentSkipListMap, findServerWithSameHostnamePortWithLock() can be replaced with a O(logN) implementation.

      I run some performance comparison(test the function only), it seems that there is no difference if there are 1000 servers. With more servers, ConcurrentSkipListMap implementation is going to win big.

      Attachments

        1. HBASE-16275-v001.patch
          2 kB
          Hua Xiang
        2. HBASE-16275-v002.patch
          1 kB
          Hua Xiang
        3. TestServerManagerPerf.java
          7 kB
          Hua Xiang

        Issue Links

          Activity

            People

              huaxiang Hua Xiang
              huaxiang Hua Xiang
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: