steveloughran commented on a change in pull request #1842: HADOOP-16730 : ABFS:
Add Authorizer Interface
URL: https://github.com/apache/hadoop/pull/1842#discussion_r378949486
##########
File path:
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java
##########
@@ -578,21 +587,30 @@ public AccessTokenProvider getTokenProvider() throws
TokenAccessProviderExceptio
}
}
- public String getAbfsExternalAuthorizationClass() {
- return this.abfsExternalAuthorizationClass;
- }
+ public AbfsAuthorizer getAbfsAuthorizer() throws
AzureBlobFileSystemException {
+ if (this.authorizer != null)
+ {
+ return this.authorizer;
+ }
- public AbfsAuthorizer getAbfsAuthorizer() throws IOException {
- String authClassName = getAbfsExternalAuthorizationClass();
- AbfsAuthorizer authorizer = null;
+ String authClassName = this.abfsAuthorizerClass;
try {
if (authClassName != null && !authClassName.isEmpty()) {
@SuppressWarnings("unchecked")
Class<AbfsAuthorizer> authClass = (Class<AbfsAuthorizer>)
rawConfig.getClassByName(authClassName);
- authorizer = authClass.getConstructor(new Class[]
{Configuration.class}).newInstance(rawConfig);
+ this.authorizer =
+ authClass.getConstructor(new Class[]
{Configuration.class}).newInstance(rawConfig);
LOG.trace("Initializing {}", authClassName);
- authorizer.init();
+ this.authorizer.init();
+ if ((this.authorizer.getAuthType() != AuthType.SAS) && (
+ this.authorizer.getAuthType() != AuthType.None)) {
+ throw new AbfsAuthorizationException(
Review comment:
why the nested exception?
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]