kylin-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <>
Subject [jira] [Commented] (KYLIN-4397) Use newLinkedHashMap in
Date Thu, 26 Mar 2020 07:51:00 GMT


ASF GitHub Bot commented on KYLIN-4397:

shaofengshi commented on pull request #1133: KYLIN-4397 Use newLinkedHashMap for deterministic
order in	
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> Use newLinkedHashMap in
> -------------------------------------------
>                 Key: KYLIN-4397
>                 URL:
>             Project: Kylin
>          Issue Type: Bug
>            Reporter: cpugputpu
>            Assignee: cpugputpu
>            Priority: Minor
> The tests in can
fail and the failure is presented as follow.
> _java.lang.AssertionError: expected:<2> but was:<1>_
> _at
when executing _assertEquals(2, rsAssignment.size());_
> The root cause of this failure is when executing _Map<Integer, Map<String, List<Partition>>>
result = assigner.reBalancePlan(rsList, cubes, existingAssignments);_ it will iterate over
a HashMap. The stack trace is here:
> java.util.HashMap$EntrySet.iterator(
> The specification about HashMap says that "this class makes no guarantees as to the order
of the map; in particular, it does not guarantee that the order will remain constant over
time". The documentation is here for your reference: [|][l|]
> The fix is to use LinkedHashMap instead of HashMap when initializing a Map. In this way,
the non-deterministic behaviour is eliminated and the test will not suffer from the failure
again. The code will be more stable.

This message was sent by Atlassian Jira

View raw message