You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/12/07 12:07:42 UTC

[GitHub] [ignite-3] sergeyuttsel commented on a diff in pull request #1414: IGNITE-18294 Multiple lock intentions support

sergeyuttsel commented on code in PR #1414:
URL: https://github.com/apache/ignite-3/pull/1414#discussion_r1042115350


##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/HeapLockManager.java:
##########
@@ -506,47 +462,92 @@ void addLock(LockMode lockMode, int increment) {
          * Removes a lock mode.
          *
          * @param lockMode Lock mode.
+         * @return True if the lock mode was removed, false otherwise.
          */
-        void removeLock(LockMode lockMode) {
+        private boolean removeLock(LockMode lockMode) {
             Integer counter = locks.get(lockMode);
 
             if (counter == null || counter < 2) {
                 locks.remove(lockMode);
+
+                return true;
             } else {
                 locks.put(lockMode, counter - 1);
+
+                return false;
             }
         }
 
         /**
-         * Recalculates lock mode based of all locks which the waiter has took.
+         * Recalculates lock mode based of all locks which the waiter has taken.
          *
-         * @return Recalculated lock mode.
+         * @return Previous lock mode.

Review Comment:
   need to add '@ param'



##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/HeapLockManager.java:
##########
@@ -454,25 +413,21 @@ private static class WaiterImpl implements Comparable<WaiterImpl>, Waiter {
         /** Holding locks by type. */
         private final Map<LockMode, Integer> locks = new HashMap<>();
 
+        private final Set<LockMode> intendedLocks = new HashSet<>();

Review Comment:
   javadoc



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org