Class ZookeeperDistributedLock
- java.lang.Object
-
- org.apache.shardingsphere.mode.repository.cluster.zookeeper.lock.ZookeeperDistributedLock
-
- All Implemented Interfaces:
DistributedLock
public final class ZookeeperDistributedLock extends Object implements DistributedLock
ZooKeeper distributed lock.
-
-
Constructor Summary
Constructors Constructor Description ZookeeperDistributedLock(String lockKey, org.apache.curator.framework.CuratorFramework client)
-
-
-
Constructor Detail
-
ZookeeperDistributedLock
public ZookeeperDistributedLock(String lockKey, org.apache.curator.framework.CuratorFramework client)
-
-
Method Detail
-
tryLock
public boolean tryLock(long timeoutMillis)
- Specified by:
tryLockin interfaceDistributedLock
-
unlock
public void unlock()
- Specified by:
unlockin interfaceDistributedLock
-
-