hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-15802) ConnectionUtils should use ThreadLocalRandom instead of Random
Date Sun, 22 May 2016 18:46:12 GMT

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

Hudson commented on HBASE-15802:
--------------------------------

SUCCESS: Integrated in HBase-1.4 #171 (See [https://builds.apache.org/job/HBase-1.4/171/])
HBASE-15802 ConnectionUtils should use ThreadLocalRandom instead of (tedyu: rev 6738dbadac926726341d1011d158015a5cc3bb9e)
* hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestConnectionUtils.java
* hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionUtils.java


>  ConnectionUtils should use ThreadLocalRandom instead of Random
> ---------------------------------------------------------------
>
>                 Key: HBASE-15802
>                 URL: https://issues.apache.org/jira/browse/HBASE-15802
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Hiroshi Ikeda
>            Assignee: Matt Warhaftig
>            Priority: Minor
>             Fix For: 2.0.0, 1.4.0
>
>         Attachments: hbase-15802.patch
>
>
> {code}
> public final class ConnectionUtils {
> ...skip...
>   private static final Random RANDOM = new Random();
> {code}
> In general, static fields are accessed by multi-threads. The class Random is thread-safe
but ThreadLocalRandom is more preferable because of less contention.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message