FANNG1 commented on code in PR #6985:
URL: https://github.com/apache/gravitino/pull/6985#discussion_r2050193731
##########
catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/SecureHadoopCatalogOperations.java:
##########
@@ -262,17 +265,21 @@ public void testConnection(
@Override
public List<PathContext> getPathContext(NameIdentifier filesetIdentifier) {
Fileset fileset = loadFileset(filesetIdentifier);
- Map<String, String> locations = fileset.storageLocations();
- Preconditions.checkArgument(
- locations != null && !locations.isEmpty(),
- "No storage locations found for fileset: " + filesetIdentifier);
-
- // todo: support multiple storage locations
- String path =
locations.get(fileset.properties().get(PROPERTY_DEFAULT_LOCATION_NAME));
+ CallerContext callerContext = CallerContext.CallerContextHolder.get();
+ String targetLocationName =
Review Comment:
is it possible `targetLocationName` is null?
##########
catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/SecureHadoopCatalogOperations.java:
##########
@@ -262,17 +265,21 @@ public void testConnection(
@Override
public List<PathContext> getPathContext(NameIdentifier filesetIdentifier) {
Fileset fileset = loadFileset(filesetIdentifier);
- Map<String, String> locations = fileset.storageLocations();
- Preconditions.checkArgument(
- locations != null && !locations.isEmpty(),
- "No storage locations found for fileset: " + filesetIdentifier);
-
- // todo: support multiple storage locations
- String path =
locations.get(fileset.properties().get(PROPERTY_DEFAULT_LOCATION_NAME));
+ CallerContext callerContext = CallerContext.CallerContextHolder.get();
+ String targetLocationName =
+ callerContext != null
+ ?
callerContext.context().get(CredentialConstants.HTTP_HEADER_CURRENT_LOCATION_NAME)
+ : fileset.properties().get(PROPERTY_DEFAULT_LOCATION_NAME);
+ String path = fileset.storageLocations().get(targetLocationName);
Review Comment:
Could you use a method to get the location from a fileset and an optional
location name?
##########
docs/hadoop-catalog-with-gcs.md:
##########
@@ -487,6 +487,7 @@ GVFS Java client:
```java
Configuration conf = new Configuration();
+conf.setBoolean("fs.gravitino.enableCredentialVending", true);
Review Comment:
Please modify the description about how to enable credential vending.
--
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]