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

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

even though a regionserver may run arbitrarily long, i dont think we will be 
wrapping around an int during the length of a long - the maximal length of a 
row lock is on the order of 60 seconds (the timeout in HRS lease expiry for 
locks).  Otherwise a lock lasts for the time it takes to sync to a hlog.  If we 
are taking arbitrarily long to sync in HLog we have other problems on our hands.

Also there is no reason to use an AtomicInteger, the access to this variable 
are mediated by a sync lock, that is good enough.

> 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