vinaysbadami commented on a change in pull request #3041:
URL: https://github.com/apache/hadoop/pull/3041#discussion_r637013026



##########
File path: 
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/ClientCredsTokenProvider.java
##########
@@ -38,19 +42,27 @@
 
   private static final Logger LOG = 
LoggerFactory.getLogger(AccessTokenProvider.class);
 
-
   public ClientCredsTokenProvider(final String authEndpoint,
-                                  final String clientId, final String 
clientSecret) {
-
-    Preconditions.checkNotNull(authEndpoint, "authEndpoint");
-    Preconditions.checkNotNull(clientId, "clientId");
-    Preconditions.checkNotNull(clientSecret, "clientSecret");
+      final String clientId, final String clientSecret)
+      throws AzureBlobFileSystemException {
+    validateClientCredsTokenProvider(
+        ConfigurationKeys.FS_AZURE_ACCOUNT_OAUTH_CLIENT_ENDPOINT, 
authEndpoint);
+    validateClientCredsTokenProvider(
+        ConfigurationKeys.FS_AZURE_ACCOUNT_OAUTH_CLIENT_ID, clientId);
+    validateClientCredsTokenProvider(
+        ConfigurationKeys.FS_AZURE_ACCOUNT_OAUTH_CLIENT_SECRET, clientSecret);
 
     this.authEndpoint = authEndpoint;
     this.clientId = clientId;
     this.clientSecret = clientSecret;
   }
 
+  private void validateClientCredsTokenProvider(final String configName,

Review comment:
       move this to the code which gets the config and instantiates the 
tokenprovider




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

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