[
https://issues.apache.org/jira/browse/HDFS-5673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13853164#comment-13853164
]
Haohui Mai commented on HDFS-5673:
----------------------------------
bq. If we don't copy the list, then the immutability guarantee is weaker.
I guess you can use the same idea of building a wrapper for well-formed AclList
to avoid the copy. You can do the copy when constructing the wrapper. That way
the wrapper consolidate the validation logic and the immutability guarantee is
retained.
bq. In the current HDFS-5658 patch, we're starting to see some of that code
duplication related to holding the namesystem lock and checking permission, ...
The code you referred is around 10 lines per function, I think it is okay to
have some redundancy. On the other hand, The AclTransformation instances are
not purely functional -- they do have state. It seems that the particular
implementation of AclTransformation is losing both the bright side of
functional and imperative programming model. Therefore I think it is okay to
have some duplication here, it does not make the overall architecture worse. If
this is really a concern, it can be fixed easily with other techniques, e.g.,
aspectJ.
bq. I believe that's actually O(N^2), or perhaps more accurately O(N*M)
It seems to me that it requires no more than a merge sort. Using binary search
should give you O(nlogn).
> Implement logic for modification of ACLs.
> -----------------------------------------
>
> Key: HDFS-5673
> URL: https://issues.apache.org/jira/browse/HDFS-5673
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: namenode
> Affects Versions: HDFS ACLs (HDFS-4685)
> Reporter: Chris Nauroth
> Assignee: Chris Nauroth
> Attachments: HDFS-5673.1.patch
>
>
> This patch will include the core logic for modification of ACLs. This
> includes support for all user-facing APIs that modify ACLs. This will cover
> access ACLs, default ACLs, automatic mask calculations, automatic inference
> of unprovided default ACL entries, and validation to prevent creation of an
> invalid ACL.
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)