kylin-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [kylin] hit-lacus commented on issue #1133: KYLIN-4397 Use newLinkedHashMap for deterministic order in AssignmentUtil.java
Date Wed, 04 Mar 2020 05:33:57 GMT
hit-lacus commented on issue #1133: KYLIN-4397 Use newLinkedHashMap for deterministic order
in AssignmentUtil.java	
URL: https://github.com/apache/kylin/pull/1133#issuecomment-594336238
 
 
   I am a little confused at the moment.
   
   From your message in JIRA issue, you found that error :
   
   ```java
   java.lang.AssertionError: expected:<2> but was:<1>
   at org.apache.kylin.stream.coordinator.assign.DefaultAssignerTest.reBalanceTest(DefaultAssignerTest.java:165)
when executing assertEquals(2, rsAssignment.size());
   ```
   
   You claim that you `LinkedHashMap` has guarantees to its order, and I agreed with it.
   So you thought change the implementation of the `result` from `HashMap` to `LinkedHashMap`,
right? And`result` is the return value of DefaultAssigner#reBalancePlan. 
   
   ```java
       public Map<Integer, Map<String, List<Partition>>> reBalancePlan(List<ReplicaSet>
replicaSets,
               List<StreamingCubeInfo> cubes, List<CubeAssignment> existingAssignments)
{
           Map<Integer, Map<String, List<Partition>>> newPlan = Maps.newHashMap();
           if (replicaSets == null || cubes == null || cubes.size() == 0 || replicaSets.size()
== 0) {
               return newPlan;
       }
   ```
   
   So, maybe you change the implementation of `newPlan`, right? Not in the `AssignmentUtil.java`.
   
   Finally , I didn't reproduce this kind of error in my dev env. I felt confused too.
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message