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


##########
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:
   I mean here why do we need to do a type conversion `entity -> (User) 
entity`? 



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