mchades commented on code in PR #13891:
URL: https://github.com/apache/gravitino/pull/13891#discussion_r4596988370


##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/BaseGVFSOperations.java:
##########
@@ -139,6 +140,12 @@ public abstract class BaseGVFSOperations implements 
Closeable {
   // Lazy initialization of GravitinoClient, see getGravitinoClient() for 
details.
   private volatile GravitinoClient gravitinoClient;
 
+  // Per-resolution catalog cache used when metadata caching is disabled so 
hooks and helpers share
+  // a single loadCatalog RPC within one getActualFileSystemByLocationName 
call.
+  private static final ThreadLocal<
+          IdentityHashMap<BaseGVFSOperations, Map<NameIdentifier, Catalog>>>
+      RESOLUTION_CATALOG_CACHE = new ThreadLocal<>();

Review Comment:
   The `OperationScope` added in #14975 already shares catalog and fileset 
loads across a Java GVFS operation. Please drop `RESOLUTION_CATALOG_CACHE` 
during the rebase and reuse the `loadCatalog` and `loadFileset` helpers on 
`main`. That lets `getAllProperties` keep reading fileset properties from the 
client catalog and `createFilesetLocationIfNeed` keep reading 
`disable-filesystem-ops` from the catalog returned by `getFilesetCatalog()`.



##########
clients/client-python/gravitino/filesystem/gvfs_base_operations.py:
##########
@@ -526,37 +530,39 @@ def _merge_fileset_properties(
 
         :param fileset_ident: The fileset identifier
         :param actual_location: The actual storage location
+        :param fileset: The pre-loaded fileset if already available
         :return: Merged properties dictionary
         """
         metalake_name = fileset_ident.namespace().level(0)
         catalog_name = fileset_ident.namespace().level(1)
         schema_name = fileset_ident.namespace().level(2)
+        catalog = self._get_fileset_catalog(

Review Comment:
   On `main`, #13851 already uses the catalog, schema and fileset caches when 
metadata caching is enabled. #14975 changed only Java. For Python, please focus 
the optimization on the duplicate loads when caching is off. A test with 
different property values on the hook and client filesets can verify that the 
hook selects the location and the client supplies the backend configuration.



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