You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Ted Yu (JIRA)" <ji...@apache.org> on 2016/05/21 17:16:12 UTC
[jira] [Reopened] (HBASE-15802) ConnectionUtils should use
ThreadLocalRandom instead of Random
[ https://issues.apache.org/jira/browse/HBASE-15802?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ted Yu reopened HBASE-15802:
----------------------------
> 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
> 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)