@NotThreadSafe public abstract class BaseZookeeperBasedLockProvider extends Object implements LockProvider<org.apache.curator.framework.recipes.locks.InterProcessMutex>, Serializable
LockProvider implementation allows to lock table operations
using zookeeper. Users need to have a Zookeeper cluster deployed to be able to use this lock.| Modifier and Type | Field and Description |
|---|---|
protected LockConfiguration |
lockConfiguration |
protected String |
lockKey |
protected String |
zkBasePath |
| Constructor and Description |
|---|
BaseZookeeperBasedLockProvider(LockConfiguration lockConfiguration,
StorageConfiguration<?> conf) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected String |
generateLogStatement(LockState state,
String suffix) |
protected String |
generateLogSuffixString() |
org.apache.curator.framework.recipes.locks.InterProcessMutex |
getLock() |
protected abstract String |
getLockKey(LockConfiguration lockConfiguration) |
protected String |
getLockPath() |
protected abstract String |
getZkBasePath(LockConfiguration lockConfiguration) |
boolean |
tryLock(long time,
TimeUnit unit) |
void |
unlock() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCurrentOwnerLockInfo, lock, lockInterruptibly, newCondition, tryLockprotected final LockConfiguration lockConfiguration
protected final String zkBasePath
protected final String lockKey
public BaseZookeeperBasedLockProvider(LockConfiguration lockConfiguration, StorageConfiguration<?> conf)
protected abstract String getZkBasePath(LockConfiguration lockConfiguration)
protected abstract String getLockKey(LockConfiguration lockConfiguration)
protected String generateLogSuffixString()
protected String getLockPath()
public void close()
close in interface AutoCloseableclose in interface LockProvider<org.apache.curator.framework.recipes.locks.InterProcessMutex>public org.apache.curator.framework.recipes.locks.InterProcessMutex getLock()
getLock in interface LockProvider<org.apache.curator.framework.recipes.locks.InterProcessMutex>Copyright © 2024 The Apache Software Foundation. All rights reserved.