brucearctor commented on code in PR #13891:
URL: https://github.com/apache/gravitino/pull/13891#discussion_r4595196883
##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/BaseGVFSOperations.java:
##########
@@ -760,7 +777,8 @@ private FileSystem getActualFileSystemByLocationName(
NameIdentifier catalogIdent =
NameIdentifier.of(filesetIdent.namespace().level(0),
filesetIdent.namespace().level(1));
try {
- Fileset fileset = getFileset(filesetIdent);
+ Catalog catalog = getCatalog(catalogIdent);
+ Fileset fileset = getFileset(filesetIdent, catalog);
Review Comment:
Addressed in ccdc38262 — restored direct dispatch to
`getFileset(NameIdentifier)` and `getFilesetCatalog(NameIdentifier)` in
`getActualFileSystemByLocationName`, while using a per-resolution `ThreadLocal`
catalog cache (`RESOLUTION_CATALOG_CACHE`) when metadata caching is disabled so
`loadCatalog` is still called once during resolution. Added
`testCustomOperationsHooksSelectCustomFilesetLocationWhenCacheDisabled`
covering both hook overrides via `fs.gravitino.operations.class` and `open()`.
##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/BaseGVFSOperations.java:
##########
@@ -1023,28 +1051,18 @@ Map<String, String> getAllProperties(NameIdentifier
filesetIdent) {
filesetIdent.namespace().level(0),
filesetIdent.namespace().level(1),
filesetIdent.namespace().level(2));
- Catalog catalog =
- getFilesetMetadataCache()
- .map(cache -> cache.getCatalog(catalogIdent))
- .orElseGet(() -> getGravitinoClient().loadCatalog(catalogName));
+ Catalog resolvedCatalog = catalog != null ? catalog :
getCatalog(catalogIdent);
Schema schema =
- getFilesetMetadataCache()
- .map(cache -> cache.getSchema(schemaIdent))
- .orElseGet(() -> catalog.asSchemas().loadSchema(schemaName));
- Fileset fileset =
- getFilesetMetadataCache()
- .map(cache -> cache.getFileset(filesetIdent))
- .orElseGet(
- () ->
- catalog
- .asFilesetCatalog()
- .loadFileset(NameIdentifier.of(schemaName,
filesetIdent.name())));
+ enableFilesetMetadataCache
+ ? getSchema(schemaIdent)
+ : resolvedCatalog.asSchemas().loadSchema(schemaIdent.name());
+ Fileset resolvedFileset = fileset != null ? fileset :
getFileset(filesetIdent, resolvedCatalog);
Map<String, String> all = new HashMap<>();
- putPropsAndSecrets(all, catalog.properties(), catalog.supportsSecrets());
- putStaticCatalogCredentialInfo(all, catalog);
+ putPropsAndSecrets(all, resolvedCatalog.properties(),
resolvedCatalog.supportsSecrets());
+ putStaticCatalogCredentialInfo(all, resolvedCatalog);
putPropsAndSecrets(all, schema.properties(), schema.supportsSecrets());
- putPropsAndSecrets(all, fileset.properties(), fileset.supportsSecrets());
+ putPropsAndSecrets(all, resolvedFileset.properties(),
resolvedFileset.supportsSecrets());
Review Comment:
Addressed in ccdc38262 — `getAllProperties` now checks whether the preloaded
`Fileset` supports secrets and falls back to the client-backed fileset (via
`FilesetMetadataCache` when enabled, or
`catalog.asFilesetCatalog().loadFileset(...)` when disabled) when
`supportsSecrets()` throws `UnsupportedOperationException`. Added
`testCustomGetFilesetReturningFilesetDTOPreservesClientBackedPropertiesAndSecretsWhenCacheEnabled`.
--
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]