spacemonkd commented on code in PR #10683:
URL: https://github.com/apache/ozone/pull/10683#discussion_r3573890725
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/lock/OBSKeyPathLockStrategy.java:
##########
@@ -89,4 +91,55 @@ public OMLockDetails releaseReadLock(OMMetadataManager
omMetadataManager,
.releaseReadLock(BUCKET_LOCK, volumeName, bucketName));
return omLockDetails;
}
+
+ @Override
+ public OMLockDetails acquireWriteLock(OMMetadataManager omMetadataManager,
+ String volumeName, String bucketName, Collection<String> keyNames)
Review Comment:
Thanks for taking a look at this PR.
Here this method can be called by various classes.
For example:
- OMKeyRenameRequest only passes 2 keys as
[list](https://github.com/spacemonkd/ozone/blob/101b7aa2befbfefb5dba8e05a3c3ff7db03c232b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRenameRequest.java#L155).
- OMKeyDeleteRequest can pass multiple keys
[here](https://github.com/spacemonkd/ozone/blob/101b7aa2befbfefb5dba8e05a3c3ff7db03c232b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeysDeleteRequest.java#L146)
as multiple keys can be deleted in a batch as we call
[getKeysAsList()](https://github.com/spacemonkd/ozone/blob/101b7aa2befbfefb5dba8e05a3c3ff7db03c232b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeysDeleteRequest.java#L99)
- OMKeysRenameRequest is similar to OMKeyRenameRequest but instead we pass a
batch of keys so technically here it can be 2*N keys (2 keys for from/to and N
total keys in the batch)
So the collection was more suitable here as then we can pass list, set or
whatever is suitable.
But I am definitely open to suggestions on how this could be improved.
--
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]