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 CD6E4200B77 for ; Wed, 27 Jul 2016 01:26:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CA920160AA5; Tue, 26 Jul 2016 23:26:22 +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 488E3160AA7 for ; Wed, 27 Jul 2016 01:26:22 +0200 (CEST) Received: (qmail 4838 invoked by uid 500); 26 Jul 2016 23:26:21 -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 4632 invoked by uid 99); 26 Jul 2016 23:26:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jul 2016 23:26:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D69E82C0D5D for ; Tue, 26 Jul 2016 23:26:20 +0000 (UTC) Date: Tue, 26 Jul 2016 23:26:20 +0000 (UTC) From: "Ted Yu (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-16275) Change ServerManager#onlineServers from ConcurrentHashMap to ConcurrentSkipListMap MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 26 Jul 2016 23:26:23 -0000 [ https://issues.apache.org/jira/browse/HBASE-16275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15394765#comment-15394765 ] Ted Yu commented on HBASE-16275: -------------------------------- lgtm Do the failed tests pass locally ? > 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 > Attachments: HBASE-16275-v001.patch, HBASE-16275-v002.patch, TestServerManagerPerf.java > > > 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)