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

Kevin Cox commented on HDFS-10276:
----------------------------------

I have tested on two moderately recent versions of hadoop and the following 
commands will reproduce the issue. The chmod is unnecessary in most cases but I 
have included it just to be sure. The following outputs are on a HDFS. When run 
on a local path 

{code}
% hdfs version
Hadoop 2.7.2
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r 
b165c4fe8a74265c792ce23f546c64604acf0e41
Compiled by jenkins on 2016-01-26T00:08Z
Compiled with protoc 2.5.0
>From source with checksum d0fda26633fa762bff87ec759ebe689c
This command was run using 
/usr/local/Cellar/hadoop/2.7.2/libexec/share/hadoop/common/hadoop-common-2.7.2.jar
% hdfs --config hadoop dfs -put <(echo "test") /test
2016-04-13 09:24:58,851 WARN  [main] util.NativeCodeLoader 
(NativeCodeLoader.java:<clinit>(62)) - Unable to load native-hadoop library for 
your platform... using builtin-java classes where applicable
hdfs --config hadoop dfs -put <(echo "test") /test  2.74s user 0.21s system 
180% cpu 1.638 total
% hdfs --config hadoop dfs -chmod 777 /test         
2016-04-13 09:25:11,737 WARN  [main] util.NativeCodeLoader 
(NativeCodeLoader.java:<clinit>(62)) - Unable to load native-hadoop library for 
your platform... using builtin-java classes where applicable
% hdfs --config hadoop dfs -cat /test/bar           
2016-04-13 09:25:18,905 WARN  [main] util.NativeCodeLoader 
(NativeCodeLoader.java:<clinit>(62)) - Unable to load native-hadoop library for 
your platform... using builtin-java classes where applicable
cat: `/test/bar': No such file or directory
% hdfs --config hadoop dfs -cat file:///home/kevincox/test/foo
2016-04-13 09:29:34,150 WARN  [main] util.NativeCodeLoader 
(NativeCodeLoader.java:<clinit>(62)) - Unable to load native-hadoop library for 
your platform... using builtin-java classes where applicable
cat: `file:///Users/kevincox/test/foo': No such file or directory
{code}

This isn't a huge issue for the command line client because it returns the same 
exit code but in particular for the {{FileSystem.exists()}} method this is the 
difference between returning false and throwing an error.

> Different results for exist call for file.ext/name
> --------------------------------------------------
>
>                 Key: HDFS-10276
>                 URL: https://issues.apache.org/jira/browse/HDFS-10276
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Kevin Cox
>            Assignee: Yuanbo Liu
>
> Given you have a file {{/file}} an existence check for the path 
> {{/file/whatever}} will give different responses for different 
> implementations of FileSystem.
> LocalFileSystem will return false while DistributedFileSystem will throw 
> {{org.apache.hadoop.security.AccessControlException: Permission denied: ..., 
> access=EXECUTE, ...}}



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

Reply via email to