hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiroshi Ikeda (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-15802) ConnectionUtils should use ThreadLocalRandom instead of Random
Date Mon, 09 May 2016 05:52:12 GMT
Hiroshi Ikeda created HBASE-15802:
-------------------------------------

             Summary:  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
            Priority: Minor


{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