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

Giovanni Matteo Fumarola commented on HADOOP-15536:
---------------------------------------------------

Thanks [[email protected]] and [~elgoiri] for the comments.

1) Where's this method going to be used ?

The method will be called by \{{ContainerLaunch}}. To create a directory the 
current code adds a "mkdir" instruction to the bash or cmd script. The new code 
in HADOOP-15528 will prevent this by creating the directory ahead.
This current Jira is just adding the utility method to simplify the review and 
the testing on HADOOP-15528.

2) And why return 0/1 over true/false? 

I chose 0/1 since the "mkdir" instruction can return 0 on success and 1 on 
failure. Other methods in \{{FileUtil}} have the same logic as return type.

3)What if we had a variant which did throw a FileExistsException if mkdir 
failed and the dest was a file?

I implemented that code for ContainerLaunch. I will do a better analysis of the 
possible scenarios and errors and I will update the code.

Agree on the other comments.

> Adding support in FileUtil for the creation of directories
> ----------------------------------------------------------
>
>                 Key: HADOOP-15536
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15536
>             Project: Hadoop Common
>          Issue Type: Sub-task
>            Reporter: Giovanni Matteo Fumarola
>            Assignee: Giovanni Matteo Fumarola
>            Priority: Major
>         Attachments: HADOOP-15536-HADOOP-15461.v1.patch, 
> HADOOP-15536-HADOOP-15461.v2.patch, HADOOP-15536.v1.patch
>
>
> Adding support in FileUtil for the creation of directories.



--
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