Skip to content

Commit

Permalink
fix white space eol and move getEnclosingRoot method to be with other…
Browse files Browse the repository at this point in the history
… clientProtocol methods
  • Loading branch information
Tom McCormick committed Jan 25, 2023
1 parent 5865dad commit 3e233fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4908,9 +4908,9 @@ public CompletableFuture<FSDataInputStream> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -2110,9 +2115,4 @@ public ListenableFuture<DatanodeInfo[]> reload(
return executorService.submit(() -> load(type));
}
}

@Override // ClientProtocol
public Path getEnclosingRoot(String src) throws IOException {
return clientProto.getEnclosingRoot(src);
}
}

0 comments on commit 3e233fc

Please sign in to comment.