You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "huaxiang sun (JIRA)" <ji...@apache.org> on 2016/07/22 20:59:20 UTC
[jira] [Updated] (HBASE-16275) Change ServerManager#onlineServers
from ConcurrentHashMap to ConcurrentSkipListMap
[ https://issues.apache.org/jira/browse/HBASE-16275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
huaxiang sun updated HBASE-16275:
---------------------------------
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.
was:
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(log(n)) 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.
> Change ServerManager#onlineServers from ConcurrentHashMap to ConcurrentSkipListMap
> ----------------------------------------------------------------------------------
>
> Key: HBASE-16275
> URL: https://issues.apache.org/jira/browse/HBASE-16275
> Project: HBase
> Issue Type: Improvement
> Reporter: huaxiang sun
> Assignee: huaxiang sun
> Priority: Minor
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)