You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by GitBox <gi...@apache.org> on 2020/03/04 05:33:57 UTC

[GitHub] [kylin] hit-lacus commented on issue #1133: KYLIN-4397 Use newLinkedHashMap for deterministic order in AssignmentUtil.java

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