You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/01/25 10:29:53 UTC

[GitHub] [kafka] showuon commented on a change in pull request #11584: MINOR: improve logging

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



##########
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:
       nit: `topic1.compareTo(topic2)`




-- 
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-unsubscribe@kafka.apache.org

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