You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by da...@apache.org on 2020/05/26 22:26:43 UTC
[hadoop] branch trunk updated: HADOOP-17054. ABFS: Fix test
AbfsClient authentication instance
This is an automated email from the ASF dual-hosted git repository.
dazhou pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 37b1b47 HADOOP-17054. ABFS: Fix test AbfsClient authentication instance
37b1b47 is described below
commit 37b1b4799db680d4a8bd4cb389e00d044f1e4a37
Author: Sneha Vijayarajan <sn...@gmail.com>
AuthorDate: Tue May 26 15:26:28 2020 -0700
HADOOP-17054. ABFS: Fix test AbfsClient authentication instance
Contributed by Sneha Vijayarajan
---
.../fs/azurebfs/services/TestAbfsClient.java | 42 +++++++++++++---------
1 file changed, 25 insertions(+), 17 deletions(-)
diff --git a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestAbfsClient.java b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestAbfsClient.java
index ce9c032..0fd65fb 100644
--- a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestAbfsClient.java
+++ b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestAbfsClient.java
@@ -246,21 +246,29 @@ public final class TestAbfsClient {
AbfsClient baseAbfsClientInstance,
AbfsConfiguration abfsConfig)
throws AzureBlobFileSystemException {
- AbfsPerfTracker tracker = new AbfsPerfTracker("test",
- abfsConfig.getAccountName(),
- abfsConfig);
-
- // Create test AbfsClient
- AbfsClient testClient = new AbfsClient(
- baseAbfsClientInstance.getBaseUrl(),
- new SharedKeyCredentials(abfsConfig.getAccountName().substring(0,
- abfsConfig.getAccountName().indexOf(DOT)),
- abfsConfig.getStorageAccountKey()),
- abfsConfig,
- new ExponentialRetryPolicy(abfsConfig.getMaxIoRetries()),
- abfsConfig.getTokenProvider(),
- tracker);
-
- return testClient;
- }
+ AuthType currentAuthType = abfsConfig.getAuthType(
+ abfsConfig.getAccountName());
+
+ AbfsPerfTracker tracker = new AbfsPerfTracker("test",
+ abfsConfig.getAccountName(),
+ abfsConfig);
+
+ // Create test AbfsClient
+ AbfsClient testClient = new AbfsClient(
+ baseAbfsClientInstance.getBaseUrl(),
+ (currentAuthType == AuthType.SharedKey
+ ? new SharedKeyCredentials(
+ abfsConfig.getAccountName().substring(0,
+ abfsConfig.getAccountName().indexOf(DOT)),
+ abfsConfig.getStorageAccountKey())
+ : null),
+ abfsConfig,
+ new ExponentialRetryPolicy(abfsConfig.getMaxIoRetries()),
+ (currentAuthType == AuthType.OAuth
+ ? abfsConfig.getTokenProvider()
+ : null),
+ tracker);
+
+ return testClient;
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org