jerqi commented on code in PR #4055:
URL: https://github.com/apache/gravitino/pull/4055#discussion_r1768677915


##########
core/src/main/java/org/apache/gravitino/storage/relational/service/UserMetaService.java:
##########
@@ -246,6 +249,38 @@ public <E extends Entity & HasIdentifier> UserEntity 
updateUser(
     return newEntity;
   }
 
+  public List<UserEntity> listUsersByNamespace(Namespace namespace, 
List<Field> skippingFields) {
+    AuthorizationUtils.checkUserNamespace(namespace);
+    String metalakeName = namespace.level(0);
+
+    if (skippingFields.contains(UserEntity.ROLE_IDS)
+        && skippingFields.contains(UserEntity.ROLE_NAMES)) {

Review Comment:
   After considering twice, I extract an interface `SupportsSkippingFields` to 
express the `list user namespace` handler. I also wrap the logic which we 
select the handler according to skipping fields into 
`SupportsSKippingFieldsHandlers`.
   Now, we can match the skipping fields according to the handler which 
defined. It reduce the branches.
   Moreover, I can add the `priority` method for the `SupportsSkippingFields`. 
But for now, this is not a blocker. So just add a comment to notify others the 
correct usage for this interface.



-- 
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: commits-unsubscr...@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to