|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IResourceLockService
Interface named synchronous distributed locks without deadlock detection.
The other feature is distributed locks without deadlock detection. This is the kind of lock that you get with zookeeper. When running in a single JVM java.util.concurrent.locks provides this kind of locking. These locks are good for coordinating actions such as who is the master in some computation.
This second role (global synchronous locks without deadlock detection) can be
realized by a client library. When running in a single JVM, the
java.util.concurrent.locks package can provide the implementation. When
running in a distributed environment, zookeeper can provide the
implementation.
FIXME The main use of this interface today is creating and destroying
relations, relation containers, and their indices "atomically". Unisolated
operations CAN NOT be used to create more than a single resource atomically.
A full tx should be used instead. The place where this happens is
AbstractResource.acquireExclusiveLock(). That is invoked only when
creating or destroying a resource. All callers should be using a full tx
instead when creating or destroying a resource!
| Method Summary | |
|---|---|
IResourceLock |
acquireLock(String namespace)
Acquire an exclusive lock on the named resource. |
IResourceLock |
acquireLock(String namespace,
long timeout)
Acquire an exclusive lock the named resource. |
| Method Detail |
|---|
IResourceLock acquireLock(String namespace)
namespace - The named resource.
RuntimeException - wrapping InterruptedException or
TimeoutException
IResourceLock acquireLock(String namespace,
long timeout)
throws InterruptedException,
TimeoutException
namespace - The named resource.timeout - Timeout in milliseconds for the request -or-
Long.MAX_VALUE to wait forever.
TimeoutException
InterruptedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||