public class DefaultPartitionGrouper extends Object implements PartitionGrouper
PartitionGrouper
interface that groups partitions by the partition id.
Join operations requires that topics of the joining entities are copartitoned, i.e., being partitioned by the same key and having the same
number of partitions. Copartitioning is ensured by having the same number of partitions on
joined topics, and by using the serialization and Producer's default partitioner.Constructor and Description |
---|
DefaultPartitionGrouper() |
Modifier and Type | Method and Description |
---|---|
protected int |
maxNumPartitions(Cluster metadata,
Set<String> topics) |
Map<TaskId,Set<TopicPartition>> |
partitionGroups(Map<Integer,Set<String>> topicGroups,
Cluster metadata)
Generate tasks with the assigned topic partitions.
|
public Map<TaskId,Set<TopicPartition>> partitionGroups(Map<Integer,Set<String>> topicGroups, Cluster metadata)
partitionGroups
in interface PartitionGrouper
topicGroups
- group of topics that need to be joined togethermetadata
- metadata of the consuming clusterprotected int maxNumPartitions(Cluster metadata, Set<String> topics)
StreamsException
- if no metadata can be received for a topic