Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 51D37200CC7 for ; Sun, 2 Jul 2017 02:36:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 50817160BF8; Sun, 2 Jul 2017 00:36:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9FD54160BEA for ; Sun, 2 Jul 2017 02:36:05 +0200 (CEST) Received: (qmail 64402 invoked by uid 500); 2 Jul 2017 00:36:04 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 64391 invoked by uid 99); 2 Jul 2017 00:36:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Jul 2017 00:36:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 3D511C02C8 for ; Sun, 2 Jul 2017 00:36:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id wegzMXLZQcWT for ; Sun, 2 Jul 2017 00:36:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id C8CCC5F297 for ; Sun, 2 Jul 2017 00:36:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8289CE0663 for ; Sun, 2 Jul 2017 00:36:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1B99A245D8 for ; Sun, 2 Jul 2017 00:36:00 +0000 (UTC) Date: Sun, 2 Jul 2017 00:36:00 +0000 (UTC) From: "Hudson (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-11707) Using Map instead of list in FailedServers of RpcClient MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 02 Jul 2017 00:36:06 -0000 [ https://issues.apache.org/jira/browse/HBASE-11707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16071456#comment-16071456 ] Hudson commented on HBASE-11707: -------------------------------- SUCCESS: Integrated in Jenkins build HBase-Trunk_matrix #3294 (See [https://builds.apache.org/job/HBase-Trunk_matrix/3294/]) HBASE-11707 Using Map instead of list in FailedServers of RpcClient (Liu (stack: rev f1b97a6aa0206636cdfeafaad70af914e91979d3) * (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> it = failedServers.iterator(); > while (it.hasNext()) { > Pair 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)