jerryshao commented on code in PR #7625:
URL: https://github.com/apache/gravitino/pull/7625#discussion_r2234550849
##########
core/src/main/java/org/apache/gravitino/policy/PolicyManager.java:
##########
@@ -74,28 +125,106 @@ public Policy createPolicy(
boolean exclusive,
boolean inheritable,
Set<MetadataObject.Type> supportedObjectTypes,
- PolicyContent content) {
- throw new UnsupportedOperationException("Not implemented yet");
+ PolicyContent content)
+ throws PolicyAlreadyExistsException {
+ NameIdentifier metalakeIdent = NameIdentifierUtil.ofMetalake(metalake);
+ return TreeLockUtils.doWithTreeLock(
+ NameIdentifier.of(NamespaceUtil.ofPolicy(metalake).levels()),
+ LockType.WRITE,
Review Comment:
I would suggest to scope the lock area as small as possible to avoid
unnecessary perfomance issue.
--
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]