Author: cnauroth Date: Tue Mar 11 16:27:45 2014 New Revision: 1576411 URL: http://svn.apache.org/r1576411 Log: HDFS-5638. Merging change r1576410 from branch-2 to branch-2.4
Added: hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFileContextAcl.java - copied unchanged from r1576410, hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFileContextAcl.java Modified: hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/Hdfs.java hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java Modified: hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1576411&r1=1576410&r2=1576411&view=diff ============================================================================== --- hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original) +++ hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Tue Mar 11 16:27:45 2014 @@ -490,6 +490,9 @@ Release 2.4.0 - UNRELEASED HDFS-6069. Quash stack traces when ACLs are disabled. (cnauroth) + HDFS-5638. HDFS implementation of FileContext API for ACLs. + (Vinayakumar B via cnauroth) + HDFS-5535 subtasks: HDFS-5496. Make replication queue initialization asynchronous. (Vinay via Modified: hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/Hdfs.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/Hdfs.java?rev=1576411&r1=1576410&r2=1576411&view=diff ============================================================================== --- hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/Hdfs.java (original) +++ hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/Hdfs.java Tue Mar 11 16:27:45 2014 @@ -30,11 +30,12 @@ import java.util.NoSuchElementException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.permission.AclEntry; +import org.apache.hadoop.fs.permission.AclStatus; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.fs.Options.ChecksumOpt; import org.apache.hadoop.hdfs.CorruptFileBlockIterator; import org.apache.hadoop.hdfs.DFSClient; -import org.apache.hadoop.hdfs.DFSUtil; import org.apache.hadoop.hdfs.HdfsConfiguration; import org.apache.hadoop.hdfs.client.HdfsDataInputStream; import org.apache.hadoop.hdfs.client.HdfsDataOutputStream; @@ -383,6 +384,38 @@ public class Hdfs extends AbstractFileSy return tokenList; } + @Override + public void modifyAclEntries(Path path, List<AclEntry> aclSpec) + throws IOException { + dfs.modifyAclEntries(getUriPath(path), aclSpec); + } + + @Override + public void removeAclEntries(Path path, List<AclEntry> aclSpec) + throws IOException { + dfs.removeAclEntries(getUriPath(path), aclSpec); + } + + @Override + public void removeDefaultAcl(Path path) throws IOException { + dfs.removeDefaultAcl(getUriPath(path)); + } + + @Override + public void removeAcl(Path path) throws IOException { + dfs.removeAcl(getUriPath(path)); + } + + @Override + public void setAcl(Path path, List<AclEntry> aclSpec) throws IOException { + dfs.setAcl(getUriPath(path), aclSpec); + } + + @Override + public AclStatus getAclStatus(Path path) throws IOException { + return dfs.getAclStatus(getUriPath(path)); + } + /** * Renew an existing delegation token. * Modified: hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java?rev=1576411&r1=1576410&r2=1576411&view=diff ============================================================================== --- hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java (original) +++ hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java Tue Mar 11 16:27:45 2014 @@ -2665,7 +2665,7 @@ public class DFSClient implements java.i return clientContext; } - void modifyAclEntries(String src, List<AclEntry> aclSpec) + public void modifyAclEntries(String src, List<AclEntry> aclSpec) throws IOException { checkOpen(); try { @@ -2681,7 +2681,7 @@ public class DFSClient implements java.i } } - void removeAclEntries(String src, List<AclEntry> aclSpec) + public void removeAclEntries(String src, List<AclEntry> aclSpec) throws IOException { checkOpen(); try { @@ -2697,7 +2697,7 @@ public class DFSClient implements java.i } } - void removeDefaultAcl(String src) throws IOException { + public void removeDefaultAcl(String src) throws IOException { checkOpen(); try { namenode.removeDefaultAcl(src); @@ -2712,7 +2712,7 @@ public class DFSClient implements java.i } } - void removeAcl(String src) throws IOException { + public void removeAcl(String src) throws IOException { checkOpen(); try { namenode.removeAcl(src); @@ -2727,7 +2727,7 @@ public class DFSClient implements java.i } } - void setAcl(String src, List<AclEntry> aclSpec) throws IOException { + public void setAcl(String src, List<AclEntry> aclSpec) throws IOException { checkOpen(); try { namenode.setAcl(src, aclSpec); @@ -2742,7 +2742,7 @@ public class DFSClient implements java.i } } - AclStatus getAclStatus(String src) throws IOException { + public AclStatus getAclStatus(String src) throws IOException { checkOpen(); try { return namenode.getAclStatus(src);