Denis Chudov created IGNITE-16544:
-------------------------------------
Summary: Create a lock manager for causality tokens
Key: IGNITE-16544
URL: https://issues.apache.org/jira/browse/IGNITE-16544
Project: Ignite
Issue Type: Improvement
Reporter: Denis Chudov
Create a lock manager that manages locks on causality tokens between multiple
VersionedValues.
When token is locked using some VersionedValue, it will be locked on every
VersionedValue that shares the same CausalityTokensLockManager.
The lock manager should provide following methods
{code:java}
public class CausalityTokensLockManager {
/**
* Acquire read lock on given token to prevent its deletion from history of
every {@link VersionedValue}
* managed by this manager.
*
* @param causalityToken Causality token.
* @throws OutdatedTokenException If outdated token is passed as an
argument. See also {@link #tryWriteLock(long, VersionedValue)}.
*/
public void readLock(long causalityToken) throws OutdatedTokenException {
}
/**
* Tries to acquire write lock on given token to allow its deletion from
history of given {@link VersionedValue}
* that supposed to be managed by this manager.<br>
* Once this method has successfully acquired the lock on some token, it
means that this token is being deleted from
* history and {@link #readLock(long)} will always throw {@link
OutdatedTokenException} on every call with this token.
*
* @param causalityToken Causality token.
* @throws OutdatedTokenException If outdated token is passed as an
argument.
*/
public boolean tryWriteLock(long causalityToken, VersionedValue<?>
versionedValue) throws OutdatedTokenException {
return false;
}
/**
* Unlocks the token, previously locked by {@link #readLock(long)}.
*
* @param causalityToken Causality token.
*/
public void readUnlock(long causalityToken) {
}
/**
* Unlocks the token, previously locked by {@link #tryWriteLock(long,
VersionedValue)}.
*
* @param causalityToken Causality token.
*/
public void writeUnlock(long causalityToken, VersionedValue<?>
versionedValue) {
}
} {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)