public interface XClusterLock
Modifier and Type | Method and Description |
---|---|
void |
acquire()
Acquires the cluster lock.
|
boolean |
acquire(long time,
TimeUnit timeUnit)
Acquire the lock - blocks until it's available or the given time expires.
|
String |
getLockPath()
Get the path used for acquiring the distributed lock.
|
boolean |
isAcquiredInThisProcess()
Returns true if the mutex is acquired by a thread in this JVM
|
void |
release()
Perform one release of the mutex if the calling thread is the same thread that acquired it.
|
boolean |
tryAcquire()
Tries to acquire the lock when called.
|
void acquire() throws Exception
Exception
- in connection interruptions and underlying distributed coordination provider's errorsboolean tryAcquire() throws Exception
Exception
- in zookeeper errors and connection errorsboolean acquire(long time, TimeUnit timeUnit) throws Exception
time
- time to waittimeUnit
- time unitException
- connection interruptionsvoid release() throws Exception
Exception
- interruptions, current thread does not own the lockUnreliableLockException
- if the connection was lost/session expired
while the lock was acquired and before being releasedboolean isAcquiredInThisProcess()
String getLockPath()
Copyright © 2016–2019 AdroitLogic. All rights reserved.