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 2020/12/25 03:27:21 UTC

[GitHub] [kafka] showuon opened a new pull request #9788: KAFKA-10671: improve the partition.assignment.strategy docs

showuon opened a new pull request #9788:
URL: https://github.com/apache/kafka/pull/9788


   Add `StickyAssignor` and `CooperativeStickyAssignor`, and also briefly introduce the `RangeAssignor` and `RoundRobinAssignor`. 
   
   
   **Before:**
   ![image](https://user-images.githubusercontent.com/43372967/103117054-b7ab4300-46a3-11eb-83b4-69b60f8fb18c.png)
   
   
   **After:**
   ![image](https://user-images.githubusercontent.com/43372967/103117141-18d31680-46a4-11eb-9737-704d92fb1560.png)
   
   
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


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

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



[GitHub] [kafka] showuon commented on pull request #9788: KAFKA-10671: improve the partition.assignment.strategy docs

Posted by GitBox <gi...@apache.org>.
showuon commented on pull request #9788:
URL: https://github.com/apache/kafka/pull/9788#issuecomment-754334067


   @ableegoldman , thanks for your comments. I've updated in this commit: https://github.com/apache/kafka/pull/9788/commits/7f44a41900eb526b850283372e1a25d002ba2994. Thank you.


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

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



[GitHub] [kafka] ableegoldman commented on pull request #9788: KAFKA-10671: improve the partition.assignment.strategy docs

Posted by GitBox <gi...@apache.org>.
ableegoldman commented on pull request #9788:
URL: https://github.com/apache/kafka/pull/9788#issuecomment-755580767


   Merged to trunk


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

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



[GitHub] [kafka] showuon commented on pull request #9788: KAFKA-10671: improve the partition.assignment.strategy docs

Posted by GitBox <gi...@apache.org>.
showuon commented on pull request #9788:
URL: https://github.com/apache/kafka/pull/9788#issuecomment-755835312


   Thank you, @ableegoldman !


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

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



[GitHub] [kafka] showuon commented on pull request #9788: KAFKA-10671: improve the partition.assignment.strategy docs

Posted by GitBox <gi...@apache.org>.
showuon commented on pull request #9788:
URL: https://github.com/apache/kafka/pull/9788#issuecomment-751159553


   @ableegoldman , could you help review this simple PR? Thanks.


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

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



[GitHub] [kafka] ableegoldman commented on a change in pull request #9788: KAFKA-10671: improve the partition.assignment.strategy docs

Posted by GitBox <gi...@apache.org>.
ableegoldman commented on a change in pull request #9788:
URL: https://github.com/apache/kafka/pull/9788#discussion_r551512362



##########
File path: clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java
##########
@@ -108,17 +108,18 @@
      */
     public static final String PARTITION_ASSIGNMENT_STRATEGY_CONFIG = "partition.assignment.strategy";
     private static final String PARTITION_ASSIGNMENT_STRATEGY_DOC = "A list of class names or class types, " +
-            "ordered by preference, of supported partition assignment " +
-            "strategies that the client will use to distribute partition " +
-            "ownership amongst consumer instances when group management is " +
-            "used.<p>In addition to the default class specified below, " +
-            "you can use the " +
-            "<code>org.apache.kafka.clients.consumer.RoundRobinAssignor</code>" +
-            "class for round robin assignments of partitions to consumers. " +
-            "</p><p>Implementing the " +
-            "<code>org.apache.kafka.clients.consumer.ConsumerPartitionAssignor" +
-            "</code> interface allows you to plug in a custom assignment" +
-            "strategy.";
+        "ordered by preference, of supported partition assignment strategies that the client will use to distribute " +
+        "partition ownership amongst consumer instances when group management is used. Available options are:" +
+        "<ul>" +
+        "<li><code>org.apache.kafka.clients.consumer.RangeAssignor</code>: The default assignor, which works on a per-topic basis.</li>" +
+        "<li><code>org.apache.kafka.clients.consumer.RoundRobinAssignor</code>: It works for round robin assignments of partitions.</li>" +
+        "<li><code>org.apache.kafka.clients.consumer.StickyAssignor</code>: It guarantees an assignment that is " +
+        "as balanced as possible and preserved as many existing assignment as possible when a reassignment occurs.</li>" +

Review comment:
       ```suggestion
           "<li><code>org.apache.kafka.clients.consumer.StickyAssignor</code>: Guarantees an assignment that is " +
   "maximally balanced while preserving as many existing partition assignments as possible.</li>" +
   ```

##########
File path: clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java
##########
@@ -108,17 +108,18 @@
      */
     public static final String PARTITION_ASSIGNMENT_STRATEGY_CONFIG = "partition.assignment.strategy";
     private static final String PARTITION_ASSIGNMENT_STRATEGY_DOC = "A list of class names or class types, " +
-            "ordered by preference, of supported partition assignment " +
-            "strategies that the client will use to distribute partition " +
-            "ownership amongst consumer instances when group management is " +
-            "used.<p>In addition to the default class specified below, " +
-            "you can use the " +
-            "<code>org.apache.kafka.clients.consumer.RoundRobinAssignor</code>" +
-            "class for round robin assignments of partitions to consumers. " +
-            "</p><p>Implementing the " +
-            "<code>org.apache.kafka.clients.consumer.ConsumerPartitionAssignor" +
-            "</code> interface allows you to plug in a custom assignment" +
-            "strategy.";
+        "ordered by preference, of supported partition assignment strategies that the client will use to distribute " +
+        "partition ownership amongst consumer instances when group management is used. Available options are:" +
+        "<ul>" +
+        "<li><code>org.apache.kafka.clients.consumer.RangeAssignor</code>: The default assignor, which works on a per-topic basis.</li>" +
+        "<li><code>org.apache.kafka.clients.consumer.RoundRobinAssignor</code>: It works for round robin assignments of partitions.</li>" +
+        "<li><code>org.apache.kafka.clients.consumer.StickyAssignor</code>: It guarantees an assignment that is " +
+        "as balanced as possible and preserved as many existing assignment as possible when a reassignment occurs.</li>" +
+        "<li><code>org.apache.kafka.clients.consumer.CooperativeStickyAssignor</code>: It follows the same StickyAssignor " +

Review comment:
       ```suggestion
           "<li><code>org.apache.kafka.clients.consumer.CooperativeStickyAssignor</code>: Follows the same StickyAssignor " +
   ```

##########
File path: clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java
##########
@@ -108,17 +108,18 @@
      */
     public static final String PARTITION_ASSIGNMENT_STRATEGY_CONFIG = "partition.assignment.strategy";
     private static final String PARTITION_ASSIGNMENT_STRATEGY_DOC = "A list of class names or class types, " +
-            "ordered by preference, of supported partition assignment " +
-            "strategies that the client will use to distribute partition " +
-            "ownership amongst consumer instances when group management is " +
-            "used.<p>In addition to the default class specified below, " +
-            "you can use the " +
-            "<code>org.apache.kafka.clients.consumer.RoundRobinAssignor</code>" +
-            "class for round robin assignments of partitions to consumers. " +
-            "</p><p>Implementing the " +
-            "<code>org.apache.kafka.clients.consumer.ConsumerPartitionAssignor" +
-            "</code> interface allows you to plug in a custom assignment" +
-            "strategy.";
+        "ordered by preference, of supported partition assignment strategies that the client will use to distribute " +
+        "partition ownership amongst consumer instances when group management is used. Available options are:" +
+        "<ul>" +
+        "<li><code>org.apache.kafka.clients.consumer.RangeAssignor</code>: The default assignor, which works on a per-topic basis.</li>" +
+        "<li><code>org.apache.kafka.clients.consumer.RoundRobinAssignor</code>: It works for round robin assignments of partitions.</li>" +

Review comment:
       ```suggestion
           "<li><code>org.apache.kafka.clients.consumer.RoundRobinAssignor</code>: Assigns partitions to consumers in a round-robin fashion.</li>" +
   ```




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

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



[GitHub] [kafka] ableegoldman merged pull request #9788: KAFKA-10671: improve the partition.assignment.strategy docs

Posted by GitBox <gi...@apache.org>.
ableegoldman merged pull request #9788:
URL: https://github.com/apache/kafka/pull/9788


   


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

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