brucearctor commented on code in PR #13891:
URL: https://github.com/apache/gravitino/pull/13891#discussion_r4290932862
##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/BaseGVFSOperations.java:
##########
@@ -969,18 +982,27 @@ private Cache<FileSystemCacheKey, FileSystem>
newFileSystemCache(Configuration c
@VisibleForTesting
Map<String, String> getAllProperties(NameIdentifier filesetIdent) {
- String catalogName = filesetIdent.namespace().level(1);
- String schemaName = filesetIdent.namespace().level(2);
- Catalog catalog = getGravitinoClient().loadCatalog(catalogName);
- Schema schema = catalog.asSchemas().loadSchema(schemaName);
- Fileset fileset =
- catalog.asFilesetCatalog().loadFileset(NameIdentifier.of(schemaName,
filesetIdent.name()));
+ return getAllProperties(filesetIdent, null);
+ }
+
+ @VisibleForTesting
+ Map<String, String> getAllProperties(NameIdentifier filesetIdent, @Nullable
Fileset fileset) {
+ NameIdentifier catalogIdent =
+ NameIdentifier.of(filesetIdent.namespace().level(0),
filesetIdent.namespace().level(1));
+ NameIdentifier schemaIdent =
+ NameIdentifier.of(
+ filesetIdent.namespace().level(0),
+ filesetIdent.namespace().level(1),
+ filesetIdent.namespace().level(2));
+ Catalog catalog = getCatalog(catalogIdent);
+ Schema schema = getSchema(schemaIdent);
+ Fileset resolvedFileset = fileset != null ? fileset :
getFileset(filesetIdent);
Review Comment:
Addressed in f9cfa9a90 — when metadata caching is disabled, both Java
`getAllProperties` and Python `_merge_fileset_properties` now resolve `schema`
and `fileset` directly from the already-loaded `catalog` instance, and unit
tests verify `loadCatalog` / `load_catalog` is invoked only once.
--
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]