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

Rakesh R commented on HDFS-9348:
--------------------------------

Attached patch to validate the file existence and throw FileNotFoundException. 
Please review it, thanks!

I've noticed that presently {{dfs.getEZForPath}} API is behaving differently 
for a +non-existent normal file+ and +non-existent ezone file+. Does this 
proposed change of throwing FNFException affect API's backward compatibility?
- If user pass a normal non-existent file then it will return {{null}} value. 
For example, {{/nonexistentfile}}
- if user pass a non-existent file but which is under an existing encryption 
zone then it is returning the parent's encryption zone info. For example, 
{{/ezone/nonexistentfile}}

> DFS GetErasureCodingPolicy API on a non-existent file should be handled 
> properly
> --------------------------------------------------------------------------------
>
>                 Key: HDFS-9348
>                 URL: https://issues.apache.org/jira/browse/HDFS-9348
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Rakesh R
>            Assignee: Rakesh R
>            Priority: Minor
>         Attachments: HDFS-9348-00.patch
>
>
> Presently calling {{dfs#getErasureCodingPolicy()}} on a non-existent file is 
> returning the ErasureCodingPolicy info. As per the 
> [discussion|https://issues.apache.org/jira/browse/HDFS-8777?focusedCommentId=14981077&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14981077]
>  it has to validate and throw FileNotFoundException.
> Also, {{dfs#getEncryptionZoneForPath()}} API has the same behavior. Again we 
> can discuss to add the file existence validation in this case.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to