PartitionGrouper
public class DefaultPartitionGrouper extends java.lang.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 | Description |
---|---|
DefaultPartitionGrouper() |
Modifier and Type | Method | Description |
---|---|---|
protected int |
maxNumPartitions(Cluster metadata,
java.util.Set<java.lang.String> topics) |
|
java.util.Map<TaskId,java.util.Set<TopicPartition>> |
partitionGroups(java.util.Map<java.lang.Integer,java.util.Set<java.lang.String>> topicGroups,
Cluster metadata) |
Generate tasks with the assigned topic partitions.
|
public java.util.Map<TaskId,java.util.Set<TopicPartition>> partitionGroups(java.util.Map<java.lang.Integer,java.util.Set<java.lang.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, java.util.Set<java.lang.String> topics)
StreamsException
- if no metadata can be received for a topic