瀏覽代碼

AMBARI-16706. ADLS as default FS is not supported for any views (Gaurav Nagar via pallavkul)

Pallav Kulshreshtha 9 年之前
父節點
當前提交
270c23fb12

+ 5 - 0
contrib/views/utils/pom.xml

@@ -56,6 +56,11 @@
       <artifactId>hadoop-yarn-common</artifactId>
       <version>${hadoop.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.squareup.okhttp</groupId>
+      <artifactId>okhttp</artifactId>
+      <version>2.4.0</version>
+    </dependency>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>

+ 1 - 1
contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/ValidatorUtils.java

@@ -29,7 +29,7 @@ public class ValidatorUtils {
    * @return is url valid
    */
   public static boolean validateHdfsURL(String webhdfsUrl) {
-    String[] schemes = {"webhdfs", "hdfs", "s3","wasb","swebhdfs"};
+    String[] schemes = {"webhdfs", "hdfs", "s3", "wasb", "swebhdfs", "adl"};
     return validateURL(webhdfsUrl, schemes);
   }
 

+ 13 - 0
contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/ConfigurationBuilder.java

@@ -281,6 +281,7 @@ public class ConfigurationBuilder {
     conf.set("fs.swebhdfs.impl", SWebHdfsFileSystem.class.getName());
     
     configureWASB();
+    configureADL();
 
     return conf;
   }
@@ -302,6 +303,18 @@ public class ConfigurationBuilder {
     }
   }
 
+  /**
+   *  Fill adl properties if adl:// scheme configured
+   */
+  public void configureADL() {
+    if (defaultFsUri.getScheme().equals("adl")) {
+      conf.set("fs.adl.impl", "com.microsoft.azure.datalake.store.AdlFileSystem");
+      copyPropertyIfExists(CORE_SITE,"dfs.webhdfs.oauth2.access.token.provider");
+      copyPropertyIfExists(CORE_SITE,"fs.azure.datalake.token.provider.service.urls");
+      copyPropertyIfExists(CORE_SITE,"fs.azure.datalake.token.provider.script");
+    }
+  }
+
   /**
    * Builds the authentication configuration
    * @return map of HDFS auth params for view