hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Gray" <jl...@streamy.com>
Subject RE: O.a.h.h.r.getLock method is private
Date Tue, 02 Dec 2008 01:23:14 GMT
HRegion.obtainRowLock is used from HRegionServer to allow the client to
explicitly acquire and release row locks (their leases are tracked in HRS).
This requires that obtainRowLock be protected not private.

HRegion.getLock is really just a convenience function added to HR.  Prior to
explicit client locking, there used to just be calls to obtainRowLock.
getLock takes the specified lockId Integer passed to the HR method, and if
null, obtains a new row lock using obtainRowLock.

So the answer is that HR.getLock is an internal convenience function for HR
and does not need to be accessed from other classes.  Row locking logic
really lives in the protected method obtainRowLock which can be accessed
elsewhere.

Hope that helps.

Jonathan Gray
Streamy.com

> -----Original Message-----
> From: Ding, Hui [mailto:hui.ding@sap.com]
> Sent: Monday, December 01, 2008 4:20 PM
> To: hbase-dev@hadoop.apache.org
> Subject: O.a.h.h.r.getLock method is private
> 
> Just curious why is this so? Seems to me it should be protected,
> especially since the obtainRowLock method it invokes is protected.
> 
> Thanks.


Mime
View raw message