HADOOP-17054. ABFS: Fix test AbfsClient authentication instance
Contributed by Sneha Vijayarajan
This commit is contained in:
parent
6c9f75cf16
commit
37b1b4799d
@ -246,6 +246,9 @@ public static AbfsClient createTestClientFromCurrentContext(
|
|||||||
AbfsClient baseAbfsClientInstance,
|
AbfsClient baseAbfsClientInstance,
|
||||||
AbfsConfiguration abfsConfig)
|
AbfsConfiguration abfsConfig)
|
||||||
throws AzureBlobFileSystemException {
|
throws AzureBlobFileSystemException {
|
||||||
|
AuthType currentAuthType = abfsConfig.getAuthType(
|
||||||
|
abfsConfig.getAccountName());
|
||||||
|
|
||||||
AbfsPerfTracker tracker = new AbfsPerfTracker("test",
|
AbfsPerfTracker tracker = new AbfsPerfTracker("test",
|
||||||
abfsConfig.getAccountName(),
|
abfsConfig.getAccountName(),
|
||||||
abfsConfig);
|
abfsConfig);
|
||||||
@ -253,12 +256,17 @@ public static AbfsClient createTestClientFromCurrentContext(
|
|||||||
// Create test AbfsClient
|
// Create test AbfsClient
|
||||||
AbfsClient testClient = new AbfsClient(
|
AbfsClient testClient = new AbfsClient(
|
||||||
baseAbfsClientInstance.getBaseUrl(),
|
baseAbfsClientInstance.getBaseUrl(),
|
||||||
new SharedKeyCredentials(abfsConfig.getAccountName().substring(0,
|
(currentAuthType == AuthType.SharedKey
|
||||||
|
? new SharedKeyCredentials(
|
||||||
|
abfsConfig.getAccountName().substring(0,
|
||||||
abfsConfig.getAccountName().indexOf(DOT)),
|
abfsConfig.getAccountName().indexOf(DOT)),
|
||||||
abfsConfig.getStorageAccountKey()),
|
abfsConfig.getStorageAccountKey())
|
||||||
|
: null),
|
||||||
abfsConfig,
|
abfsConfig,
|
||||||
new ExponentialRetryPolicy(abfsConfig.getMaxIoRetries()),
|
new ExponentialRetryPolicy(abfsConfig.getMaxIoRetries()),
|
||||||
abfsConfig.getTokenProvider(),
|
(currentAuthType == AuthType.OAuth
|
||||||
|
? abfsConfig.getTokenProvider()
|
||||||
|
: null),
|
||||||
tracker);
|
tracker);
|
||||||
|
|
||||||
return testClient;
|
return testClient;
|
||||||
|
Loading…
Reference in New Issue
Block a user