mchades commented on code in PR #7476:
URL: https://github.com/apache/gravitino/pull/7476#discussion_r2188914563
##########
core/src/main/java/org/apache/gravitino/tag/TagManager.java:
##########
@@ -226,6 +227,42 @@ public MetadataObject[] listMetadataObjectsForTag(String
metalake, String name)
});
}
+ public MetadataObject[] listMetadataObjectsForTags(String metalake, String[]
names)
+ throws NoSuchTagException {
+ if (names == null || names.length == 0) {
+ return new MetadataObject[0];
+ }
+ NameIdentifier[] tagIds =
+ Arrays.stream(names)
+ .map(name -> NameIdentifierUtil.ofTag(metalake, name))
+ .toArray(NameIdentifier[]::new);
+ NameIdentifier lockId = tagIds[0];
+ return TreeLockUtils.doWithTreeLock(
+ lockId,
+ LockType.READ,
Review Comment:
Locking only one tag seems unable to solve the concurrency issues of other
tags, do we have a better way to acquire locks for batch operations? @yuqi1129
--
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]