hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Rawson <ryano...@gmail.com>
Subject Re: Why doesn't HConnectionManager implement double checked locking ?
Date Wed, 24 Aug 2011 03:14:28 GMT
Not really part of the high perf code path, I'd be interested in seeing
profiling that indicates otherwise.
On Aug 23, 2011 11:46 AM, "Akash Ashok" <thehellmaker@gmail.com> wrote:
> Hi,
> I have pasted the code below for HConnectionManager.getConnection
>
> public static HConnection getConnection(Configuration conf)
> throws ZooKeeperConnectionException {
> HConnectionKey connectionKey = new HConnectionKey(conf);
> synchronized (HBASE_INSTANCES) {
> HConnectionImplementation connection =
> HBASE_INSTANCES.get(connectionKey);
> if (connection == null) {
> connection = new HConnectionImplementation(conf);
> HBASE_INSTANCES.put(connectionKey, connection);
> }
> connection.incCount();
> return connection;
> }
> }
>
> just curious as to why double checked locking isn't implemented here ? Is
it
> because there's won't be too many threads calling this method
simultaneouly.
> ?
>
> Cheers,
> Akash A

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message