diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFileSystem.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFileSystem.java index 99c18b6646c..e05c574063f 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFileSystem.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFileSystem.java @@ -334,6 +334,10 @@ public class FilterFileSystem extends FileSystem { return fs.mkdirs(f, permission); } + @Override + public boolean mkdirs(Path f) throws IOException { + return fs.mkdirs(f); + } /** * The src file is on the local disk. Add it to FS at diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ChRootedFileSystem.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ChRootedFileSystem.java index cec18918f62..c93225f8fd0 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ChRootedFileSystem.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ChRootedFileSystem.java @@ -279,6 +279,11 @@ class ChRootedFileSystem extends FilterFileSystem { return super.mkdirs(fullPath(f), permission); } + @Override + public boolean mkdirs(final Path f) throws IOException { + return super.mkdirs(fullPath(f)); + } + @Override public FSDataInputStream open(final Path f, final int bufferSize) throws IOException { 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 f127d8d012a..6bc469c6752 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 @@ -549,12 +549,19 @@ public class ViewFileSystem extends FileSystem { suffix.length() == 0 ? f : new Path(res.resolvedPath, suffix)); } + @Override + public boolean mkdirs(Path dir) throws IOException { + InodeTree.ResolveResult res = + fsState.resolve(getUriPath(dir), false); + return res.targetFileSystem.mkdirs(res.remainingPath); + } + @Override public boolean mkdirs(final Path dir, final FsPermission permission) throws IOException { InodeTree.ResolveResult res = - fsState.resolve(getUriPath(dir), false); - return res.targetFileSystem.mkdirs(res.remainingPath, permission); + fsState.resolve(getUriPath(dir), false); + return res.targetFileSystem.mkdirs(res.remainingPath, permission); } @Override @@ -1171,6 +1178,12 @@ public class ViewFileSystem extends FileSystem { throw readOnlyMountTable("mkdirs", dir); } + @Override + public boolean mkdirs(Path dir) + throws AccessControlException, FileAlreadyExistsException { + return mkdirs(dir, null); + } + @Override public FSDataInputStream open(Path f, int bufferSize) throws AccessControlException, FileNotFoundException, IOException { diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFilterFileSystem.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFilterFileSystem.java index 6de4f074105..f0057a6c6d9 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFilterFileSystem.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFilterFileSystem.java @@ -77,7 +77,6 @@ public class TestFilterFileSystem { boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException; - public boolean mkdirs(Path f); public FSDataInputStream open(Path f); public FSDataInputStream open(PathHandle f); public FSDataOutputStream create(Path f);