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

Chris Nauroth commented on HDFS-10430:
--------------------------------------

It's not immediately clear to me why another project's tests would need direct 
access to this method instead of using the public {{FileSystem#access}} method. 
 Maybe seeing the proposed patch or pointing out examples would help clarify.

The reason for the existence of the package-private 
{{FileSystem#checkAccessPermissions}} method is to provide code sharing between 
{{FileSystem}} and {{AbstractFileSystem}} for a default implementation of 
{{access}} in the base classes.  However, that default implementation is not 
necessarily complete or correct for all file systems.  For HDFS, 
{{DistributedFileSystem}} overrides {{access}} to use an RPC to the NameNode.  
The implementation of that RPC at the NameNode is different from the base class 
implementation, because it considers not only permissions but also HDFS ACLs.  
If {{checkAccessPermissions}} is made public, then there is a risk that 
applications would call it directly from main code, unaware that they could be 
bypassing ACL logic when connected to HDFS.

> Refactor FileSystem#checkAccessPermissions for better reuse from tests
> ----------------------------------------------------------------------
>
>                 Key: HDFS-10430
>                 URL: https://issues.apache.org/jira/browse/HDFS-10430
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs
>            Reporter: Xiaobing Zhou
>            Assignee: Xiaobing Zhou
>
> FileSystem#checkAccessPermissions could be used in a bunch of tests from 
> different projects, but it's in hadoop-common, which is not visible in some 
> cases.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to