[ 
https://issues.apache.org/jira/browse/HADOOP-6585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eli Collins updated HADOOP-6585:
--------------------------------

    Attachment: hadoop-6585-4.patch

Thanks Hairong and Sanjay - glad we're all on the same page! 

Latest patch attached does not modify the behavior of FileStatus#isDir, just 
deprecates it, updates its comment and removes all the added isDir asserts in 
the tests that are now no longer necessary.

I left the ParentNotDirectoryException messages in FileSystem as is since 
getFileStatus will always fully resolve the link, ie if the parent is not a 
directory it must be a file (as opposed to getFileLinkStatus which can return a 
FileStatus that represents a link). Lemme know if I missed something.

Ditto the comment in getContentSummary is correct since f can't be a symlink, I 
modified that code to check isFile instead which is equivalent and I think more 
clear. 

Similarly in RawLocalFileSystem we want to check isDirectory in append since we 
are checking the FileStatus that the path fully resolves to, and we want to 
make sure that's not a directory. I should point out that in general the 
changes to FileSystem* are safe since isDir and isDirectory are now equivalent 
and FileSystem* always uses getFileStatus.

> Add FileStatus#isDirectory and isFile
> -------------------------------------
>
>                 Key: HADOOP-6585
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6585
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs
>    Affects Versions: 0.21.0, 0.22.0
>            Reporter: Eli Collins
>            Assignee: Eli Collins
>            Priority: Blocker
>             Fix For: 0.21.0, 0.22.0
>
>         Attachments: hadoop-6585-1.patch, hadoop-6585-2.patch, 
> hadoop-6585-3.patch, hadoop-6585-4.patch
>
>
> Per Sanjay's suggestion in HADOOP-6421 let's deprecate FileStatus#isDir() and 
> add isDirectory() and isFile() to compliment isSymlink. Currently clients 
> assume !isDir() implies a file, which is no longer true with symlinks. I'll 
> file a separate jira to change the various uses of !isDir() to be isFile() or 
> isFile() or isSymlink() as appropriate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to