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

ryan rawson commented on HBASE-2508:
------------------------------------

lockIdGenerator does not need to be volatile.  It is always accessed under the 
pervue of the synchronized(lockedRows) lock.  

Again, all access to the lockIds datastructure is done under the purvue of the 
synchronized(lockedRows) monitor lock.  There is no momentary inconsistency 
because all access to this data structure is done under a lock thus ensuring 
that the change is atomic as far as other threads are concerned.


> Use AtomicInteger for lockIdGenerator in HRegion
> ------------------------------------------------
>
>                 Key: HBASE-2508
>                 URL: https://issues.apache.org/jira/browse/HBASE-2508
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 0.20.3
>            Reporter: Ted Yu
>
> Currently lockIdGenerator is an int. In obtainRowLock(), retry is needed in 
> case of lockId collisions.
> We can declare lockIdGenerator as AtomicInteger and use incrementAndGet() to 
> get the next lock Id.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to