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

Change ServerManager#onlineServers from ConcurrentHashMap to ConcurrentSkipListMap

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0, 0.98.21, 2.0.0
    • Component/s: None
    • Labels:
      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-v002.patch
          1 kB
          Hua Xiang
        2. TestServerManagerPerf.java
          7 kB
          Hua Xiang
        3. HBASE-16275-v001.patch
          2 kB
          Hua Xiang

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: