geyanggang commented on code in PR #13562:
URL: https://github.com/apache/gravitino/pull/13562#discussion_r4559260717


##########
core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java:
##########
@@ -713,7 +719,16 @@ public Catalog[] listCatalogsInfo(Namespace namespace) 
throws NoSuchMetalakeExce
           // provider is "fileset", still using "hadoop" will lead to catalog 
loading issue. So
           // after reading the catalog entity, we convert it to the new 
fileset catalog entity.
           .map(this::convertFilesetCatalogEntity)
-          .map(this::toCatalogInfoForList)
+          .map(

Review Comment:
   The PR description says that a catalog whose server-side initialization 
fails "no longer fails the listing as a whole". That is not new behavior. 
`toCatalogInfoForList` already catches `RuntimeException` per catalog and falls 
back to the entity properties with secrets masked (see its Javadoc: "must not 
fail the entire metalake listing"). So the old path did not fail the listing or 
the driver start either.
   
   The actual gain is skipping the wrapper initialization (and the failed init 
attempts plus warnings for broken catalogs). Could you reword that bullet so 
reviewers and release notes do not overstate the change?



##########
api/src/main/java/org/apache/gravitino/SupportsCatalogs.java:
##########
@@ -53,6 +53,26 @@ public interface SupportsCatalogs {
    */
   Catalog[] listCatalogsInfo() throws NoSuchMetalakeException;
 
+  /**
+   * List all catalogs with their information in the metalake.
+   *
+   * <p>When {@code includeProperties} is {@code false}, catalog properties 
are omitted and {@link
+   * Catalog#properties()} contains only {@code in-use}, read directly from 
stored metadata and
+   * defaulting to {@code "true"} when absent. Other properties are omitted, 
and catalog wrappers
+   * are not initialized. Name, type, provider, comment, and audit information 
are still populated.
+   *
+   * <p>The default implementation throws {@link 
UnsupportedOperationException}.
+   *
+   * @param includeProperties whether to include resolved catalog properties
+   * @return The list of catalog's information.
+   * @throws NoSuchMetalakeException If the metalake does not exist.
+   * @throws UnsupportedOperationException If the implementation does not 
support this overload.
+   */
+  default Catalog[] listCatalogsInfo(boolean includeProperties) throws 
NoSuchMetalakeException {

Review Comment:
   With `includeProperties=false` the returned `Catalog` has the same type as a 
full one, and `properties()` holds only `in-use`. A caller cannot tell 
"properties omitted" from "this catalog has no properties besides in-use". I 
confirmed locally that a catalog with several properties returns 
`{in-use=true}` in this mode.
   
   Could the Javadoc say explicitly that such descriptors are for discovery 
only and must not be used to read, compare, or alter catalog properties (call 
`loadCatalog` for that)? Same wording for the core `SupportsCatalogs`, the Java 
`GravitinoMetalake`/`GravitinoClient`, and the Python docstring.



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