mjsax commented on a change in pull request #11584:
URL: https://github.com/apache/kafka/pull/11584#discussion_r791955444



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
##########
@@ -1516,4 +1527,20 @@ RebalanceProtocol getProtocol() {
     boolean poll(Timer timer) {
         return poll(timer, true);
     }
+
+
+
+    final static class TopicPartitionComparator implements 
Comparator<TopicPartition>, Serializable {
+        @Override
+        public int compare(TopicPartition topicPartition1, TopicPartition 
topicPartition2) {
+            String topic1 = topicPartition1.topic();
+            String topic2 = topicPartition2.topic();
+
+            if (topic1.equals(topic2)) {
+                return topicPartition1.partition() - 
topicPartition2.partition();
+            } else {
+                return 
topicPartition1.topic().compareTo(topicPartition2.topic());

Review comment:
       Good catch!




-- 
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