jerryshao commented on code in PR #5974:
URL: https://github.com/apache/gravitino/pull/5974#discussion_r1907060886
##########
bundles/gcp/src/main/java/org/apache/gravitino/gcs/fs/GCSFileSystemProvider.java:
##########
@@ -43,9 +45,18 @@ public FileSystem getFileSystem(Path path, Map<String,
String> config) throws IO
Configuration configuration = new Configuration();
FileSystemUtils.toHadoopConfigMap(config, GRAVITINO_KEY_TO_GCS_HADOOP_KEY)
.forEach(configuration::set);
+
+ if (enableCredentialProvidedByGravitino(config)) {
+ configuration.set(GCS_TOKEN_PROVIDER_IMPL,
GCSCredentialsProvider.class.getName());
+ }
+
return FileSystem.newInstance(path.toUri(), configuration);
}
+ private boolean enableCredentialProvidedByGravitino(Map<String, String>
config) {
+ return null !=
config.get(GravitinoFileSystemCredentialProvider.GVFS_CREDENTIAL_PROVIDER);
+ }
Review Comment:
I think we can also move this code to the common place.
--
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]