FANNG1 commented on code in PR #5974:
URL: https://github.com/apache/gravitino/pull/5974#discussion_r1907211439


##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/GravitinoVirtualFileSystem.java:
##########
@@ -410,6 +336,23 @@ private FilesetContextPair getFilesetContext(Path 
virtualPath, FilesetDataOperat
     return new FilesetContextPair(new Path(actualFileLocation), fs);
   }
 
+  private boolean credentialVending(Catalog catalog, NameIdentifier 
filesetIdentifier) {
+    try {
+      Fileset fileset =
+          catalog
+              .asFilesetCatalog()
+              .loadFileset(
+                  NameIdentifier.of(
+                      filesetIdentifier.namespace().level(2), 
filesetIdentifier.name()));
+      Credential[] credentials = 
fileset.supportsCredentials().getCredentials();
+      return credentials.length > 0;
+    } catch (Exception e) {
+      // No credential found, do nothing.

Review Comment:
   This should throw the exception not eat it.



##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/GravitinoVirtualFileSystem.java:
##########
@@ -383,7 +290,7 @@ private FilesetContextPair getFilesetContext(Path 
virtualPath, FilesetDataOperat
         StringUtils.isNotBlank(scheme), "Scheme of the actual file location 
cannot be null.");
     FileSystem fs =
         internalFileSystemCache.get(
-            scheme,
+            identifier,
             str -> {

Review Comment:
   the key are not `str` 



##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/GravitinoVirtualFileSystem.java:
##########
@@ -410,6 +336,23 @@ private FilesetContextPair getFilesetContext(Path 
virtualPath, FilesetDataOperat
     return new FilesetContextPair(new Path(actualFileLocation), fs);
   }
 
+  private boolean credentialVending(Catalog catalog, NameIdentifier 
filesetIdentifier) {

Review Comment:
   credentialVending -> isCredentialVendingEnabled?



##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/GravitinoVirtualFileSystem.java:
##########
@@ -360,6 +266,7 @@ private FilesetContextPair getFilesetContext(Path 
virtualPath, FilesetDataOperat
     FilesetCatalog filesetCatalog =
         catalogCache.get(
             catalogIdent, ident -> 
client.loadCatalog(catalogIdent.name()).asFilesetCatalog());
+    Catalog catalog = (Catalog) filesetCatalog;

Review Comment:
   why add this line?



-- 
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]

Reply via email to