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


##########
core/src/main/java/org/apache/gravitino/authorization/UserGroupManager.java:
##########
@@ -109,6 +113,25 @@ User getUser(String metalake, String user) throws 
NoSuchUserException {
     }
   }
 
+  String[] listUserNames(String metalake) {
+    return 
Arrays.stream(listUsers(metalake)).map(User::name).toArray(String[]::new);
+  }
+
+  User[] listUsers(String metalake) {
+    try {
+      Namespace namespace = AuthorizationUtils.ofUserNamespace(metalake);
+      return store.list(namespace, UserEntity.class, 
Entity.EntityType.USER).stream()
+          .map(entity -> (User) entity)

Review Comment:
   Sorry, it's unnecessary. I ever designed other interface 
`listEntitiesByRelation`. It need me to use type cast. For this place, we don't 
 need. I have removed it.



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