This is an automated email from the ASF dual-hosted git repository.
shv pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.2 by this push:
new 5066722 HADOOP-18109. Ensure that default permissions of directories
under internal ViewFS directories are the same as directories on target
filesystems. Contributed by Chentao Yu. (3953)
5066722 is described below
commit 5066722eb70b82a532b55ce98a2623852fd195c8
Author: Chentao Yu <[email protected]>
AuthorDate: Thu Apr 15 17:46:40 2021 -0700
HADOOP-18109. Ensure that default permissions of directories under internal
ViewFS directories are the same as directories on target filesystems.
Contributed by Chentao Yu. (3953)
(cherry picked from commit 19d90e62fb28539f8c79bbb24f703301489825a6)
---
.../org/apache/hadoop/fs/viewfs/ViewFileSystem.java | 5 -----
.../hadoop/fs/viewfs/TestViewFileSystemHdfs.java | 19 +++++++++++++++++++
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java
index a430727..0ff2e73 100644
---
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java
+++
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java
@@ -1496,11 +1496,6 @@ public class ViewFileSystem extends FileSystem {
}
@Override
- public boolean mkdirs(Path dir) throws IOException {
- return mkdirs(dir, null);
- }
-
- @Override
public FSDataInputStream open(Path f, int bufferSize)
throws AccessControlException, FileNotFoundException, IOException {
checkPathIsSlash(f);
diff --git
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemHdfs.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemHdfs.java
index fcb5257..fdc7464 100644
---
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemHdfs.java
+++
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemHdfs.java
@@ -479,4 +479,23 @@ public class TestViewFileSystemHdfs extends
ViewFileSystemBaseTest {
assertEquals("The owner did not match ", owner,
userUgi.getShortUserName());
otherfs.delete(user1Path, false);
}
+
+ @Test
+ public void testInternalDirectoryPermissions() throws IOException {
+ LOG.info("Starting testInternalDirectoryPermissions!");
+ Configuration localConf = new Configuration(conf);
+ ConfigUtil.addLinkFallback(
+ localConf, new Path(targetTestRoot, "fallbackDir").toUri());
+ FileSystem fs = FileSystem.get(FsConstants.VIEWFS_URI, localConf);
+ // check that the default permissions on a sub-folder of an internal
+ // directory are the same as those created on non-internal directories.
+ Path subDirOfInternalDir = new Path("/internalDir/dir1");
+ fs.mkdirs(subDirOfInternalDir);
+
+ Path subDirOfRealDir = new Path("/internalDir/linkToDir2/dir1");
+ fs.mkdirs(subDirOfRealDir);
+
+ assertEquals(fs.getFileStatus(subDirOfInternalDir).getPermission(),
+ fs.getFileStatus(subDirOfRealDir).getPermission());
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]