3schwartz commented on a change in pull request #11418:
URL: https://github.com/apache/kafka/pull/11418#discussion_r733361106
##########
File path: clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
##########
@@ -1080,8 +1080,13 @@ public void handleSuccessfulResponse(RequestHeader
requestHeader, long now, Meta
.collect(Collectors.toList());
if (!missingListenerPartitions.isEmpty()) {
int count = missingListenerPartitions.size();
- log.warn("{} partitions have leader brokers without a matching
listener, including {}",
- count, missingListenerPartitions.subList(0,
Math.min(10, count)));
+ if (count == 1) {
Review comment:
I believe it would be easier to interprete if you avoid using the
if-else block and created the log statement in one assignment using
conditionals.
String logStatement = "{} partition" +
(count > 1 ? "s have leader brokers" : " has a leader
broker") +
" without a matching listener, " +
(count > 1 ? "which is " : "including ") + "{}";
log.warn(logStatement,
count, missingListenerPartitions.subList(0, Math.min(10,
count)));
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]