roryqi commented on code in PR #13006:
URL: https://github.com/apache/gravitino/pull/13006#discussion_r4071435250
##########
core/src/main/java/org/apache/gravitino/authorization/PermissionManager.java:
##########
@@ -870,6 +859,30 @@ public void execute() {
}
}
+ private List<RoleEntity> getExistingRoles(
+ String metalake, @Nullable List<String> roleNames, @Nullable List<Long>
roleIds) {
+ List<RoleEntity> roles = Lists.newArrayList();
+ if (roleNames == null || roleNames.isEmpty()) {
+ return roles;
+ }
+ if (roleIds == null || roleNames.size() != roleIds.size()) {
+ throw new IllegalRoleException("Existing role names and IDs must be
paired");
+ }
+ for (int i = 0; i < roleNames.size(); i++) {
+ RoleEntity role = roleManager.getRole(metalake, roleNames.get(i));
Review Comment:
Should we batch get roles here? It seems to benefit the transaction.
--
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]