Interface PendingLockManager
- All Known Implementing Classes:
DefaultPendingLockManager,NoOpPendingLockManager
public interface PendingLockManager
A manager that checks and waits for older topology transaction with conflicting keys.
- Since:
- 8.0
- Author:
- Pedro Ruivo
-
Method Summary
Modifier and TypeMethodDescriptionlongawaitPendingTransactionsForAllKeys(TxInvocationContext<?> ctx, Collection<Object> keys, long time, TimeUnit unit) Deprecated.Since 10.0, the blocking variants will be removedlongawaitPendingTransactionsForKey(TxInvocationContext<?> ctx, Object key, long time, TimeUnit unit) Deprecated.Since 10.0, the blocking variants will be removedcheckPendingTransactionsForKey(TxInvocationContext<?> ctx, Object key, long time, TimeUnit unit) Same asawaitPendingTransactionsForKey(TxInvocationContext, Object, long, TimeUnit)but non-blocking.checkPendingTransactionsForKeys(TxInvocationContext<?> ctx, Collection<Object> keys, long time, TimeUnit unit) Same asawaitPendingTransactionsForAllKeys(TxInvocationContext, Collection, long, TimeUnit)but non-blocking.
-
Method Details
-
checkPendingTransactionsForKey
PendingLockPromise checkPendingTransactionsForKey(TxInvocationContext<?> ctx, Object key, long time, TimeUnit unit) Same asawaitPendingTransactionsForKey(TxInvocationContext, Object, long, TimeUnit)but non-blocking.Multiple invocations with the same transaction returns the same
PendingLockPromise. For cleanup purposes,awaitPendingTransactionsForKey(TxInvocationContext, Object, long, TimeUnit)must be invoked afterwards.- Parameters:
ctx- theTxInvocationContext.key- the key to check.time- timeout.unit-TimeUnitoftime.- Returns:
- a
PendingLockPromise.
-
checkPendingTransactionsForKeys
PendingLockPromise checkPendingTransactionsForKeys(TxInvocationContext<?> ctx, Collection<Object> keys, long time, TimeUnit unit) Same asawaitPendingTransactionsForAllKeys(TxInvocationContext, Collection, long, TimeUnit)but non-blocking.Multiple invocations with the same transaction returns the same
PendingLockPromise. For cleanup purposes,awaitPendingTransactionsForAllKeys(TxInvocationContext, Collection, long, TimeUnit)must be invoked afterwards.- Parameters:
ctx- theTxInvocationContext.keys- the keys to check.time- timeout.unit-TimeUnitoftime.- Returns:
- a
PendingLockPromise.
-
awaitPendingTransactionsForKey
@Deprecated long awaitPendingTransactionsForKey(TxInvocationContext<?> ctx, Object key, long time, TimeUnit unit) throws InterruptedException Deprecated.Since 10.0, the blocking variants will be removedIt waits for any transaction with older topology id to complete that may have the lock forkeyacquired.- Parameters:
ctx- theTxInvocationContext.key- the key to check.time- timeout.unit-TimeUnitoftime.- Returns:
- the remaining timeout.
- Throws:
InterruptedException- if the thread is interrupted while waiting.
-
awaitPendingTransactionsForAllKeys
@Deprecated long awaitPendingTransactionsForAllKeys(TxInvocationContext<?> ctx, Collection<Object> keys, long time, TimeUnit unit) throws InterruptedException Deprecated.Since 10.0, the blocking variants will be removedIt waits for any transaction with older topology id to complete that may have the lock for any key inkeysacquired.- Parameters:
ctx- theTxInvocationContext.keys- the keys to check.time- timeout.unit-TimeUnitoftime.- Returns:
- the remaining timeout.
- Throws:
InterruptedException- if the thread is interrupted while waiting.
-