diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java index 761b5ff321273f..2bb9225d23755a 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java @@ -4908,9 +4908,9 @@ public CompletableFuture build() throws IOException { * Return path of the enclosing root for a given path * The enclosing root path is a common ancestor that should be used for temp and staging dirs * as well as within encryption zones and other restricted directories. - * + * * Call makeQualified on the param path to ensure the param path to ensure its part of the correct filesystem - * + * * @param path file path to find the enclosing root path for * @return a path to the enclosing root * @throws IOException diff --git a/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md b/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md index fda9b939a1a6d1..9632194940229c 100644 --- a/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md +++ b/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md @@ -605,8 +605,8 @@ on the filesystem. ### `Path getEnclosingRoot(Path p)` -This method is used to find a root directory for a path given. This is useful for creating -staging and temp directories in the same enclosing root directory. There are constraints around how +This method is used to find a root directory for a path given. This is useful for creating +staging and temp directories in the same enclosing root directory. There are constraints around how renames are allowed to atomically occur (ex. across hdfs volumes or across encryption zones). For any two paths p1 and p2 that do not have the same enclosing root, `rename(p1, p2)` is expected to fail or will not @@ -617,7 +617,7 @@ The following statement is always true: #### Preconditions -The path does not have to exist, but the path does need to be valid and reconcilable by the filesystem +The path does not have to exist, but the path does need to be valid and reconcilable by the filesystem * if a linkfallback is used all paths are reconcilable * if a linkfallback is not used there must be a mount point covering the path diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java index ea5ea2ccbcb4fe..159035fd5a9a1f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java @@ -1610,6 +1610,11 @@ public DatanodeInfo[] getSlowDatanodeReport() throws IOException { return clientProto.getSlowDatanodeReport(); } + @Override // ClientProtocol + public Path getEnclosingRoot(String src) throws IOException { + return clientProto.getEnclosingRoot(src); + } + @Override // NamenodeProtocol public BlocksWithLocations getBlocks(DatanodeInfo datanode, long size, long minBlockSize, long hotBlockTimeInterval) throws IOException { @@ -2110,9 +2115,4 @@ public ListenableFuture reload( return executorService.submit(() -> load(type)); } } - - @Override // ClientProtocol - public Path getEnclosingRoot(String src) throws IOException { - return clientProto.getEnclosingRoot(src); - } }