steveloughran commented on a change in pull request #1842: HADOOP-16730 : ABFS: 
Add Authorizer Interface
URL: https://github.com/apache/hadoop/pull/1842#discussion_r378954776
 
 

 ##########
 File path: 
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/AbstractAbfsIntegrationTest.java
 ##########
 @@ -128,6 +134,46 @@ protected AbstractAbfsIntegrationTest() throws Exception {
   }
 
 
+  public void loadAuthorizer() throws Exception {
+    this.authorizer = abfsConfig.getAbfsAuthorizer();
+
+    // if authorizerClass is configured, auto-creation of filesystem is 
disabled
+    if (authorizer == null) {
+      throw new InvalidConfigurationValueException(
+          "loadAuthorizer failed as " + "authorizer class is not configured");
+    }
+
+    // if authorizerClass is configured, auto-creation of filesystem is 
disabled
+    abfsConfig.setBoolean(AZURE_CREATE_REMOTE_FILESYSTEM_DURING_INITIALIZATION,
+        false);
+
+    // AbstractAbfsIntegrationTest always uses a new instance of FileSystem,
+    // need to disable that and force filesystem provided in test configs.
+    String[] authorityParts = authorityParts(
+        new java.net.URI(rawConfig.get(FS_AZURE_CONTRACT_TEST_URI)));
+    this.fileSystemName = authorityParts[0];
+
+    // Reset URL with configured filesystem
+    final String abfsUrl =
+        this.getFileSystemName() + "@" + this.getAccountName();
+    URI defaultUri = null;
+
+    try {
+      defaultUri = new URI(abfsScheme, abfsUrl, null, null, null);
+    } catch (Exception ex) {
 
 Review comment:
   no need to catch and wrap

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to