brucearctor commented on code in PR #13891:
URL: https://github.com/apache/gravitino/pull/13891#discussion_r4608285386
##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/BaseGVFSOperations.java:
##########
@@ -1023,32 +1079,49 @@ 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 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)
+ : catalog.asSchemas().loadSchema(schemaIdent.name());
+
+ SupportsSecrets filesetSecrets = null;
+ boolean needClientBackedFileset = fileset == null;
+ if (fileset != null) {
+ try {
+ filesetSecrets = fileset.supportsSecrets();
+ } catch (UnsupportedOperationException e) {
+ // A custom getFileset hook may return a metadata-only Fileset (such
as FilesetDTO); fall
+ // back to the client-backed fileset so properties and secrets still
load.
+ needClientBackedFileset = true;
+ }
+ }
+ Fileset resolvedFileset =
+ needClientBackedFileset ? loadClientBackedFileset(filesetIdent,
catalog) : fileset;
Review Comment:
Addressed in aa45b0890 — after rebasing onto #14975, `getAllProperties`
reuses `OperationScope` (`loadCatalog` / `loadFileset` keyed by
`FilesetCatalog` identity) and no longer takes a `Fileset` from `getFileset()`.
Added `testCustomGetFilesetWithSecretsDoesNotChangeBackendProperties` verifying
that backend configuration still comes from the client fileset even when an
overriding `getFileset()` returns a `Fileset` with `supportsSecrets()` and
different properties.
--
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]