[ 
https://issues.apache.org/jira/browse/HBASE-11707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16071458#comment-16071458
 ] 

Hudson commented on HBASE-11707:
--------------------------------

FAILURE: Integrated in Jenkins build HBase-2.0 #141 (See 
[https://builds.apache.org/job/HBase-2.0/141/])
HBASE-11707 Using Map instead of list in FailedServers of RpcClient (Liu 
(stack: rev f4c99a6a89b8c766eb4617df7c2e1520f56d209b)
* (edit) 
hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/FailedServers.java


> Using Map instead of list in FailedServers of RpcClient
> -------------------------------------------------------
>
>                 Key: HBASE-11707
>                 URL: https://issues.apache.org/jira/browse/HBASE-11707
>             Project: HBase
>          Issue Type: Improvement
>          Components: Client
>            Reporter: Liu Shaohui
>            Assignee: Liu Shaohui
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: HBASE-11707.master.001.patch, HBASE-11707-trunk-v1.diff, 
> HBASE-11707-trunk-v2.diff
>
>
> Currently, FailedServers uses a list to record the black list of servers and 
> iterate the list to check if a server is in list. It's not efficient when the 
> list is very large. And the list is not thread safe for the add and iteration 
> operations.
> RpcClient.java#175
> {code}
>       // iterate, looking for the search entry and cleaning expired entries
>       Iterator<Pair<Long, String>> it = failedServers.iterator();
>       while (it.hasNext()) {
>         Pair<Long, String> cur = it.next();
>          if (cur.getFirst() < now) {
>           it.remove();
>         } else {
>           if (lookup.equals(cur.getSecond())) {
>             return true;
>           }
>         }
> {code}
> A simple change is to change this list to ConcurrentHashMap.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to