rreddy-22 commented on code in PR #16068:
URL: https://github.com/apache/kafka/pull/16068#discussion_r1624783508


##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/consumer/TargetAssignmentBuilderTest.java:
##########
@@ -164,37 +164,40 @@ public void prepareMemberAssignment(
         public TargetAssignmentBuilder.TargetAssignmentResult build() {
             TopicsImage topicsImage = topicsImageBuilder.build().topics();
             // Prepare expected member specs.
-            Map<String, AssignmentMemberSpec> memberSpecs = new HashMap<>();
+            Map<String, MemberSubscriptionSpecImpl> memberSubscriptions = new 
HashMap<>();
+            Map<String, Map<Uuid, Set<Integer>>> targetAssignment = new 
HashMap<>(members.size());
 
             // All the existing members are prepared.
-            members.forEach((memberId, member) ->
-                memberSpecs.put(memberId, createAssignmentMemberSpec(
+            members.forEach((memberId, member) -> {
+                Assignment assignment = 
this.targetAssignment.getOrDefault(memberId, Assignment.EMPTY);
+
+                memberSubscriptions.put(memberId, 
createMemberSubscriptionSpecImpl(
                     member,
-                    targetAssignment.getOrDefault(memberId, Assignment.EMPTY),
-                    topicsImage
-                )
-            ));
+                    topicsImage,
+                    assignment
+                ));
+            });
 
             // All the updated are added and all the deleted
             // members are removed.
             updatedMembers.forEach((memberId, updatedMemberOrNull) -> {
                 if (updatedMemberOrNull == null) {
-                    memberSpecs.remove(memberId);
+                    memberSubscriptions.remove(memberId);
                 } else {
-                    Assignment assignment = 
targetAssignment.getOrDefault(memberId, Assignment.EMPTY);
+                    Assignment assignment = 
this.targetAssignment.getOrDefault(memberId, Assignment.EMPTY);

Review Comment:
   I named it the assignment as target assignment first so had to use this, and 
then didn't revert, thanks for the catch



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