chia7712 commented on code in PR #19442:
URL: https://github.com/apache/kafka/pull/19442#discussion_r2222688784


##########
clients/src/main/java/org/apache/kafka/common/internals/PartitionStates.java:
##########
@@ -129,28 +129,14 @@ public int size() {
      */
     public void set(Map<TopicPartition, S> partitionToState) {
         map.clear();
-        update(partitionToState);
+        map.putAll(partitionToState);
         updateSize();
     }
 
     private void updateSize() {
         size = map.size();
     }
 
-    private void update(Map<TopicPartition, S> partitionToState) {

Review Comment:
   It seems the origin behavior tries to sort the `partitionToState` by topic 
name. For example, the `partitionToState` contains four topic partitions: a0, 
b0, c0, a1, and then the order of insert should be a0, a1, b0, c0. With this 
patch, the insert order will be changed, right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to