suzhiking commented on code in PR #23969:
URL: https://github.com/apache/kafka/pull/23969#discussion_r4620912472


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/AssignmentRefinerImpl.java:
##########
@@ -158,6 +168,9 @@ static CurrentAssignmentIndex indexCurrentAssignment(
                 subtopologies,
                 task -> reportedByProcess.computeIfAbsent(member.processId(), 
__ -> new HashSet<>()).add(task)
             );
+
+            memberCounts.merge(member.processId(), 1, Integer::sum);
+            statefulTaskCounts.merge(member.processId(), statefulTaskCount[0], 
Integer::sum);

Review Comment:
   it's efficient but we could reduce these 2 merged into one given they are 
just used to compute process load, by adding `ProcessLoad plus(final 
ProcessLoad other)` in `ProcessLoad` class, which makes the call 1-2% faster, 
and arguably cleaner.



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