[ 
https://issues.apache.org/jira/browse/IGNITE-16544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Denis Chudov updated IGNITE-16544:
----------------------------------
    Description: 
Create a lock manager that manages locks on causality tokens between multiple 
VersionedValues, to prevent deletion of causality token from history of every 
VersionedValue that share the same lock manager.

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}

  was:
Create a lock manager that manages locks on causality tokens between multiple 
VersionedValues, to prevent deletion of causality token from history of every 
VersionedValue that share 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}


> 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
>            Priority: Major
>              Labels: ignite-3
>
> Create a lock manager that manages locks on causality tokens between multiple 
> VersionedValues, to prevent deletion of causality token from history of every 
> VersionedValue that share the same lock manager.
> 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)

Reply via email to