@NotThreadSafe public class ZookeeperBasedLockProvider 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 |
| Constructor and Description |
|---|
ZookeeperBasedLockProvider(LockConfiguration lockConfiguration,
org.apache.hadoop.conf.Configuration conf) |
ZookeeperBasedLockProvider(LockConfiguration lockConfiguration,
org.apache.curator.framework.CuratorFramework curatorFrameworkClient) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected String |
generateLogStatement(LockState state,
String suffix) |
org.apache.curator.framework.recipes.locks.InterProcessMutex |
getLock() |
boolean |
tryLock(long time,
TimeUnit unit) |
void |
unlock() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitlock, lockInterruptibly, newCondition, tryLockprotected LockConfiguration lockConfiguration
public ZookeeperBasedLockProvider(LockConfiguration lockConfiguration, org.apache.hadoop.conf.Configuration conf)
public ZookeeperBasedLockProvider(LockConfiguration lockConfiguration, org.apache.curator.framework.CuratorFramework curatorFrameworkClient)
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 © 2022 The Apache Software Foundation. All rights reserved.