Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A975A19F33 for ; Fri, 29 Apr 2016 07:31:16 +0000 (UTC) Received: (qmail 38369 invoked by uid 500); 29 Apr 2016 07:31:13 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 38230 invoked by uid 500); 29 Apr 2016 07:31:13 -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 37857 invoked by uid 99); 29 Apr 2016 07:31:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Apr 2016 07:31:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 408A82C1F73 for ; Fri, 29 Apr 2016 07:31:13 +0000 (UTC) Date: Fri, 29 Apr 2016 07:31:13 +0000 (UTC) From: "Heng Chen (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-15702) Improve PerClientRandomNonceGenerator MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-15702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15263680#comment-15263680 ] Heng Chen commented on HBASE-15702: ----------------------------------- Any suggestions? > Improve PerClientRandomNonceGenerator > ------------------------------------- > > Key: HBASE-15702 > URL: https://issues.apache.org/jira/browse/HBASE-15702 > Project: HBase > Issue Type: Improvement > Reporter: Hiroshi Ikeda > Priority: Trivial > Fix For: 2.0.0 > > Attachments: HBASE-15702.patch, HBASE-15702_v1.patch, HBASE-15702_v2.patch, HBASE-15702_v3.patch, HBASE-15702_v4.patch > > > PerClientRandomNonceGenerator can be exposed to all the threads via the static field ConnectionManager.nonceGenerator, but PerClientRandomNonceGenerator uses Random, which should be ThreadLocalRandom or something. (See javadoc of Random.) > Moreover, ConnectionManager creates or refers the singleton instance of PerClientThreadLocalRandom with a lock or volatile, but it should be created as a static final field in PerClientThreadLocalRandom itself, and the creation will be postponed until the field is actually refereed and the class is being initialized. > The same can be said for ConnectionManager.NoNonceGenerator. -- This message was sent by Atlassian JIRA (v6.3.4#6332)