chia7712 commented on code in PR #16198:
URL: https://github.com/apache/kafka/pull/16198#discussion_r1628346003


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/consumer/MemberSubscriptionAndAssignmentImpl.java:
##########
@@ -88,4 +90,5 @@ public String toString() {
             ", memberAssignment=" + memberAssignment +

Review Comment:
   `toString` still uses previous naming `MemberSubscriptionSpecImpl`



##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/OptimizedUniformAssignmentBuilder.java:
##########
@@ -160,7 +166,7 @@ public GroupAssignment build() throws 
PartitionAssignorException {
      */
     private void maybeRevokePartitions() {
         for (String memberId : groupSpec.memberIds()) {
-            Map<Uuid, Set<Integer>> oldAssignment = 
groupSpec.memberAssignment(memberId);
+            Map<Uuid, Set<Integer>> oldAssignment = 
groupSpec.memberAssignment(memberId).partitions();

Review Comment:
   As we have `MemberAssignment` interface now, could we manipulate 
`MemberAssignment` instead of raw map? Also, maybe we can remove 
`isImmutableMap` by checking the impl of `MemberAssignment`. For example:
   
   ```java
               MemberAssignment oldAssignment = 
groupSpec.memberAssignment(memberId);
               MemberAssignment newAssignment = null;
   
               // The assignor expects to receive the assignment as an 
immutable map. It leverages
               // this knowledge in order to avoid having to copy all 
assignments.
               if (! (oldAssignment instanceof Assignment)) {
                   throw new IllegalStateException("The assignor expect an 
immutable map.");
               }
   ```
   
   



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to