Skip to content

RepartitionTopics

RepartitionTopics is a helper class of StreamsPartitionAssignor (to prepare repartition topics).

Creating Instance

RepartitionTopics takes the following to be created:

topicPartitionInfos

Map<TopicPartition, PartitionInfo> topicPartitionInfos

RepartitionTopics defines a topicPartitionInfos internal registry of TopicPartitions and the associated PartitionInfo.

topicPartitionInfos is initially empty and filled up when requested to setup.

setup

void setup()

setup requests the InternalTopologyBuilder for the topic groups (that gives TopicsInfos by Subtopology).

setup computeRepartitionTopicConfig for the topic groups and the cluster metadata (that gives a Map<String, InternalTopicConfig>).

setup ensureCopartitioning of the copartitionGroups (from InternalTopologyBuilder).

setup requests the InternalTopicManager to make the repartition source topics ready (exist and have proper number of partitions, creating if necessary).

computeRepartitionTopicConfig

Map<String, InternalTopicConfig> computeRepartitionTopicConfig(
  Map<Subtopology, TopicsInfo> topicGroups,
  Cluster clusterMetadata)

computeRepartitionTopicConfig...FIXME

ensureCopartitioning

void ensureCopartitioning(
  Collection<Set<String>> copartitionGroups,
  Map<String, InternalTopicConfig> repartitionTopicMetadata,
  Cluster clusterMetadata)

ensureCopartitioning...FIXME

Back to top