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

Xiao Chen commented on HDFS-13622:
----------------------------------

Good discussions Shweta and Siyao. Agreed. IMO it is sufficient to just tell 
the user that the immediate parent does not exist. It is then the user's 
freedom to mkdirs, or to change the parent in case of a typo. In other words 
the confusion of "the dir that's being mkdir'ed doesn't exist" message is 
removed. (And this way, we don't force the extra {{exists}} RPCs)

Some nitpicks on latest patch:
 - {{Mkdir}}: It seems {{Path#getParent}} could return null. Has this been 
considered? Would be good to add a test about this if there isn't an existing 
one
 * {{Mkdir}}: unnecessary space changes at line 42 and line 50.
 * {{TestDFSSehll}}: the assertion message {{-mkdir returned there is No such 
file or directory}} should be more descriptive. Something like {{testChild 
should not be in the 'No such file or directory' message}}
 - {{Mkdir}}: Since we'll need another rev, suggest to have declare the 
{{Path}} variables {{final}}

> dfs mkdir should not report the directory which to be created
> -------------------------------------------------------------
>
>                 Key: HDFS-13622
>                 URL: https://issues.apache.org/jira/browse/HDFS-13622
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Zoltan Haindrich
>            Assignee: Shweta
>            Priority: Major
>         Attachments: HDFS-13622.02.patch, HDFS-13622.03.patch
>
>
> this is a bit misleading:
> {code}
> $ hdfs  dfs -mkdir /nonexistent/newdir
> mkdir: `/nonexistent/newdir': No such file or directory
> {code}
> I think this command should fail because "nonexistent" doesn't exists...
> the correct would be:
> {code}
> $ hdfs  dfs -mkdir /nonexistent/newdir
> mkdir: `/nonexistent': No such file or directory
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to