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



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
##########
@@ -288,7 +288,7 @@ private Exception invokeOnAssignment(final 
ConsumerPartitionAssignor assignor, f
     }
 
     private Exception invokePartitionsAssigned(final Set<TopicPartition> 
assignedPartitions) {
-        log.info("Adding newly assigned partitions: {}", 
Utils.join(assignedPartitions, ", "));
+        log.info("Adding newly assigned partitions: {}", 
Utils.join(assignedPartitions.stream().sorted().toArray(), ", "));

Review comment:
       FYI `TopicPartition` doesn't implement `Comparable` so you can't use 
`.stream().sorted()`

##########
File path: 
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
##########
@@ -215,7 +215,7 @@ public String protocolType() {
 
     @Override
     protected JoinGroupRequestData.JoinGroupRequestProtocolCollection 
metadata() {
-        log.debug("Joining group with current subscription: {}", 
subscriptions.subscription());
+        log.debug("Joining group with current subscription: {}", 
Utils.join(subscriptions.subscription().stream().sorted().toArray(), ", "));

Review comment:
       Could we just keep the subscription sorted to begin with? (ie store in a 
sorted data structure)




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