yuqi1129 commented on code in PR #5974:
URL: https://github.com/apache/gravitino/pull/5974#discussion_r1908632537
##########
bundles/aws/src/main/java/org/apache/gravitino/s3/fs/S3FileSystemProvider.java:
##########
@@ -61,18 +68,34 @@ public FileSystem getFileSystem(Path path, Map<String,
String> config) throws IO
Map<String, String> hadoopConfMap =
FileSystemUtils.toHadoopConfigMap(config,
GRAVITINO_KEY_TO_S3_HADOOP_KEY);
+ hadoopConfMap.forEach(configuration::set);
if (!hadoopConfMap.containsKey(S3_CREDENTIAL_KEY)) {
- hadoopConfMap.put(S3_CREDENTIAL_KEY, S3_SIMPLE_CREDENTIAL);
+ configuration.set(S3_CREDENTIAL_KEY, S3_SIMPLE_CREDENTIAL);
}
- hadoopConfMap.forEach(configuration::set);
+ if (gravitinoCredentialVendingEnabled(config)) {
Review Comment:
It has already removed.
##########
bundles/azure/src/main/java/org/apache/gravitino/abs/fs/AzureFileSystemProvider.java:
##########
@@ -67,6 +77,31 @@ public FileSystem getFileSystem(@Nonnull Path path, @Nonnull
Map<String, String>
return FileSystem.get(path.toUri(), configuration);
}
+ @Override
+ public Map<String, String> getFileSystemCredentialConf(Credential[]
credentials) {
+ Credential credential =
AzureSasCredentialsProvider.getSuitableCredential(credentials);
+ Map<String, String> result = Maps.newHashMap();
+ if (credential instanceof ADLSTokenCredential) {
+ ADLSTokenCredential adlsTokenCredential = (ADLSTokenCredential)
credential;
+
+ String accountName = adlsTokenCredential.accountName();
+ result.put(FS_AZURE_ACCOUNT_AUTH_TYPE_PROPERTY_NAME + "." + accountName,
AuthType.SAS.name());
+ result.put(
+ FS_AZURE_SAS_TOKEN_PROVIDER_TYPE + "." + accountName,
+ AzureSasCredentialsProvider.class.getName());
+ result.put(FS_AZURE_ACCOUNT_IS_HNS_ENABLED, "true");
+ } else if (credential instanceof AzureAccountKeyCredential) {
+ AzureAccountKeyCredential azureAccountKeyCredential =
(AzureAccountKeyCredential) credential;
Review Comment:
I would be inclined to put them all in credential providers as their
interface supports both two. If you insist on this point, I can change.
--
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]