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:[EMAIL PROTECTED] > Sent: Monday, December 01, 2008 4:20 PM > To: [email protected] > 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.
