hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-4619) No Exception is thrown if we try to create directory using FileContext (create) on RawLocalFileSystem. Even if the directory already exists.
Date Wed, 22 May 2013 14:09:35 GMT

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

Steve Loughran commented on HDFS-4619:
--------------------------------------

RawLocalFS could look for the dir existing and throw the exception if it exists -and we were
happy that this is the expected behaviour. I'm not sure it is. 

The FS will throw {{FileAlreadyExistsException}} if a parent directory entry exists and is
not a directory. This is the same behaviour as -on a first glance- HDFS does. 

It is not an error to create a filesystem that is already there. 
# we should add a test, if there is not one already, that creating a dir under a file throws
an exception.
# {{FileSystemContractBaseTest#testMkdirsFailsForSubdirectoryOfExistingFile()}} verifies that
trying to create a subdir of a file fails, while {{testMkdirs()}} verifies that {{mkdirs()}}
is idempotent, that it does not fail if called repeatedly.

Which makes me think that {{RawLocalFileSystem}} is behaving according to its specification
-that just doesn't match the expectations of where it is called
                
> No Exception is thrown if we try to create directory using FileContext (create) on RawLocalFileSystem.
 Even if the directory already exists.
> ---------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-4619
>                 URL: https://issues.apache.org/jira/browse/HDFS-4619
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Omkar Vinit Joshi
>            Priority: Critical
>
> as per FileContext create should fail if the file/directory is already present. However
if the underlying filesystem is RawLocalFileSystem then it doesn't throw any exception.
> FileContext.create()
> RawLocalFileSystem.mkdirs()

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

Mime
View raw message