[
https://issues.apache.org/jira/browse/HBASE-10294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13864985#comment-13864985
]
Liang Xie commented on HBASE-10294:
-----------------------------------
agree for above case. and we should remove very carefully, since lots of master
side fixs are to add those sync, haha.
> Some synchronization on ServerManager#onlineServers can be removed
> ------------------------------------------------------------------
>
> Key: HBASE-10294
> URL: https://issues.apache.org/jira/browse/HBASE-10294
> Project: HBase
> Issue Type: Task
> Reporter: Ted Yu
> Priority: Minor
>
> ServerManager#onlineServers is a ConcurrentHashMap
> Yet I found that some accesses to it are synchronized and unnecessary.
> Here is one example:
> {code}
> public Map<ServerName, ServerLoad> getOnlineServers() {
> // Presumption is that iterating the returned Map is OK.
> synchronized (this.onlineServers) {
> return Collections.unmodifiableMap(this.onlineServers);
> {code}
> Note: not all accesses to ServerManager#onlineServers are synchronized.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)