mchades commented on code in PR #13891:
URL: https://github.com/apache/gravitino/pull/13891#discussion_r4594749612
##########
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:
With metadata caching off (the default), this private overload bypasses
`getFileset(NameIdentifier)` and the `getFilesetCatalog` call it would make.
With either override configured via `fs.gravitino.operations.class`, `open()`
selected the custom location on the base and the catalog’s location on this
revision. Please preserve dispatch to those hooks and cover the case where the
two filesets have different locations.
##########
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:
With the metadata cache enabled, a custom `getFileset` can return a
`FilesetDTO` for location resolution. That DTO inherits the default
`supportsSecrets()`, which throws `UnsupportedOperationException`. I verified
that `open()` succeeds on the base revision, where the client-backed fileset
supplies the properties and secrets, and fails here with credential vending
disabled. Please preserve the client-backed property lookup when the location
hook supplies a metadata-only fileset.
##########
clients/client-python/gravitino/filesystem/gvfs_base_operations.py:
##########
@@ -648,7 +671,11 @@ def _get_actual_filesystem_by_location_name(
:param location_name: The location name, None means the default
location
:return: The actual filesystem
"""
- fileset = self._get_fileset(fileset_ident)
+ catalog_ident = NameIdentifier.of(
+ fileset_ident.namespace().level(0),
fileset_ident.namespace().level(1)
+ )
+ catalog = self._get_fileset_catalog(catalog_ident)
+ fileset = self._get_fileset(fileset_ident, catalog=catalog)
Review Comment:
An existing `operations_class` subclass with `_get_fileset(self,
fileset_ident)` now raises `TypeError` on the new `catalog` keyword. A subclass
overriding the previous `_merge_fileset_properties(self, fileset_ident,
actual_location)` signature fails on the new `fileset` keyword below. I checked
`gvfs.exists()` with each subclass and both cache settings. All four cases
passed on the base and failed on this revision. Please preserve the call
signatures used by existing overrides when passing preloaded metadata
internally.
--
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]