@InterfaceAudience.Private public class ZKInterProcessReadWriteLock extends Object implements InterProcessReadWriteLock
InterProcessReadWriteLock. This lock is fair,
not reentrant, and not revocable.| 构造器和说明 |
|---|
ZKInterProcessReadWriteLock(ZooKeeperWatcher zkWatcher,
String znode,
InterProcessLock.MetadataHandler handler)
Creates a DistributedReadWriteLock instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 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 在接口中 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 © 2007–2021 The Apache Software Foundation. All rights reserved.