siddharthteotia commented on code in PR #8654:
URL: https://github.com/apache/pinot/pull/8654#discussion_r868875073


##########
pinot-plugins/pinot-file-system/pinot-adls/src/main/java/org/apache/pinot/plugin/filesystem/ADLSGen2PinotFS.java:
##########
@@ -128,21 +148,54 @@ public void init(PinotConfiguration config) {
         new DataLakeServiceClientBuilder().endpoint(dfsServiceEndpointUrl);
     BlobServiceClientBuilder blobServiceClientBuilder = new 
BlobServiceClientBuilder().endpoint(blobServiceEndpointUrl);
 
-    if (accountName != null && accessKey != null) {
-      LOGGER.info("Authenticating using the access key to the account.");
-      StorageSharedKeyCredential sharedKeyCredential = new 
StorageSharedKeyCredential(accountName, accessKey);
-      dataLakeServiceClientBuilder.credential(sharedKeyCredential);
-      blobServiceClientBuilder.credential(sharedKeyCredential);
-    } else if (clientId != null && clientSecret != null && tenantId != null) {
-      LOGGER.info("Authenticating using Azure Active Directory");
-      ClientSecretCredential clientSecretCredential =
-          new 
ClientSecretCredentialBuilder().clientId(clientId).clientSecret(clientSecret).tenantId(tenantId).build();
-      dataLakeServiceClientBuilder.credential(clientSecretCredential);
-      blobServiceClientBuilder.credential(clientSecretCredential);
-    } else {
-      // Error out as at least one mode of auth info needed
-      throw new IllegalArgumentException(
-          "Expecting either (accountName, accessKey) or (clientId, 
clientSecret, tenantId)");
+    switch (authType) {
+      case ACCESS_KEY: {
+        LOGGER.info("Authenticating using the access key to the account.");
+        Preconditions.checkNotNull(accountName, "Account Name cannot be null");

Review Comment:
   Shouldn't this be the case regardless of auth type ?



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to