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

Alexander Lapin updated IGNITE-16892:
-------------------------------------
    Description: 
1. Lock management logic will be introduced in IGNITE-17255

2. Lock storages will be introduced in  IGNITE-15932

Given ticket is a sort of a bridge between 1 and 2 that will add several 
methods similar to
{code:java}
/**
 * Attempts to acquire a lock for the specified {@code key} in exclusive mode.
 *
 * @param key The key.
 * @param txId Transaction id.
 * @return The future that will be completed when a lock is successfully 
acquired.
 * @throws LockException When a lock can't be taken due to possible deadlock.
 */
// Index keys locks
public CompletableFuture<Void> tryAcquire(Object key, UUID txId);

// Row store locks
public CompletableFuture<Void> tryAcquire(RowId rowId, UUID txId);

// Intent locks
public CompletableFuture<Void> tryAcquire(UUID entityUUID, UUID txId);

/**
 * Attempts to release a lock for the specified {@code key} in exclusive mode.
 *
 * @param key The key.
 * @param txId Transaction id.
 * @throws LockException If the unlock operation is invalid.
 */
// Index keys locks
public void tryRelease(Object key, UUID txId) throws LockException;

// Row store locks
public void tryRelease(RowId rowId, UUID txId) throws LockException;

// Intent locks
public void tryRelease(UUID entityUUID, UUID txId) throws LockException;

/**
 * Attempts to acquire a lock for the specified {@code key} in shared mode.
 *
 * @param key The key.
 * @param txId Transaction id.
 * @return The future that will be completed when a lock is successfully 
acquired.
 * @throws LockException When a lock can't be taken due to possible deadlock.
 */
// Index keys locks
public CompletableFuture<Void> tryAcquireShared(Object key, UUID txId);

// Row store locks
public CompletableFuture<Void> tryAcquireShared(RowId rowId, UUID txId);

// Intent locks
public CompletableFuture<Void> tryAcquireShared(UUID entityUUID, UUID txId);

/**
 * Attempts to release a lock for the specified {@code key} in shared mode.
 *
 * @param key The key.
 * @param txId Transaction id.
 * @throws LockException If the unlock operation is invalid.
 */
// Index keys locks
public void tryReleaseShared(Object key, UUID txId) throws LockException;

// Row store locks
public void tryReleaseShared(RowId rowId, UUID txId) throws LockException;

// Intent locks
public void tryReleaseShared(UUID entityUUID, UUID txId) throws 
LockException;{code}
to TxManager with corresponding implementation.

  was:
1. Lock management logic will be introduced in IGNITE-17255

2. Lock storages will be introduced in  IGNITE-15932

Given ticket is a sort of a bridge between 1 and 2 that will add several 
methods similar to
{code:java}
// Index locks
public CompletableFuture<Void> writeLock(IgniteUuid lockId, ByteBuffer keyData, 
UUID txId);
    
// Row store locks
public CompletableFuture<Void> writeLock(IgniteUuid lockId, RowId rowId, UUID 
txId);

// Intent locks
public CompletableFuture<Void> writeLock(IgniteUuid lockId, UUID txId);

// Index locks
public CompletableFuture<Void> readLock(IgniteUuid lockId, ByteBuffer keyData, 
UUID txId);

// Row store locks
public CompletableFuture<Void> readLock(IgniteUuid lockId, RowId rowId, UUID 
txId);

// Intent locks
public CompletableFuture<Void> readLock(IgniteUuid lockId, UUID txId);{code}
to TxManager with corresponding implementation.


> Update lock manager in order to soupport S, X and I locks
> ---------------------------------------------------------
>
>                 Key: IGNITE-16892
>                 URL: https://issues.apache.org/jira/browse/IGNITE-16892
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Alexander Lapin
>            Priority: Major
>              Labels: ignite-3, transaction3_rw
>
> 1. Lock management logic will be introduced in IGNITE-17255
> 2. Lock storages will be introduced in  IGNITE-15932
> Given ticket is a sort of a bridge between 1 and 2 that will add several 
> methods similar to
> {code:java}
> /**
>  * Attempts to acquire a lock for the specified {@code key} in exclusive mode.
>  *
>  * @param key The key.
>  * @param txId Transaction id.
>  * @return The future that will be completed when a lock is successfully 
> acquired.
>  * @throws LockException When a lock can't be taken due to possible deadlock.
>  */
> // Index keys locks
> public CompletableFuture<Void> tryAcquire(Object key, UUID txId);
> // Row store locks
> public CompletableFuture<Void> tryAcquire(RowId rowId, UUID txId);
> // Intent locks
> public CompletableFuture<Void> tryAcquire(UUID entityUUID, UUID txId);
> /**
>  * Attempts to release a lock for the specified {@code key} in exclusive mode.
>  *
>  * @param key The key.
>  * @param txId Transaction id.
>  * @throws LockException If the unlock operation is invalid.
>  */
> // Index keys locks
> public void tryRelease(Object key, UUID txId) throws LockException;
> // Row store locks
> public void tryRelease(RowId rowId, UUID txId) throws LockException;
> // Intent locks
> public void tryRelease(UUID entityUUID, UUID txId) throws LockException;
> /**
>  * Attempts to acquire a lock for the specified {@code key} in shared mode.
>  *
>  * @param key The key.
>  * @param txId Transaction id.
>  * @return The future that will be completed when a lock is successfully 
> acquired.
>  * @throws LockException When a lock can't be taken due to possible deadlock.
>  */
> // Index keys locks
> public CompletableFuture<Void> tryAcquireShared(Object key, UUID txId);
> // Row store locks
> public CompletableFuture<Void> tryAcquireShared(RowId rowId, UUID txId);
> // Intent locks
> public CompletableFuture<Void> tryAcquireShared(UUID entityUUID, UUID txId);
> /**
>  * Attempts to release a lock for the specified {@code key} in shared mode.
>  *
>  * @param key The key.
>  * @param txId Transaction id.
>  * @throws LockException If the unlock operation is invalid.
>  */
> // Index keys locks
> public void tryReleaseShared(Object key, UUID txId) throws LockException;
> // Row store locks
> public void tryReleaseShared(RowId rowId, UUID txId) throws LockException;
> // Intent locks
> public void tryReleaseShared(UUID entityUUID, UUID txId) throws 
> LockException;{code}
> to TxManager with corresponding implementation.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to