Review Board 1.7.22


HBASE-5526: Configurable file and directory based umask

Review Request #4217 - Created March 7, 2012 and submitted

Jesse Yates
0.94
HBASE-5526
Reviewers
hbase
lhofhansl
hbase-git
Currently many all the files created by the HBase user are just written using the default file permissions granted by hdfs. However, to ensure only the correct user/group views the files and directories, we need to be able to apply a configurable umask to either directories or files.

This ticket covers setting permissions for files written to dfs, as opposed to things like pid and log files.

The impetus for this was to allow the web-user to view the directory structure of hbase, but not to actually see any of the actual data hbase is storing.
"mvn clean test -P localTests" passes
src/main/java/org/apache/hadoop/hbase/HConstants.java
Revision e60ce04 New Change
[20] 603 lines
[+20]
604
  public static final int SOCKET_RETRY_WAIT_MS = 200;
604
  public static final int SOCKET_RETRY_WAIT_MS = 200;
605

    
   
605

   
606
  /** Host name of the local machine */
606
  /** Host name of the local machine */
607
  public static final String LOCALHOST = "localhost";
607
  public static final String LOCALHOST = "localhost";
608

    
   
608

   

    
   
609
  /** Enable file permission modification from standard hbase */

    
   
610
  public static final String ENABLE_DATA_FILE_UMASK = "hbase.data.umask.enable";

    
   
611
  /** File permission umask to use when creating hbase data files */

    
   
612
  public static final String DATA_FILE_UMASK_KEY = "hbase.data.umask";

    
   
613

   
609
  private HConstants() {
614
  private HConstants() {
610
    // Can't be instantiated with this ctor.
615
    // Can't be instantiated with this ctor.
611
  }
616
  }
612
}
617
}
src/main/java/org/apache/hadoop/hbase/io/hfile/AbstractHFileWriter.java
Revision 9e7e624 New Change
 
src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
Revision 76ff422 New Change
 
src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
Revision d2d7efe New Change
 
src/main/resources/hbase-default.xml
Revision 9277e0c New Change
 
src/test/java/org/apache/hadoop/hbase/util/TestFSUtils.java
Revision e2611e6 New Change
 
  1. src/main/java/org/apache/hadoop/hbase/HConstants.java: Loading...
  2. src/main/java/org/apache/hadoop/hbase/io/hfile/AbstractHFileWriter.java: Loading...
  3. src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java: Loading...
  4. src/main/java/org/apache/hadoop/hbase/util/FSUtils.java: Loading...
  5. src/main/resources/hbase-default.xml: Loading...
  6. src/test/java/org/apache/hadoop/hbase/util/TestFSUtils.java: Loading...