You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "squah-confluent (via GitHub)" <gi...@apache.org> on 2026/10/01 16:10:15 UTC

[PR] KAFKA-20292 [12/N]: Add consumer and share GroupSpecBuilder.withAssignorOffload() [kafka]

squah-confluent opened a new pull request, #23666:
URL: https://github.com/apache/kafka/pull/23666

   When assignor offloading is enabled, assignor runs must use a copy of
   the group information, as it may be modified concurrently. Add
   withAssignorOffload() to the GroupSpecBuilder to control whether
   collections are copied.


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20292 [12/N]: Add consumer and share GroupSpecBuilder.withAssignorOffload() [kafka]

Posted by "squah-confluent (via GitHub)" <gi...@apache.org>.
squah-confluent merged PR #23666:
URL: https://github.com/apache/kafka/pull/23666


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20292 [12/N]: Add consumer and share GroupSpecBuilder.withAssignorOffload() [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
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: jira-unsubscribe@kafka.apache.org

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