gabriellefu commented on code in PR #22788:
URL: https://github.com/apache/kafka/pull/22788#discussion_r3633241214


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/assignor/MockAssignor.java:
##########
@@ -56,13 +63,10 @@ public GroupAssignment assign(
         }
 
         // Copy existing assignment and fill temporary data structures
-        for (Map.Entry<String, AssignmentMemberSpec> memberEntry : 
groupSpec.members().entrySet()) {
-            final String memberId = memberEntry.getKey();
-            final AssignmentMemberSpec memberSpec = memberEntry.getValue();
-
-            Map<String, Set<Integer>> activeTasks = new 
HashMap<>(memberSpec.activeTasks());
+        for (final String memberId : groupSpec.memberIds()) {
+            Map<String, Set<Integer>> activeTasks = new 
HashMap<>(groupSpec.memberAssignmentState(memberId).activeTasks());

Review Comment:
   cause the memberAssignmentState is immutable(since it's what each member 
currently has it's a ground truth), and we copy the map so it can be changed



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to