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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to