org.apache.hadoop.hbase
Class HLocking

java.lang.Object
  extended by org.apache.hadoop.hbase.HLocking

public class HLocking
extends Object

HLocking is a set of lock primitives that does not rely on a particular thread holding the monitor for an object. This is especially important when a lock must persist over multiple RPC's since there is no guarantee that the same Server thread will handle all the RPC's until the lock is released. Not requiring that the locker thread is same as unlocking thread is the key distinction between this class and ReentrantReadWriteLock.

For each independent entity that needs locking, create a new HLocking instance.


Constructor Summary
HLocking()
          Constructor
 
Method Summary
 void obtainReadLock()
          Caller needs the no-nexclusive read-lock
 void obtainWriteLock()
          Caller needs the exclusive write-lock
 void releaseReadLock()
          Caller is finished with the non-exclusive read-lock
 void releaseWriteLock()
          Caller is finished with the write lock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HLocking

public HLocking()
Constructor

Method Detail

obtainReadLock

public void obtainReadLock()
Caller needs the no-nexclusive read-lock


releaseReadLock

public void releaseReadLock()
Caller is finished with the non-exclusive read-lock


obtainWriteLock

public void obtainWriteLock()
Caller needs the exclusive write-lock


releaseWriteLock

public void releaseWriteLock()
Caller is finished with the write lock



Copyright © 2006 The Apache Software Foundation