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


##########
clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoAdminClient.java:
##########
@@ -145,24 +149,74 @@ public GravitinoMetalake alterMetalake(String name, 
MetalakeChange... changes)
   }
 
   /**
-   * Drops a specific Metalake using the Gravitino API.
+   * Drop a metalake with specified name. If the force flag is true, it will:
    *
-   * @param name The name of the Metalake to be dropped.
-   * @return True if the Metalake was successfully dropped, false if the 
Metalake does not exist.
+   * <ul>
+   *   <li>Cascade drop all sub-entities (tags, catalogs, schemas, tables, 
etc.) of the metalake in
+   *       Gravitino store.
+   *   <li>Drop the metalake even if it is in use.
+   *   <li>External resources (e.g. database, table, etc.) associated with 
sub-entities will not be
+   *       deleted unless it is managed (such as managed fileset).
+   * </ul>
+   *
+   * If the force flag is false, it is equivalent to calling {@link 
#dropMetalake(String)}.
+   *
+   * @param name The name of the metalake.
+   * @param force Whether to force the drop.
+   * @return True if the metalake was dropped, false if the metalake does not 
exist.
+   * @throws NonEmptyEntityException If the metalake is not empty and force is 
false.
+   * @throws MetalakeInUseException If the metalake is in use and force is 
false.
    */
   @Override
-  public boolean dropMetalake(String name) {
+  public boolean dropMetalake(String name, boolean force)
+      throws NonEmptyEntityException, MetalakeInUseException {
     checkMetalakeName(name);
+    Map<String, String> params = new HashMap<>();
+    params.put("force", String.valueOf(force));
+
     DropResponse resp =
         restClient.delete(
             API_METALAKES_IDENTIFIER_PATH + name,
+            params,
             DropResponse.class,
             Collections.emptyMap(),
             ErrorHandlers.metalakeErrorHandler());
     resp.validate();
     return resp.dropped();
   }
 
+  @Override
+  public void enableMetalake(String name) throws NoSuchMetalakeException {
+    ErrorResponse resp =
+        restClient.get(
+            API_METALAKES_IDENTIFIER_PATH + name + "/activate",
+            ErrorResponse.class,
+            Collections.emptyMap(),
+            ErrorHandlers.metalakeErrorHandler());

Review Comment:
   So you didn't update the code here for metalake, it should align with 
catalog to use `patch` with request body.



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