ChenSammi commented on code in PR #7455:
URL: https://github.com/apache/ozone/pull/7455#discussion_r1865207285


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneAclUtil.java:
##########
@@ -47,24 +51,54 @@ public final class OzoneAclUtil {
   private OzoneAclUtil() {
   }
 
+  private static ACLType[] userRights;
+  private static ACLType[] groupRights;
+
   /**
-   * Helper function to get access acl list for current user.
+   * Helper function to get default access acl list for current user.
    *
-   * @param userName
-   * @param userGroups
+   * @param ugi current login user
+   * @param conf current configuration
    * @return list of OzoneAcls
    * */
-  public static List<OzoneAcl> getAclList(String userName,
-      String[] userGroups, ACLType userRights, ACLType groupRights) {
-
+  public static List<OzoneAcl> getDefaultAclList(UserGroupInformation ugi, 
OzoneConfiguration conf) {
+    // Get default acl rights for user and group.
+    if (userRights == null || groupRights == null) {
+      OzoneAclConfig aclConfig = conf.getObject(OzoneAclConfig.class);

Review Comment:
   Right, to avoid that, userRights and groupRights are static fields, so the 
logic  will be executed only one or a few times give there is no lock. After 
userRights and groupRights value are assigned, the logic will not be executed 
anymore. 



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

Reply via email to