A. Sophie Blee-Goldman created KAFKA-14539:
----------------------------------------------

             Summary: Simplify StreamsMetadataState by replacing the Cluster 
metadata with partition info map
                 Key: KAFKA-14539
                 URL: https://issues.apache.org/jira/browse/KAFKA-14539
             Project: Kafka
          Issue Type: Improvement
          Components: streams
            Reporter: A. Sophie Blee-Goldman


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)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to