| Constructor and Description |
|---|
LockStoreProxy(LockStoreContainer container,
ObjectNamespace namespace) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canAcquireLock(Data key,
String caller,
long threadId)
Return if the key can be locked by the caller and thread ID.
|
boolean |
extendLeaseTime(Data key,
String caller,
long threadId,
long leaseTime)
Extend the lease time for an already locked key.
|
boolean |
forceUnlock(Data key)
Unlock the key regardless of the owner.
|
int |
getLockCount(Data key)
Return the number of times a key was locked by the same owner (re-entered).
|
int |
getLockedEntryCount()
Return the number of locks this store holds.
|
Set<Data> |
getLockedKeys()
Return all locked keys for this store.
|
String |
getOwnerInfo(Data dataKey)
Return a string representation of the owner of the lock for a specific key.
|
long |
getRemainingLeaseTime(Data key)
Return the remaining lease time for a specific key.
|
boolean |
isLocked(Data key)
Check if a key is locked by any caller and thread ID.
|
boolean |
isLockedBy(Data key,
String caller,
long threadId)
Check if a key is locked by a specific caller and thread ID.
|
boolean |
localLock(Data key,
String caller,
long threadId,
long referenceId,
long leaseTime)
Lock a specific key on a local partition only.
|
boolean |
lock(Data key,
String caller,
long threadId,
long referenceId,
long leaseTime)
Lock a specific key.
|
boolean |
shouldBlockReads(Data key)
Return whether the reads for the specific key should be blocked
(see
LockStore.txnLock(Data, String, long, long, long, boolean)). |
boolean |
txnLock(Data key,
String caller,
long threadId,
long referenceId,
long leaseTime,
boolean blockReads)
Lock a specific key for use inside a transaction.
|
boolean |
unlock(Data key,
String caller,
long threadId,
long referenceId)
Unlock a specific key.
|
public LockStoreProxy(LockStoreContainer container, ObjectNamespace namespace)
public boolean lock(Data key, String caller, long threadId, long referenceId, long leaseTime)
LockStorelock in interface LockStorekey - the key to lockcaller - the identifier for the callerthreadId - the identifier for the thread on the callerreferenceId - the identifier for the invocation of the caller (e.g. operation call ID)leaseTime - the lease duration in millisecondspublic boolean localLock(Data key, String caller, long threadId, long referenceId, long leaseTime)
LockStorelocalLock in interface LockStorekey - the key to lockcaller - the identifier for the callerthreadId - the identifier for the thread on the callerreferenceId - the identifier for the invocation of the caller (e.g. operation call ID)leaseTime - the lease duration in millisecondsGroupProperty.LOCK_MAX_LEASE_TIME_SECONDSpublic boolean txnLock(Data key, String caller, long threadId, long referenceId, long leaseTime, boolean blockReads)
LockStoretxnLock in interface LockStorekey - the key to lockcaller - the identifier for the callerthreadId - the identifier for the thread on the callerreferenceId - the identifier for the invocation of the caller (e.g. operation call ID)leaseTime - the lease duration in millisecondsblockReads - whether reads for the key should be blocked (e.g. for map and multimap)public boolean extendLeaseTime(Data key, String caller, long threadId, long leaseTime)
LockStoreextendLeaseTime in interface LockStorekey - the locked keycaller - the identifier for the callerthreadId - the identifier for the thread on the callerleaseTime - time in milliseconds for the lease to be extendedpublic boolean unlock(Data key, String caller, long threadId, long referenceId)
LockStorepublic boolean isLocked(Data key)
LockStorepublic boolean isLockedBy(Data key, String caller, long threadId)
LockStoreisLockedBy in interface LockStorekey - the locked keycaller - the identifier for the callerthreadId - the identifier for the thread on the callerpublic int getLockCount(Data key)
LockStoregetLockCount in interface LockStorekey - the keypublic int getLockedEntryCount()
LockStoregetLockedEntryCount in interface LockStorepublic long getRemainingLeaseTime(Data key)
LockStoregetRemainingLeaseTime in interface LockStorekey - the keypublic boolean canAcquireLock(Data key, String caller, long threadId)
LockStorecanAcquireLock in interface LockStorekey - the locked keycaller - the identifier for the callerthreadId - the identifier for the thread on the callerpublic boolean shouldBlockReads(Data key)
LockStoreLockStore.txnLock(Data, String, long, long, long, boolean)).shouldBlockReads in interface LockStorekey - the lock keypublic Set<Data> getLockedKeys()
LockStoregetLockedKeys in interface LockStorepublic boolean forceUnlock(Data key)
LockStoretrue if the key is already unlocked but has
waiters/signals/expired operations.forceUnlock in interface LockStorekey - the lock keypublic String getOwnerInfo(Data dataKey)
LockStoregetOwnerInfo in interface LockStoredataKey - the keyCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.