Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-14539

Simplify StreamsMetadataState by replacing the Cluster metadata with partition info map

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.6.0
    • streams
    • None

    Description

      We can clean up the StreamsMetadataState class a bit by removing the #onChange invocation that currently occurs within StreamsPartitionAssignor#assign, which then lets us remove the `Cluster` parameter in that callback. Instead of building a fake Cluster object from the map of partition info when we invoke #onChange inside the StreamsPartitionAssignor#onAssignment method, we can just directly pass in the  `Map<TopicPartition, PartitionInfo>` and replace the usage of `Cluster` everywhere in StreamsMetadataState

      (I believe the current system is a historical artifact from when we used to require passing in a Cluster for the default partitioning strategy, which the StreamMetadataState needs to compute the partition for a key. At some point in the past we provided a better way to get the default partition, so we no longer need a Cluster parameter/field at all)

      Attachments

        Issue Links

          Activity

            People

              danicafine Danica Fine
              ableegoldman A. Sophie Blee-Goldman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: