dajac commented on code in PR #23666:
URL: https://github.com/apache/kafka/pull/23666#discussion_r4165419894


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/GroupSpecBuilder.java:
##########
@@ -240,6 +261,24 @@ public GroupSpec build() {
             ))
         );
 
+        Map<Uuid, Map<Integer, String>> invertedTargetAssignment = 
this.invertedTargetAssignment;
+        Optional<Map<Uuid, Set<Integer>>> topicAssignablePartitionsMap = 
this.topicAssignablePartitionsMap;
+        if (assignorOffload) {
+            Map<Uuid, Map<Integer, String>> invertedTargetAssignmentCopy = new 
HashMap<>(invertedTargetAssignment.size());

Review Comment:
   This is not quite right. It should be something like `new HashMap<>((int) 
(invertedTargetAssignment.size() / 0.75f) + 1)`. When we move to Java 19, we 
will be able to use ` HashMap.newHashMap(n)`. We could perhaps have a temporary 
helper somewhere. We may already have one.



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