adoroszlai commented on code in PR #4565:
URL: https://github.com/apache/ozone/pull/4565#discussion_r1166697101
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneConfigUtil.java:
##########
@@ -29,10 +29,7 @@
import java.io.IOException;
import java.util.Collection;
-import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_ADMINISTRATORS;
-import static
org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_ADMINISTRATORS_GROUPS;
-import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_S3_ADMINISTRATORS;
-import static
org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_S3_ADMINISTRATORS_GROUPS;
+import static org.apache.hadoop.ozone.OzoneConfigKeys.*;
Review Comment:
Please avoid star import, checkstyle will complain.
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -625,7 +625,12 @@ private OzoneManager(OzoneConfiguration conf,
StartupOption startupOption)
Collection<String> omAdminGroups =
OzoneConfigUtil.getOzoneAdminsGroupsFromConfig(configuration);
LOG.info("OM start with adminUsers: {}", omAdminUsernames);
- omAdmins = new OzoneAdmins(omAdminUsernames, omAdminGroups);
+ // Get super read list
+ Collection<String> omSuperReadUsernames =
+
OzoneConfigUtil.getOzoneSuperReadUserNamesFromConfig(configuration);
+ Collection<String> omSuperReadGroups =
+ OzoneConfigUtil.getOzoneSuperReadGroupsFromConfig(configuration);
+ omAdmins = new OzoneAdmins(omAdminUsernames, omAdminGroups,
omSuperReadUsernames, omSuperReadGroups);
Review Comment:
Instead of duplicating logic in `OzoneAdmins` to handle 2 pairs of lists, it
would be better to create two instances of `OzoneAdmins`:
```
omAdmins = new OzoneAdmins(omAdminUsernames, omAdminGroups);
readOnlyAdmins = new OzoneAdmins(omSuperReadUsernames, omSuperReadGroups);
```
and use `readOnlyAdmins.isAdmin()` for the `isSuperRead` check.
--
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]