You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/07/07 14:35:54 UTC

[GitHub] [kafka] jacky1193610322 commented on a change in pull request #10985: KAFKA-12984: make AbstractStickyAssignor resilient to invalid input, utilize generation in cooperative, and fix assignment bug

jacky1193610322 commented on a change in pull request #10985:
URL: https://github.com/apache/kafka/pull/10985#discussion_r665433621



##########
File path: clients/src/main/java/org/apache/kafka/clients/consumer/CooperativeStickyAssignor.java
##########
@@ -53,9 +56,34 @@ public String name() {
         return Arrays.asList(RebalanceProtocol.COOPERATIVE, RebalanceProtocol.EAGER);
     }
 
+    @Override
+    public void onAssignment(Assignment assignment, ConsumerGroupMetadata metadata) {
+        this.generation = metadata.generationId();
+    }
+
+    @Override
+    public ByteBuffer subscriptionUserData(Set<String> topics) {
+        if (generation == DEFAULT_GENERATION) {

Review comment:
       Should we create a schema class, not direct ByteBuffer for adding a field easily in the future?




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