Version: latest
Supported Since: 17.01
Lock Feature provides the ability to get a lock or a sequence number for given key. This feature has separate APIs to get a distributed lock as well as a ReentrantLock which must be acquire and release using the same thread within the JVM as per the java-docs of the ReentrantLock
In order to get a better understanding about each API, let’s go through all the APIs in the lock feature in detail.
tryLock |
Parameters
Returns
This API will try to get a lock for the given If clustering is disabled, this API will assume this is a single node deployment and it will try to get a Semaphore based lock for the given path. As per the java-docs of the Semaphore, it’s not a distributed lock and it’s only applicable to a single JVM which owns the lock. |
||
releaseLock |
Parameters
This API will release the lock which is acquired for the given |
||
getNextSequenceNumber |
Parameters
Returns
Generates a sequence number which is the next in line of a sequence associated to the given If clustering is disabled, this API will assume this is a single node deployment and it will generate the sequence number which is only applicable to a single JVM which owns the sequence number. |
||
tryReentrantLock |
Parameters
Returns
This API will try to get a ReentrantLock for the given
|
||
releaseReentrantLock |
Parameters
This API will release the ReentrantLock which is acquired for the given |