diff --git a/bundles/azure/src/main/java/org/apache/gravitino/abs/fs/AzureFileSystemProvider.java b/bundles/azure/src/main/java/org/apache/gravitino/abs/fs/AzureFileSystemProvider.java index 3dcbb502f62..762f7fe44e4 100644 --- a/bundles/azure/src/main/java/org/apache/gravitino/abs/fs/AzureFileSystemProvider.java +++ b/bundles/azure/src/main/java/org/apache/gravitino/abs/fs/AzureFileSystemProvider.java @@ -79,7 +79,7 @@ public FileSystem getFileSystem(@Nonnull Path path, @Nonnull Map @Override public Map getFileSystemCredentialConf(Credential[] credentials) { - Credential credential = AzureStorageUtils.getSuitableCredential(credentials); + Credential credential = AzureStorageUtils.getAzureStorageTokenCredential(credentials); Map result = Maps.newHashMap(); if (credential instanceof ADLSTokenCredential) { ADLSTokenCredential adlsTokenCredential = (ADLSTokenCredential) credential; diff --git a/bundles/azure/src/main/java/org/apache/gravitino/abs/fs/AzureSasCredentialsProvider.java b/bundles/azure/src/main/java/org/apache/gravitino/abs/fs/AzureSasCredentialsProvider.java index 0677039cad7..183445a82eb 100644 --- a/bundles/azure/src/main/java/org/apache/gravitino/abs/fs/AzureSasCredentialsProvider.java +++ b/bundles/azure/src/main/java/org/apache/gravitino/abs/fs/AzureSasCredentialsProvider.java @@ -66,7 +66,7 @@ public String getSASToken(String account, String fileSystem, String path, String private void refresh() { Credential[] gravitinoCredentials = gravitinoFileSystemCredentialsProvider.getCredentials(); - Credential credential = AzureStorageUtils.getSuitableCredential(gravitinoCredentials); + Credential credential = AzureStorageUtils.getAzureStorageTokenCredential(gravitinoCredentials); if (credential == null) { throw new RuntimeException("No suitable credential for OSS found..."); } diff --git a/bundles/azure/src/main/java/org/apache/gravitino/abs/fs/AzureStorageUtils.java b/bundles/azure/src/main/java/org/apache/gravitino/abs/fs/AzureStorageUtils.java index 66790c60da5..a265fec31a5 100644 --- a/bundles/azure/src/main/java/org/apache/gravitino/abs/fs/AzureStorageUtils.java +++ b/bundles/azure/src/main/java/org/apache/gravitino/abs/fs/AzureStorageUtils.java @@ -31,7 +31,7 @@ public class AzureStorageUtils { * @param credentials The credential array. * @return A credential. Null if not found. */ - static Credential getSuitableCredential(Credential[] credentials) { + static Credential getAzureStorageTokenCredential(Credential[] credentials) { // Use dynamic credential if found. for (Credential credential : credentials) { if (credential instanceof ADLSTokenCredential) { diff --git a/bundles/gcp/src/main/java/org/apache/gravitino/gcs/fs/GCSCredentialsProvider.java b/bundles/gcp/src/main/java/org/apache/gravitino/gcs/fs/GCSCredentialsProvider.java index 58bd88dcd03..c4eefeeebe0 100644 --- a/bundles/gcp/src/main/java/org/apache/gravitino/gcs/fs/GCSCredentialsProvider.java +++ b/bundles/gcp/src/main/java/org/apache/gravitino/gcs/fs/GCSCredentialsProvider.java @@ -51,7 +51,7 @@ public AccessToken getAccessToken() { public void refresh() throws IOException { Credential[] gravitinoCredentials = gravitinoFileSystemCredentialsProvider.getCredentials(); - Credential credential = GCSUtils.getSuitableCredential(gravitinoCredentials); + Credential credential = GCSUtils.getGCSTokenCredential(gravitinoCredentials); if (credential == null) { throw new RuntimeException("No suitable credential for OSS found..."); } diff --git a/bundles/gcp/src/main/java/org/apache/gravitino/gcs/fs/GCSFileSystemProvider.java b/bundles/gcp/src/main/java/org/apache/gravitino/gcs/fs/GCSFileSystemProvider.java index 07d44fd4396..7ab38b2d7a9 100644 --- a/bundles/gcp/src/main/java/org/apache/gravitino/gcs/fs/GCSFileSystemProvider.java +++ b/bundles/gcp/src/main/java/org/apache/gravitino/gcs/fs/GCSFileSystemProvider.java @@ -54,7 +54,7 @@ public FileSystem getFileSystem(Path path, Map config) throws IO @Override public Map getFileSystemCredentialConf(Credential[] credentials) { - Credential credential = GCSUtils.getSuitableCredential(credentials); + Credential credential = GCSUtils.getGCSTokenCredential(credentials); Map result = Maps.newHashMap(); if (credential instanceof GCSTokenCredential) { result.put(GCS_TOKEN_PROVIDER_IMPL, GCSCredentialsProvider.class.getName()); diff --git a/bundles/gcp/src/main/java/org/apache/gravitino/gcs/fs/GCSUtils.java b/bundles/gcp/src/main/java/org/apache/gravitino/gcs/fs/GCSUtils.java index bf71fc89f04..f8fbfd6351b 100644 --- a/bundles/gcp/src/main/java/org/apache/gravitino/gcs/fs/GCSUtils.java +++ b/bundles/gcp/src/main/java/org/apache/gravitino/gcs/fs/GCSUtils.java @@ -30,7 +30,7 @@ public class GCSUtils { * @param credentials The credential array. * @return An credential. */ - static Credential getSuitableCredential(Credential[] credentials) { + static Credential getGCSTokenCredential(Credential[] credentials) { for (Credential credential : credentials) { if (credential instanceof GCSTokenCredential) { return credential;