[
https://issues.apache.org/jira/browse/HADOOP-2759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567053#action_12567053
]
Pi Song commented on HADOOP-2759:
---------------------------------
My initial solution
1. As many other components may still refer to mkdirs (in Java sematic), let's
keep it and create a new method called mkdir. The new "mkdir" will only create
the specified directory *not including parents* so if all the parents don't
exist, it will not allow you to create.
2. This method is implemented at the NameNode side and requires a change in
ClientProtocol. As a matter of fact, if I just use ClientProtocol.exist and
ClientProtocol.mkdirs in combination to implement mkdir on the client side it
is possible but that incurs a bit more round-trip operations. I think I can
only spend a bit more time to make it better so let's go for the better one.
3. You will have to hook up the new mkdir method in DFSClient to fix
HADOOP-2391. What I do now to demonstrate the difference is just hooking up the
mkdir method to mkdir in the shell and move the old mkdir implementation
(which actually is mkdirs in Java) to mkdirs
So in the shell,
hadoop dfs -mkdir <dir> will not create parent dirs
hadoop dfs -mkdirs <dir> will create all the parents
4. In the current implementation if you mkdir a directory which already exists,
there will be no error message. This has to be fixed too.
> creating a file in hdfs should not automatically create the parent directories
> ------------------------------------------------------------------------------
>
> Key: HADOOP-2759
> URL: https://issues.apache.org/jira/browse/HADOOP-2759
> Project: Hadoop Core
> Issue Type: Bug
> Components: dfs
> Affects Versions: 0.17.0
> Reporter: Owen O'Malley
> Fix For: 0.17.0
>
> Attachments: HADOOP-2759_1.patch
>
>
> I think it would be better if HDFS didn't automatically create directories
> for the user. In particular, in clean up code, it would be nice if deleting a
> directory couldn't be undone by mistake by a process that hasn't been killed
> yet creating a new file.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.