ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbhowm...@apache.org
Subject ambari git commit: AMBARI-15044. HDFS API ignores fs.permissions.umask-mode property. (Gaurav Nagar via dipayanb)
Date Mon, 22 Feb 2016 17:15:17 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 1dbf7d4ef -> b0ab893ff


AMBARI-15044. HDFS API ignores fs.permissions.umask-mode property. (Gaurav Nagar via dipayanb)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b0ab893f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b0ab893f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b0ab893f

Branch: refs/heads/trunk
Commit: b0ab893ff09a014b704c84615c852fdb6b1d84e7
Parents: 1dbf7d4
Author: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Authored: Mon Feb 22 22:43:50 2016 +0530
Committer: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Committed: Mon Feb 22 22:44:52 2016 +0530

----------------------------------------------------------------------
 contrib/views/files/src/main/resources/view.xml             | 8 ++++++++
 contrib/views/hive/src/main/resources/view.xml              | 9 +++++++++
 contrib/views/pig/src/main/resources/view.xml               | 9 +++++++++
 .../apache/ambari/view/utils/hdfs/ConfigurationBuilder.java | 6 ++++++
 4 files changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b0ab893f/contrib/views/files/src/main/resources/view.xml
----------------------------------------------------------------------
diff --git a/contrib/views/files/src/main/resources/view.xml b/contrib/views/files/src/main/resources/view.xml
index f594fbe..adaec10 100644
--- a/contrib/views/files/src/main/resources/view.xml
+++ b/contrib/views/files/src/main/resources/view.xml
@@ -88,6 +88,14 @@
         <cluster-config>fake</cluster-config>
     </parameter>
     <parameter>
+        <name>hdfs.umask-mode</name>
+        <description>The umask used when creating files and directories. Defaults to
022</description>
+        <label>Umask</label>
+        <default-value>022</default-value>
+        <required>false</required>
+        <cluster-config>hdfs-site/fs.permissions.umask-mode</cluster-config>
+    </parameter>
+    <parameter>
         <name>hdfs.auth_to_local</name>
         <description>Auth to Local Configuration</description>
         <label>Auth To Local</label>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b0ab893f/contrib/views/hive/src/main/resources/view.xml
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/view.xml b/contrib/views/hive/src/main/resources/view.xml
index e3aea70..892f044 100644
--- a/contrib/views/hive/src/main/resources/view.xml
+++ b/contrib/views/hive/src/main/resources/view.xml
@@ -167,6 +167,15 @@
     </parameter>
 
     <parameter>
+        <name>hdfs.umask-mode</name>
+        <description>The umask used when creating files and directories. Defaults to
022</description>
+        <label>Umask</label>
+        <default-value>022</default-value>
+        <required>false</required>
+        <cluster-config>hdfs-site/fs.permissions.umask-mode</cluster-config>
+    </parameter>
+
+    <parameter>
         <name>hdfs.auth_to_local</name>
         <description>Auth to Local Configuration</description>
         <label>Auth To Local</label>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b0ab893f/contrib/views/pig/src/main/resources/view.xml
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/view.xml b/contrib/views/pig/src/main/resources/view.xml
index 8dd4a4f..9df91f8 100644
--- a/contrib/views/pig/src/main/resources/view.xml
+++ b/contrib/views/pig/src/main/resources/view.xml
@@ -92,6 +92,15 @@
     </parameter>
 
     <parameter>
+        <name>hdfs.umask-mode</name>
+        <description>The umask used when creating files and directories. Defaults to
022</description>
+        <label>Umask</label>
+        <default-value>022</default-value>
+        <required>false</required>
+        <cluster-config>hdfs-site/fs.permissions.umask-mode</cluster-config>
+    </parameter>
+
+    <parameter>
         <name>webhdfs.username</name>
         <description>User and doAs for proxy user for HDFS. By default, uses the currently
logged-in Ambari user.</description>
         <label>WebHDFS Username</label>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b0ab893f/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/ConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/ConfigurationBuilder.java
b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/ConfigurationBuilder.java
index a739c84..121fe84 100644
--- a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/ConfigurationBuilder.java
+++ b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/ConfigurationBuilder.java
@@ -63,6 +63,9 @@ public class ConfigurationBuilder {
   public static final String FAILOVER_PROXY_PROVIDER_INSTANCE_PROPERTY = "webhdfs.client.failover.proxy.provider";
   public static final String FAILOVER_PROXY_PROVIDER_CLUSTER_PROPERTY  = "dfs.client.failover.proxy.provider.%s";
 
+  public static final String UMASK_CLUSTER_PROPERTY = "fs.permissions.umask-mode";
+  public static final String UMASK_INSTANCE_PROPERTY = "hdfs.umask-mode";
+
   private Configuration conf = new Configuration();
   private ViewContext context;
   private AmbariApi ambariApi = null;
@@ -224,6 +227,9 @@ public class ConfigurationBuilder {
     parseProperties();
     setAuthParams(buildAuthenticationConfig());
 
+    String umask = context.getProperties().get(UMASK_INSTANCE_PROPERTY);
+    if(umask != null && !umask.isEmpty()) conf.set(UMASK_CLUSTER_PROPERTY,umask);
+
     conf.set("fs.hdfs.impl", DistributedFileSystem.class.getName());
     conf.set("fs.webhdfs.impl", WebHdfsFileSystem.class.getName());
     conf.set("fs.file.impl", LocalFileSystem.class.getName());


Mime
View raw message