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

Xiao Chen commented on HADOOP-9214:
-----------------------------------

Thanks for working on this [~hgadre]. Looks pretty good overall!

I have 2 comments on the patch:
- It could theoretically be considered a change in behavior when touchz 
(without any flags) a file which already exists: before this it's expected for 
an new file (with CreateFlag == {{OVERWRITE}}) which will have a different 
inode; now it will just update the time on the existing file. Let's please keep 
the existing behavior of re-creating a file when no flags provided to touchz 
for compatibility. When a flag is provided, I think it's perfectly reasonable 
to just update the time as the patch is doing.
- In Touch.java, trivial but I think we should name the variables 
{{changeModTimeOnly}} and {{changeAccessTimeOnly}} without 'only'. They simply 
maps to the options that could be provided, and it seems we can check the 
'only' part just by logic.

> Update touchz to allow modifying atime and mtime
> ------------------------------------------------
>
>                 Key: HADOOP-9214
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9214
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: tools
>    Affects Versions: 0.23.5
>            Reporter: Brian Burton
>            Assignee: Hrishikesh Gadre
>            Priority: Minor
>         Attachments: HADOOP-9214-001.patch, HADOOP-9214-002.patch, 
> HADOOP-9214-003.patch
>
>
> Currently there is no way to set the mtime or atime of a file from the 
> "hadoop fs" command line. It would be useful if the 'hadoop fs -touchz' 
> command were updated to include this functionality.



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