hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Lowe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-15836) Review of AccessControlList
Date Mon, 22 Oct 2018 22:00:00 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-15836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16659741#comment-16659741

Jason Lowe commented on HADOOP-15836:

bq. I think the right thing would be to fix the unit tests to not rely on the order?

Agree unit tests should not rely on order, but it looks like the fix may be misplaced here.
 If I understand this change properly, a HashSet was changed to a TreeSet not because it was
incorrect from an API semantic point of view but because tests were expecting a certain order.
 IMHO that's not a good change unless the API docs explicitly said it would preserve order.
 TreeSet is notoriously problematic from a performance point of view relative to HashSet.
 The getUsers method returns a Collection and no order should be implied there.  If tests
want to simplify their assertions then they can dump the collection into a temporary tree
set for comparisons, but we shouldn't force the implementation to pay the performance penalty
all the time so unit tests can do easy collection comparisons.

> Review of AccessControlList
> ---------------------------
>                 Key: HADOOP-15836
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15836
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: common, security
>    Affects Versions: 3.2.0
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Minor
>             Fix For: 3.3.0
>         Attachments: HADOOP-15836.1.patch
> * Improve unit tests (expected / actual were backwards)
> * Unit test expected elements to be in order but the class's return Collections were
> * Formatting cleanup
> * Removed superfluous white space
> * Remove use of LinkedList
> * Removed superfluous code
> * Use {{unmodifiable}} Collections where JavaDoc states that caller must not manipulate
the data structure

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org

View raw message