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


##########
core/src/main/java/org/apache/gravitino/metalake/MetalakeManager.java:
##########
@@ -204,23 +241,112 @@ public BaseMetalake alterMetalake(NameIdentifier ident, 
MetalakeChange... change
     }
   }
 
-  /**
-   * Deletes a Metalake.
-   *
-   * @param ident The identifier of the Metalake to be deleted.
-   * @return `true` if the Metalake was successfully deleted, `false` 
otherwise.
-   * @throws RuntimeException If deleting the Metalake encounters storage 
issues.
-   */
   @Override
-  public boolean dropMetalake(NameIdentifier ident) {
+  public boolean dropMetalake(NameIdentifier ident, boolean force)
+      throws NonEmptyEntityException, MetalakeInUseException {
     try {
-      return store.delete(ident, EntityType.METALAKE);
-    } catch (IOException ioe) {
-      LOG.error("Deleting metalake {} failed due to storage issues", ident, 
ioe);
-      throw new RuntimeException(ioe);
+      boolean inUse = metalakeInUse(store, ident);
+      if (inUse && !force) {
+        throw new MetalakeInUseException(
+            "Metalake %s is in use, please deactivate it first or use force 
option", ident);

Review Comment:
   disable, not deactivate.



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