[ 
https://issues.apache.org/jira/browse/HDFS-16791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17628570#comment-17628570
 ] 

ASF GitHub Bot commented on HDFS-16791:
---------------------------------------

mccormickt12 commented on code in PR #4967:
URL: https://github.com/apache/hadoop/pull/4967#discussion_r1013490718


##########
hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md:
##########
@@ -599,6 +599,25 @@ on the filesystem.
     if len(FS, P) > 0:  getFileStatus(P).getBlockSize() > 0
     result == getFileStatus(P).getBlockSize()
 
+1. The outcome of this operation MUST be identical to the value of
+   `getFileStatus(P).getBlockSize()`.
+2. By inference, it MUST be > 0 for any file of length > 0.
+###  `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 root directory. There are constraints 
around how 
+renames are allowed to atomically occur (ex. across hdfs volumes or across 
encryption zones).
+
+#### Preconditions
+
+if no root path is found:  raise IOException
+No root path would be found only if there is no mount point for the given path
+
+
+#### Postconditions
+
+The path return will not be null

Review Comment:
   added more pre/post, should be more clear now and included some of what you 
suggested above





> New API for enclosing root path for a file
> ------------------------------------------
>
>                 Key: HDFS-16791
>                 URL: https://issues.apache.org/jira/browse/HDFS-16791
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Tom McCormick
>            Assignee: Tom McCormick
>            Priority: Major
>              Labels: pull-request-available
>
> At LinkedIn we run many HDFS volumes that are federated by either 
> ViewFilesystem or Router Based Federation. As our number of hdfs volumes 
> grows, we have a growing need to migrate data seemlessly across volumes.
> Many frameworks have a notion of staging or temp directories, but those 
> directories often live in random locations. We want an API getEnclosingRoot, 
> which provides the root path a file or dataset. 
> In ViewFilesystem / Router Based Federation, the enclosingRoot will be the 
> mount point.
> We will also take into account other restrictions for renames like 
> encryptions zones.
> If there are several paths (a mount point and an encryption zone), we will 
> return the longer path



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to