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

Jitendra Nath Pandey commented on HDFS-8983:
--------------------------------------------

 {code}
+      checkProtectedDescendants(fsd, src.endsWith(Path.SEPARATOR) ?
+          src.substring(0, src.length() - 1) : src);
{code}
* Is it possible to use {{normalizePath}} to get rid of the separator?

 {code}
+            protectedDirs.subSet(src + Path.SEPARATOR, src + "0")
{code}
* This is clever, please put a comment why its correct. I guess because "0" is 
the next ascii character after "/"?

The patch looks good otherwise.


 

> NameNode support for protected directories
> ------------------------------------------
>
>                 Key: HDFS-8983
>                 URL: https://issues.apache.org/jira/browse/HDFS-8983
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: namenode
>    Affects Versions: 2.7.1
>            Reporter: Arpit Agarwal
>            Assignee: Arpit Agarwal
>         Attachments: HDFS-8393.01.patch, HDFS-8393.02.patch, 
> HDFS-8983.03.patch
>
>
> To protect important system directories from inadvertent deletion (e.g. 
> /Users) the NameNode can allow marking directories as _protected_. Such 
> directories cannot be deleted unless they are empty. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to