|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.zookeeper.lock.ZKInterProcessReadWriteLock
@InterfaceAudience.Private public class ZKInterProcessReadWriteLock
ZooKeeper based implementation of InterProcessReadWriteLock
. This lock is fair,
not reentrant, and not revocable.
Constructor Summary | |
---|---|
ZKInterProcessReadWriteLock(ZooKeeperWatcher zkWatcher,
String znode,
InterProcessLock.MetadataHandler handler)
Creates a DistributedReadWriteLock instance. |
Method Summary | |
---|---|
ZKInterProcessReadLock |
readLock(byte[] metadata)
Obtain a reader lock containing given metadata. |
ZKInterProcessWriteLock |
writeLock(byte[] metadata)
Obtain a writer lock containing given metadata. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ZKInterProcessReadWriteLock(ZooKeeperWatcher zkWatcher, String znode, InterProcessLock.MetadataHandler handler)
zkWatcher
- znode
- ZNode path for the lockhandler
- An object that will handle de-serializing and processing
the metadata associated with reader or writer locks
created by this object or null if none desired.Method Detail |
---|
public ZKInterProcessReadLock readLock(byte[] metadata)
readLock
in interface InterProcessReadWriteLock
metadata
- Serialized lock metadata (this may contain information
such as the process owning the lock or the purpose for
which the lock was acquired). Must not be null.
public ZKInterProcessWriteLock writeLock(byte[] metadata)
writeLock
in interface InterProcessReadWriteLock
metadata
- See documentation of metadata parameter in readLock()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |