@InterfaceAudience.Private public class ZKInterProcessReadWriteLock extends Object implements InterProcessReadWriteLock
InterProcessReadWriteLock. This lock is fair,
not reentrant, and not revocable.| Constructor and Description |
|---|
ZKInterProcessReadWriteLock(ZooKeeperWatcher zkWatcher,
String znode,
InterProcessLock.MetadataHandler handler)
Creates a DistributedReadWriteLock instance.
|
| Modifier and Type | Method and Description |
|---|---|
ZKInterProcessReadLock |
readLock(byte[] metadata)
Obtain a read lock containing given metadata.
|
ZKInterProcessWriteLock |
writeLock(byte[] metadata)
Obtain a write lock containing given metadata.
|
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.public ZKInterProcessReadLock readLock(byte[] metadata)
readLock in interface InterProcessReadWriteLockmetadata - Serialized lock metadata (this may contain information
such as the process owning the lock or the purpose for
which the lock was acquired).public ZKInterProcessWriteLock writeLock(byte[] metadata)
writeLock in interface InterProcessReadWriteLockmetadata - Serialized lock metadata (this may contain information
such as the process owning the lock or the purpose for
which the lock was acquired).Copyright © 2014 The Apache Software Foundation. All rights reserved.