yuqi1129 commented on code in PR #9507:
URL: https://github.com/apache/gravitino/pull/9507#discussion_r2638881116


##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/GravitinoVirtualFileSystemUtils.java:
##########
@@ -324,6 +326,13 @@ public static String getSubPathFromGvfsPath(NameIdentifier 
identifier, String gv
     return gvfsPath.substring(prefix.length());
   }
 
+  static void setCallerContextForGetCredentials(String locationName) {
+    Map<String, String> contextMap = Maps.newHashMap();
+    contextMap.put(CredentialConstants.HTTP_HEADER_CURRENT_LOCATION_NAME, 
locationName);
+    CallerContext callerContext = 
CallerContext.builder().withContext(contextMap).build();

Review Comment:
   I remembered you guys are not favour of using `ThreadLocal `.



##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/GravitinoVirtualFileSystemUtils.java:
##########
@@ -324,6 +326,13 @@ public static String getSubPathFromGvfsPath(NameIdentifier 
identifier, String gv
     return gvfsPath.substring(prefix.length());
   }
 
+  static void setCallerContextForGetCredentials(String locationName) {
+    Map<String, String> contextMap = Maps.newHashMap();
+    contextMap.put(CredentialConstants.HTTP_HEADER_CURRENT_LOCATION_NAME, 
locationName);
+    CallerContext callerContext = 
CallerContext.builder().withContext(contextMap).build();

Review Comment:
   Does the `callerContext` here use `ThreadLocal` mechanism to hold the 
location name here?



##########
clients/filesystem-hadoop3/src/test/java/org/apache/gravitino/filesystem/hadoop/integration/test/GravitinoVirtualFileSystemS3CredentialIT.java:
##########
@@ -107,10 +107,9 @@ public void startUp() throws Exception {
     conf.set("fs.gvfs.impl.disable.cache", "true");
     conf.set("fs.gravitino.server.uri", serverUri);
     conf.set("fs.gravitino.client.metalake", metalakeName);
+    conf.set("fs.gravitino.enableCredentialVending", "true");
 
     // Pass this configuration to the real file system
-    conf.set(S3Properties.GRAVITINO_S3_SECRET_ACCESS_KEY, S3_SECRET_KEY);
-    conf.set(S3Properties.GRAVITINO_S3_ACCESS_KEY_ID, S3_ACCESS_KEY);

Review Comment:
   Why do we move these two down?



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