[
https://issues.apache.org/jira/browse/HDFS-2436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173904#comment-13173904
]
Konstantin Shvachko commented on HDFS-2436:
-------------------------------------------
Guys, accesTime and modificationTime are not supported for directories. It
would have been too expensive as any update of a file should trigger update of
all directories on the path.
So making times settable for directories is controversial. It was intentionally
implemented on files only. See discussions in HADOOP-1869 e.g. Dhruba's comment
saying:
[Implements access time for files. Directories do not have access
times.|https://issues.apache.org/jira/browse/HADOOP-1869?focusedCommentId=12624594&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12624594]
Aren't we creating a confusion here by letting people setTimes() which
generally are unsupported?
I agree though that the error message was bad. It should clearly say setTimes()
is not supported for directories rather than throwing FileNotFoundException.
I saw this behavior in DistCp, which tries to setTimes() on directories,
similar to WebHdfs.
> FSNamesystem.setTimes(..) expects the path is a file.
> -----------------------------------------------------
>
> Key: HDFS-2436
> URL: https://issues.apache.org/jira/browse/HDFS-2436
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.20.205.0
> Reporter: Arpit Gupta
> Assignee: Uma Maheswara Rao G
> Fix For: 0.23.0, 0.24.0
>
> Attachments: HDFS-2436.patch, HDFS-2436.patch, HDFS-2436.patch
>
>
> FSNamesystem.setTimes(..) does not work if the path is a directory.
> Arpit found this bug when testing webhdfs:
> {quote}
> settimes api is working when called on a file, but when called on a dir it
> returns a 404. I should be able to set time on both a file and a directory.
> {quote}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira