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

Chris Nauroth commented on HDFS-5908:
-------------------------------------

Thank you for the review, Haohui.  I'm going to commit this.

bq. I wonder, do you have any plans to make similar changes on the methods in 
{{AclTransformation}}?

I think there is less reason to use {{ImmutableList}} inside 
{{AclTransformation}}.  For the input ACL spec, the first thing we need to do 
is sort the entries so that the rest of the algorithms can assume the ordering. 
 Right now, we do that as an in-place sort on the list parsed from the 
protocol, so it's convenient for that to remain mutable.  For the output 
calculated ACL, it's always the full logical ACL.  For the physical storage, we 
always end up unpacking a few of those entries for mapping onto the permission 
bits, and the final list stored in the {{AclFeature}} is a different, smaller 
list.  I think the change is really important inside {{AclStorage}} and 
{{AclFeature}} though to guarantee that there is no accidental mutation of an 
ACL associated to an existing inode.

BTW, I just learned that the Guava immutable collections have a smaller memory 
footprint than the typical JDK data structures:

https://code.google.com/p/memory-measurer/wiki/ElementCostInDataStructures

That's a nice side benefit of this patch, and it's worth considering for future 
changes in areas that consume a lot of memory.

> Change AclFeature to capture list of ACL entries in an ImmutableList.
> ---------------------------------------------------------------------
>
>                 Key: HDFS-5908
>                 URL: https://issues.apache.org/jira/browse/HDFS-5908
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: namenode
>    Affects Versions: 3.0.0
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>            Priority: Minor
>         Attachments: HDFS-5908.1.patch
>
>
> After an {{AclFeature}} has been attached to an inode, its ACL entries must 
> be immutable.  We can enforce this in the type system more strongly by 
> storing the entries in an {{ImmutableList}} and changing the getter to return 
> that type instead of raw {{List}}.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to