From 2e24f4bea5af6ed0436b71682f820cba2009bd38 Mon Sep 17 00:00:00 2001 From: qiang_liu Date: Thu, 26 Sep 2024 21:22:20 +0800 Subject: [PATCH] #4873 support list group add javaDoc --- .../org/apache/gravitino/client/GravitinoClient.java | 10 ++++++++++ .../org/apache/gravitino/client/GravitinoMetalake.java | 2 ++ .../authorization/AccessControlDispatcher.java | 9 +++++++++ 3 files changed, 21 insertions(+) diff --git a/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java b/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java index d79deaaeefd..5bcdccdbc8f 100644 --- a/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java +++ b/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java @@ -228,10 +228,20 @@ public Group getGroup(String group) throws NoSuchGroupException, NoSuchMetalakeE } + /** + * List the groups. + * @return The Group list + * @throws NoSuchMetalakeException If the Metalake with the given name does not exist. + */ public Group[] listGroups(){ return getMetalake().listGroups(); } + /** + * List the group names. + * @return The group names list. + * @throws NoSuchMetalakeException If the Metalake with the given name does not exist. + */ public String[] listGroupNames(){ return getMetalake().listGroupNames(); } diff --git a/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java b/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java index 5740367a6ca..5efbd7532f7 100644 --- a/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java +++ b/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java @@ -629,6 +629,7 @@ public Group getGroup(String group) throws NoSuchGroupException, NoSuchMetalakeE * Lists the groups * * @return The Group list + * @throws NoSuchMetalakeException If the Metalake with the given name does not exist. */ public Group[] listGroups() { Map params = new HashMap<>(); @@ -648,6 +649,7 @@ public Group[] listGroups() { * Lists the group names * * @return The Group Name List + * @throws NoSuchMetalakeException If the Metalake with the given name does not exist. */ public String[] listGroupNames(){ NameListResponse resp = restClient.get( diff --git a/core/src/main/java/org/apache/gravitino/authorization/AccessControlDispatcher.java b/core/src/main/java/org/apache/gravitino/authorization/AccessControlDispatcher.java index cda2ee04a5b..4e9da93a41c 100644 --- a/core/src/main/java/org/apache/gravitino/authorization/AccessControlDispatcher.java +++ b/core/src/main/java/org/apache/gravitino/authorization/AccessControlDispatcher.java @@ -130,10 +130,19 @@ Group getGroup(String metalake, String group) /** * List groups * + * @param metalake The Metalake of the Group. * @return The list of groups + * @throws NoSuchMetalakeException If the Metalake with the given name does not exist. */ Group[] listGroup(String metalake); + /** + * List group names + * + * @param metalake The Metalake of the Group. + * @return The list of group names + * @throws NoSuchMetalakeException If the Metalake with the given name does not exist. + */ String[] listGroupNames(String metalake); /**