jarredhj0214 commented on code in PR #12288:
URL: https://github.com/apache/gravitino/pull/12288#discussion_r3754841198


##########
core/src/main/java/org/apache/gravitino/authorization/AccessControlManager.java:
##########
@@ -80,6 +84,34 @@ public User addUser(String metalake, String user, String 
externalId, boolean ena
         () -> userGroupExternalManager.addUser(metalake, user, externalId, 
enabled));
   }
 
+  @Override
+  public List<BulkItemResult<User>> addUsers(String metalake, List<UserAdd> 
users)
+      throws NoSuchMetalakeException {
+    return TreeLockUtils.doWithTreeLock(
+        
NameIdentifier.of(AuthorizationUtils.ofUserNamespace(metalake).levels()),
+        LockType.WRITE,
+        () -> {
+          List<BulkItemResult<User>> results = 
Lists.newArrayListWithCapacity(users.size());
+          for (int index = 0; index < users.size(); index++) {

Review Comment:
   Good point. This PR keeps the bulk user APIs as synchronous best-effort 
APIs, so the timeout still depends on the existing client/server/proxy settings.
   
   The request size is bounded by `gravitino.server.bulk.maxItems`, defaulting 
to 100. For larger inputs, clients should split them into multiple bulk 
requests. If we want to support much larger batches later, I think an async 
bulk job API would be a better follow-up.



-- 
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]

Reply via email to