You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gu...@apache.org on 2016/06/24 21:46:43 UTC

kafka git commit: MINOR: Improve doc string in PartitionGrouper

Repository: kafka
Updated Branches:
  refs/heads/trunk 54f9a7012 -> 0e0b632b9


MINOR: Improve doc string in PartitionGrouper

Author: Guozhang Wang <wa...@gmail.com>

Reviewers: Matthias J. Sax <ma...@confluent.io>

Closes #1550 from guozhangwang/Kminor-grouppartitioner-javadoc


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/0e0b632b
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/0e0b632b
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/0e0b632b

Branch: refs/heads/trunk
Commit: 0e0b632b926f52451495ab254e74ab87848cb353
Parents: 54f9a70
Author: Guozhang Wang <wa...@gmail.com>
Authored: Fri Jun 24 14:46:39 2016 -0700
Committer: Guozhang Wang <wa...@gmail.com>
Committed: Fri Jun 24 14:46:39 2016 -0700

----------------------------------------------------------------------
 .../apache/kafka/streams/processor/PartitionGrouper.java  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/0e0b632b/streams/src/main/java/org/apache/kafka/streams/processor/PartitionGrouper.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/PartitionGrouper.java b/streams/src/main/java/org/apache/kafka/streams/processor/PartitionGrouper.java
index 1f9a473..77418b9 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/PartitionGrouper.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/PartitionGrouper.java
@@ -35,8 +35,14 @@ public interface PartitionGrouper {
 
     /**
      * Returns a map of task ids to groups of partitions. A partition group forms a task, thus, partitions that are
-     * expected to be processed together must be in the same group. DefaultPartitionGrouper implements this
-     * interface. See {@link DefaultPartitionGrouper} for more information.
+     * expected to be processed together must be in the same group.
+     *
+     * Note that the grouping of partitions need to be <b>sticky</b> such that for a given partition, its assigned
+     * task should always be the same regardless of the input parameters to this function. This is to ensure task's
+     * local state stores remain valid through workload rebalances among Kafka Streams instances.
+     *
+     * The default partition grouper implements this interface by assigning all partitions across different topics with the same
+     * partition id into the same task. See {@link DefaultPartitionGrouper} for more information.
      *
      * @param topicGroups The map from the {@link TopologyBuilder#topicGroups()} topic group} id to topics
      * @param metadata Metadata of the consuming cluster