spacemonkd commented on code in PR #10919:
URL: https://github.com/apache/ozone/pull/10919#discussion_r3695964771


##########
hadoop-ozone/interface-storage/src/main/java/org/apache/hadoop/ozone/om/lock/IOzoneManagerLock.java:
##########
@@ -26,34 +26,52 @@
  */
 public interface IOzoneManagerLock {
 
-  OMLockDetails acquireReadLock(Resource resource,
-                                String... resources);
+  // ---------- acquireReadLock ----------
+  OMLockDetails acquireReadLock(Resource resource, String key);
+
+  OMLockDetails acquireReadLock(Resource resource, String key1, String key2);
+
+  OMLockDetails acquireReadLock(Resource resource, String... keys);

Review Comment:
   Nit: Would it be good to document that this will throw Precondition for <=2 
keys. Previously it was handled since there was only a single method.
   But in the future if someone calls this assuming the original change, they 
might accidentally introduce regression.
   
   
   ```suggestion
     /**
      * Acquire read lock on a resource.
      * <p>
      * For S3_BUCKET_LOCK, VOLUME_LOCK, BUCKET_LOCK, the same thread acquiring 
the
      * lock again is allowed. For USER_LOCK, PREFIX_LOCK, S3_SECRET_LOCK it is 
not.
      * <p>
      * Special note for USER_LOCK: a single thread can acquire the single-user 
lock
      * or the multi-user lock, but not both at the same time.
      *
      * @param resource type of the resource.
      * @param keys   resource names to lock. For BUCKET_LOCK the first key is 
the
      *                 volume and the second is the bucket; most other 
resources
      *                 take a single key. This overload requires more than two 
keys
      *                 (use the fixed overloads for one or two keys).
      */ 
     OMLockDetails acquireReadLock(Resource resource, String... keys);
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to