hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-7881) Add FSUtils method delete(Path f, boolean recursive)
Date Tue, 19 Feb 2013 20:15:13 GMT

    [ https://issues.apache.org/jira/browse/HBASE-7881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13581585#comment-13581585

stack commented on HBASE-7881:

[~ted_yu] Is [~mbertozzi] unable to file his own issues?
> Add FSUtils method delete(Path f, boolean recursive)
> ----------------------------------------------------
>                 Key: HBASE-7881
>                 URL: https://issues.apache.org/jira/browse/HBASE-7881
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Ted Yu
> From Matteo (https://reviews.apache.org/r/9416/diff/2/?file=258262#file258262line402):
> looking at the source, it seems that checking the return value and throw an exception
seems a good way to shoot ourselves in the foot. I've added that check in other places and
not I'm regretting that...
> because a return false doesn't really mean I'm not able to delete the file/dir.
> maybe the file is already deleted by someone else, or renamed...
> You want to throw an exception only if the file/dir is still there...
> so if we don't trust that the API will provide an exception is case of failure
> we should do something like
> {code}
> if (!fs.delete(workingDir, true)) {
>   // Make sure that the dir is still there
>   if (fs.exists(workingDir)) { 
>     throw new IOException("Unable to delete " + workingDir);
>   }
> }
> {code}
> We can add the following method to FSUtils:
> void delete(Path f, boolean recursive) throws IOException;

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message