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

Chris Nauroth commented on HDFS-5594:
-------------------------------------

Thanks for taking a look, Haohui.

bq. Why Acl#entries is a set? I'm wondering whether it should be ordered.

I chose set rather than something else like list, because the entries are 
unique.  However, looking at this again, I think I've got it wrong.  The 
entries ought to be unique on scope+type+name and the ACL ought to disallow 
associating that key with different permission settings.  By including the 
perms in {{AclEntry#equals}} and {{AclEntry#hashCode}}, I haven't achieved 
that.  I'm thinking of changing the set to something like {{Map<AclEntry.Key, 
FsAction>}} to better represent the unique constraint.  Let me know if you 
agree, and I'll make the change.

The natural ordering for entries within an ACL is: 1) owner, 2) all named user 
entries (internal ordering undefined), 3) owning group, 4) all named group 
entries (internal ordering undefined), 5) other.  This is the ordering that 
will be required when we implement the enforcement logic.  I was planning on 
putting that ordering logic on the NameNode side, but I could also do it here 
on the model side in a {{AclEntry#Key#compareTo}} method if you prefer.  I'll 
include that version in the next patch.

I can switch to the Guava equivalents for {{equals}} and {{hashCode}}.

> FileSystem API for ACLs.
> ------------------------
>
>                 Key: HDFS-5594
>                 URL: https://issues.apache.org/jira/browse/HDFS-5594
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>    Affects Versions: HDFS ACLs (HDFS-4685)
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: HDFS-5594.1.patch, HDFS-5594.2.patch, HDFS-5594.3.patch
>
>
> Add new methods to {{FileSystem}} for manipulating ACLs.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Reply via email to