hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject svn commit: r1230774 - in /hive/trunk: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java conf/hive-default.xml.template metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java
Date Thu, 12 Jan 2012 20:43:57 GMT
Author: namit
Date: Thu Jan 12 20:43:56 2012
New Revision: 1230774

URL: http://svn.apache.org/viewvc?rev=1230774&view=rev
Log:
HIVE-2504 Warehouse table subdirectories should inherit the group permissions of the warehouse
parent directory (Chinna Rao Lalam via namit)


Modified:
    hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
    hive/trunk/conf/hive-default.xml.template
    hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java

Modified: hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
URL: http://svn.apache.org/viewvc/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java?rev=1230774&r1=1230773&r2=1230774&view=diff
==============================================================================
--- hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (original)
+++ hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java Thu Jan 12 20:43:56
2012
@@ -556,6 +556,7 @@ public class HiveConf extends Configurat
     // Whether to delete the scratchdir while startup
     HIVE_START_CLEANUP_SCRATCHDIR("hive.start.cleanup.scratchdir", false),
     HIVE_INSERT_INTO_MULTILEVEL_DIRS("hive.insert.into.multilevel.dirs", false),
+    HIVE_FILES_UMASK_VALUE("hive.files.umask.vlaue", 0002),
     ;
 
     public final String varname;

Modified: hive/trunk/conf/hive-default.xml.template
URL: http://svn.apache.org/viewvc/hive/trunk/conf/hive-default.xml.template?rev=1230774&r1=1230773&r2=1230774&view=diff
==============================================================================
--- hive/trunk/conf/hive-default.xml.template (original)
+++ hive/trunk/conf/hive-default.xml.template Thu Jan 12 20:43:56 2012
@@ -1197,4 +1197,10 @@
   "insert directory '/HIVEFT25686/chinna/' from table"</description>
 </property>
 
+<property>
+  <name>hive.files.umask.vlaue</name>
+  <value>0002</value>
+  <description>The dfs.umask value for the hive created folders</description>
+</property>
+
 </configuration>

Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java?rev=1230774&r1=1230773&r2=1230774&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java Thu Jan
12 20:43:56 2012
@@ -41,6 +41,7 @@ import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.permission.FsAction;
+import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.hive.common.FileUtils;
 import org.apache.hadoop.hive.common.JavaUtils;
 import org.apache.hadoop.hive.conf.HiveConf;
@@ -171,6 +172,9 @@ public class Warehouse {
     try {
       fs = getFs(f);
       LOG.debug("Creating directory if it doesn't exist: " + f);
+      short umaskVal = (short) conf.getInt(HiveConf.ConfVars.HIVE_FILES_UMASK_VALUE.name(),
0002);
+      FsPermission fsPermission = new FsPermission(umaskVal);
+      FsPermission.setUMask(conf, fsPermission);
       return (fs.mkdirs(f) || fs.getFileStatus(f).isDir());
     } catch (IOException e) {
       closeFs(fs);



Mime
View raw message