|
@@ -49,6 +49,9 @@ import org.apache.hadoop.fs.RemoteIterator;
|
|
|
import org.apache.hadoop.fs.UnresolvedLinkException;
|
|
|
import org.apache.hadoop.fs.UnsupportedFileSystemException;
|
|
|
import org.apache.hadoop.fs.local.LocalConfigKeys;
|
|
|
+import org.apache.hadoop.fs.permission.AclEntry;
|
|
|
+import org.apache.hadoop.fs.permission.AclUtil;
|
|
|
+import org.apache.hadoop.fs.permission.AclStatus;
|
|
|
import org.apache.hadoop.fs.permission.FsPermission;
|
|
|
import org.apache.hadoop.fs.viewfs.InodeTree.INode;
|
|
|
import org.apache.hadoop.fs.viewfs.InodeTree.INodeLink;
|
|
@@ -603,6 +606,51 @@ public class ViewFs extends AbstractFileSystem {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void modifyAclEntries(Path path, List<AclEntry> aclSpec)
|
|
|
+ throws IOException {
|
|
|
+ InodeTree.ResolveResult<AbstractFileSystem> res =
|
|
|
+ fsState.resolve(getUriPath(path), true);
|
|
|
+ res.targetFileSystem.modifyAclEntries(res.remainingPath, aclSpec);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void removeAclEntries(Path path, List<AclEntry> aclSpec)
|
|
|
+ throws IOException {
|
|
|
+ InodeTree.ResolveResult<AbstractFileSystem> res =
|
|
|
+ fsState.resolve(getUriPath(path), true);
|
|
|
+ res.targetFileSystem.removeAclEntries(res.remainingPath, aclSpec);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void removeDefaultAcl(Path path)
|
|
|
+ throws IOException {
|
|
|
+ InodeTree.ResolveResult<AbstractFileSystem> res =
|
|
|
+ fsState.resolve(getUriPath(path), true);
|
|
|
+ res.targetFileSystem.removeDefaultAcl(res.remainingPath);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void removeAcl(Path path)
|
|
|
+ throws IOException {
|
|
|
+ InodeTree.ResolveResult<AbstractFileSystem> res =
|
|
|
+ fsState.resolve(getUriPath(path), true);
|
|
|
+ res.targetFileSystem.removeAcl(res.remainingPath);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void setAcl(Path path, List<AclEntry> aclSpec) throws IOException {
|
|
|
+ InodeTree.ResolveResult<AbstractFileSystem> res =
|
|
|
+ fsState.resolve(getUriPath(path), true);
|
|
|
+ res.targetFileSystem.setAcl(res.remainingPath, aclSpec);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AclStatus getAclStatus(Path path) throws IOException {
|
|
|
+ InodeTree.ResolveResult<AbstractFileSystem> res =
|
|
|
+ fsState.resolve(getUriPath(path), true);
|
|
|
+ return res.targetFileSystem.getAclStatus(res.remainingPath);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/*
|
|
@@ -832,5 +880,46 @@ public class ViewFs extends AbstractFileSystem {
|
|
|
throws AccessControlException {
|
|
|
throw readOnlyMountTable("setVerifyChecksum", "");
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void modifyAclEntries(Path path, List<AclEntry> aclSpec)
|
|
|
+ throws IOException {
|
|
|
+ checkPathIsSlash(path);
|
|
|
+ throw readOnlyMountTable("modifyAclEntries", path);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void removeAclEntries(Path path, List<AclEntry> aclSpec)
|
|
|
+ throws IOException {
|
|
|
+ checkPathIsSlash(path);
|
|
|
+ throw readOnlyMountTable("removeAclEntries", path);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void removeDefaultAcl(Path path) throws IOException {
|
|
|
+ checkPathIsSlash(path);
|
|
|
+ throw readOnlyMountTable("removeDefaultAcl", path);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void removeAcl(Path path) throws IOException {
|
|
|
+ checkPathIsSlash(path);
|
|
|
+ throw readOnlyMountTable("removeAcl", path);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void setAcl(Path path, List<AclEntry> aclSpec) throws IOException {
|
|
|
+ checkPathIsSlash(path);
|
|
|
+ throw readOnlyMountTable("setAcl", path);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AclStatus getAclStatus(Path path) throws IOException {
|
|
|
+ checkPathIsSlash(path);
|
|
|
+ return new AclStatus.Builder().owner(ugi.getUserName())
|
|
|
+ .group(ugi.getGroupNames()[0])
|
|
|
+ .addEntries(AclUtil.getMinimalAcl(PERMISSION_555))
|
|
|
+ .stickyBit(false).build();
|
|
|
+ }
|
|
|
}
|
|
|
}
|