@InterfaceAudience.Private public class ZKInterProcessWriteLock extends ZKInterProcessLockBase
ZKInterProcessLockBase.AcquiredLock, ZKInterProcessLockBase.ZNodeComparator
InterProcessLock.MetadataHandler
acquiredLock, childZNode, fullyQualifiedZNode, handler, metadata, parentLockNode, READ_LOCK_CHILD_NODE_PREFIX, WRITE_LOCK_CHILD_NODE_PREFIX, zkWatcher
Constructor and Description |
---|
ZKInterProcessWriteLock(ZooKeeperWatcher zooKeeperWatcher,
String znode,
byte[] metadata,
InterProcessLock.MetadataHandler handler) |
Modifier and Type | Method and Description |
---|---|
protected String |
getLockPath(String createdZNode,
List<String> children)
Determine based on a list of children under a ZNode, whether or not a
process which created a specified ZNode has obtained a lock.
|
acquire, handleLockMetadata, handleLockMetadata, isChildOfSameType, isChildReadLock, isChildWriteLock, reapAllLocks, reapExpiredLocks, release, tryAcquire, updateAcquiredLock, visitLocks
public ZKInterProcessWriteLock(ZooKeeperWatcher zooKeeperWatcher, String znode, byte[] metadata, InterProcessLock.MetadataHandler handler)
protected String getLockPath(String createdZNode, List<String> children) throws IOException
getLockPath
in class ZKInterProcessLockBase
createdZNode
- The ZNode created by the process attempting to acquire
a lockchildren
- List of all child ZNodes under the lock's parent ZNodeIOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.