You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "jerqi (via GitHub)" <gi...@apache.org> on 2024/08/06 09:50:06 UTC

[PR] [#4374] feat(client): Add owner operations for client [gravitino]

jerqi opened a new pull request, #4397:
URL: https://github.com/apache/gravitino/pull/4397

   ### What changes were proposed in this pull request?
   
   Add owner operations for client
   
   ### Why are the changes needed?
   
   Fix: #4374
   
   ### Does this PR introduce _any_ user-facing change?
   I will add the document later.
   
   ### How was this patch tested?
   Add UTS.
   


-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1706339873


##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java:
##########
@@ -308,6 +312,31 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return getMetalake().revokeRolesFromGroup(roles, group);
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't set the owner, it will
+   *     return Optional.empty().
+   * @throws NotFoundException If the metadata object is not found.
+   */
+  public Optional<Owner> getOwner(MetadataObject object) throws NotFoundException {

Review Comment:
   The API signature is not so good, `NotFoundException` and `Optional` have some semantic overlaps, developers may be confused when this will return empty, or when it will have NFE, unless they read the document, so we need to make this more clear and easy to understand.



-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1706495207


##########
api/src/main/java/org/apache/gravitino/exceptions/NoSuchMetadataObjectException.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.exceptions;
+
+import com.google.errorprone.annotations.FormatMethod;
+import com.google.errorprone.annotations.FormatString;
+
+/** Exception thrown when a metadata object with specified name is not existed. */

Review Comment:
   is not -> does not



##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java:
##########
@@ -308,6 +313,32 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return getMetalake().revokeRolesFromGroup(roles, group);
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't set the owner, it will
+   *     return Optional.empty().
+   * @throws NotFoundException If the metadata object is not found
+   * @throws NoSuchMetadataObjectException If the metadata object is not found.
+   */
+  public Optional<Owner> getOwner(MetadataObject object) throws NoSuchMetadataObjectException {
+    return getMetalake().getOwner(object);
+  }
+
+  /**
+   * Set the owner of a metadata object.
+   *
+   * @param object The metadata object.
+   * @param ownerName The name of the owner
+   * @param ownerType The type of the owner, The owner can be a user or a group.
+   * @throws NotFoundException If the metadata object isn't found or the owner doesn't exist.

Review Comment:
   Should this method also need to throw `NoSuchMetadataObjectException`?



##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java:
##########
@@ -308,6 +313,32 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return getMetalake().revokeRolesFromGroup(roles, group);
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't set the owner, it will
+   *     return Optional.empty().
+   * @throws NotFoundException If the metadata object is not found

Review Comment:
   do we need to remove this line?



-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu merged PR #4397:
URL: https://github.com/apache/gravitino/pull/4397


-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1705421075


##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java:
##########
@@ -762,6 +771,55 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return resp.getGroup();
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't have the owner, it
+   *     will return Optional.empty().
+   * @throws NotFoundException If the metadata object or the owner isn't found.

Review Comment:
   I remove the comment. Because it will happen rarely. 
   May we should check owners before we delete a user in the later pull request.



-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1706467876


##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java:
##########
@@ -308,6 +312,31 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return getMetalake().revokeRolesFromGroup(roles, group);
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't set the owner, it will
+   *     return Optional.empty().
+   * @throws NotFoundException If the metadata object is not found.
+   */
+  public Optional<Owner> getOwner(MetadataObject object) throws NotFoundException {

Review Comment:
   I added an exception NoSuchMetadataObjectException.



-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1706296453


##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java:
##########
@@ -762,6 +771,55 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return resp.getGroup();
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't set the owner, it will
+   *     return Optional.empty().
+   * @throws NotFoundException If the metadata object is not found.
+   */
+  public Optional<Owner> getOwner(MetadataObject object) throws NotFoundException {
+    OwnerResponse resp =
+        restClient.get(
+            String.format(
+                API_METALAKES_OWNERS_PATH,
+                this.name(),
+                String.format(
+                    "%s/%s", object.type().name().toLowerCase(Locale.ROOT), object.fullName())),
+            OwnerResponse.class,
+            Collections.emptyMap(),
+            ErrorHandlers.ownerErrorHandler());
+    resp.validate();
+    return Optional.ofNullable(resp.getOwner());
+  }
+
+  /**
+   * Set the owner of a metadata object.
+   *
+   * @param object The metadata object.
+   * @param ownerName The name of the owner
+   * @param ownerType The type of the owner, The owner can be a user or a group.
+   * @throws NotFoundException If the metadata object isn't found or the owner is deleted.
+   */
+  public void setOwner(MetadataObject object, String ownerName, Owner.Type ownerType)
+      throws NotFoundException {

Review Comment:
   I can't found anywhere throws NotFoundException, and when I deleted `throws NotFoundException`  we can also compile success.



##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java:
##########
@@ -762,6 +771,55 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return resp.getGroup();
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't set the owner, it will
+   *     return Optional.empty().
+   * @throws NotFoundException If the metadata object is not found.
+   */
+  public Optional<Owner> getOwner(MetadataObject object) throws NotFoundException {

Review Comment:
   I can't found anywhere throws NotFoundException, and when I deleted `throws NotFoundException`  we can also compile success.



-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#issuecomment-2272549550

   > hi @yuqi1129 Do you have more other comments?
   
   I checked it and have no further comments on 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: commits-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1706495207


##########
api/src/main/java/org/apache/gravitino/exceptions/NoSuchMetadataObjectException.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.exceptions;
+
+import com.google.errorprone.annotations.FormatMethod;
+import com.google.errorprone.annotations.FormatString;
+
+/** Exception thrown when a metadata object with specified name is not existed. */

Review Comment:
   is not existed -> does not exist



-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1705357240


##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java:
##########
@@ -762,6 +771,55 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return resp.getGroup();
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't have the owner, it
+   *     will return Optional.empty().
+   * @throws NotFoundException If the metadata object or the owner isn't found.

Review Comment:
   Maybe I can add user/group lock when I called the getOwner method to avoid this issue. WDYT?



-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1706300578


##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java:
##########
@@ -762,6 +771,55 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return resp.getGroup();
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't set the owner, it will
+   *     return Optional.empty().
+   * @throws NotFoundException If the metadata object is not found.
+   */
+  public Optional<Owner> getOwner(MetadataObject object) throws NotFoundException {

Review Comment:
   Because `NotFoundException` is a RuntimeException. So it compile successfully. It throws in the ErrorHandler.



-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1705348044


##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java:
##########
@@ -762,6 +771,55 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return resp.getGroup();
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't have the owner, it
+   *     will return Optional.empty().
+   * @throws NotFoundException If the metadata object or the owner isn't found.

Review Comment:
   Owner is user 1. But user 1 is deleted.



-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1705345288


##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java:
##########
@@ -762,6 +771,55 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return resp.getGroup();
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't have the owner, it
+   *     will return Optional.empty().
+   * @throws NotFoundException If the metadata object or the owner isn't found.

Review Comment:
   Since the result type is `Optional`, why do we throw `NotFoundException` if the owner can't be found?



-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1706447491


##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java:
##########
@@ -308,6 +312,31 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return getMetalake().revokeRolesFromGroup(roles, group);
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't set the owner, it will
+   *     return Optional.empty().
+   * @throws NotFoundException If the metadata object is not found.
+   */
+  public Optional<Owner> getOwner(MetadataObject object) throws NotFoundException {

Review Comment:
   @jerqi I think maybe you can throw explicit exception, 
   for example throws `NoSuchMetalakeException`, `NoSuchCatalogException`, `NoSuchTableException`, ... {



-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1706506416


##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java:
##########
@@ -308,6 +313,32 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return getMetalake().revokeRolesFromGroup(roles, group);
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't set the owner, it will
+   *     return Optional.empty().
+   * @throws NotFoundException If the metadata object is not found
+   * @throws NoSuchMetadataObjectException If the metadata object is not found.
+   */
+  public Optional<Owner> getOwner(MetadataObject object) throws NoSuchMetadataObjectException {
+    return getMetalake().getOwner(object);
+  }
+
+  /**
+   * Set the owner of a metadata object.
+   *
+   * @param object The metadata object.
+   * @param ownerName The name of the owner
+   * @param ownerType The type of the owner, The owner can be a user or a group.
+   * @throws NotFoundException If the metadata object isn't found or the owner doesn't exist.

Review Comment:
   Owner is not the metadata object. So it's suitable to use NotFoundException instead of `NoSuchMetadataObjectException`



-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "xunliu (via GitHub)" <gi...@apache.org>.
xunliu commented on PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#issuecomment-2272497055

   hi @yuqi1129 
   Do you have more other comments?


-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1706467876


##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java:
##########
@@ -308,6 +312,31 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return getMetalake().revokeRolesFromGroup(roles, group);
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't set the owner, it will
+   *     return Optional.empty().
+   * @throws NotFoundException If the metadata object is not found.
+   */
+  public Optional<Owner> getOwner(MetadataObject object) throws NotFoundException {

Review Comment:
   I added an exception NoMetadataObjectException.



-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1706507742


##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java:
##########
@@ -308,6 +313,32 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return getMetalake().revokeRolesFromGroup(roles, group);
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't set the owner, it will
+   *     return Optional.empty().
+   * @throws NotFoundException If the metadata object is not found

Review Comment:
   Yes, I will.



##########
api/src/main/java/org/apache/gravitino/exceptions/NoSuchMetadataObjectException.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.exceptions;
+
+import com.google.errorprone.annotations.FormatMethod;
+import com.google.errorprone.annotations.FormatString;
+
+/** Exception thrown when a metadata object with specified name is not existed. */

Review Comment:
   I will.



-- 
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-unsubscribe@gravitino.apache.org

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


Re: [PR] [#4374] feat(client): Add owner operations for client [gravitino]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #4397:
URL: https://github.com/apache/gravitino/pull/4397#discussion_r1705421075


##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java:
##########
@@ -762,6 +771,55 @@ public Group revokeRolesFromGroup(List<String> roles, String group)
     return resp.getGroup();
   }
 
+  /**
+   * Get the owner of a metadata object.
+   *
+   * @param object The metadata object
+   * @return The owner of the metadata object. If the metadata object doesn't have the owner, it
+   *     will return Optional.empty().
+   * @throws NotFoundException If the metadata object or the owner isn't found.

Review Comment:
   I remove the comment. Because it will happen rarely. May we should check owners before we delete a user.



-- 
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-unsubscribe@gravitino.apache.org

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