From d652f5cf54c969c07d486d1c4843bcfdddea889a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TingI=C4=81u=20=22Ting=22=20K=C3=AC?= <51072200+frankvicky@users.noreply.github.com> Date: Wed, 5 Jun 2024 07:52:06 +0800 Subject: [PATCH] MINOR: Add topicIds and directoryIds to the return value of the toString method. (#16189) Add topicIds and directoryIds to the return value of the toString method. Reviewers: Luke Chen --- .../kafka/image/LocalReplicaChanges.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/metadata/src/main/java/org/apache/kafka/image/LocalReplicaChanges.java b/metadata/src/main/java/org/apache/kafka/image/LocalReplicaChanges.java index c872b324a035e..4bcfc20708686 100644 --- a/metadata/src/main/java/org/apache/kafka/image/LocalReplicaChanges.java +++ b/metadata/src/main/java/org/apache/kafka/image/LocalReplicaChanges.java @@ -74,21 +74,23 @@ public Map topicIds() { return topicIds; } + public Map directoryIds() { + return directoryIds; + } + @Override public String toString() { return String.format( - "LocalReplicaChanges(deletes = %s, newly elected leaders = %s, leaders = %s, followers = %s)", + "LocalReplicaChanges(deletes = %s, newly elected leaders = %s, leaders = %s, followers = %s, topicIds = %s, directoryIds = %s)", deletes, electedLeaders, leaders, - followers + followers, + topicIds, + directoryIds ); } - public Map directoryIds() { - return directoryIds; - } - public static final class PartitionInfo { private final Uuid topicId; private final PartitionRegistration partition; @@ -98,11 +100,6 @@ public PartitionInfo(Uuid topicId, PartitionRegistration partition) { this.partition = partition; } - @Override - public String toString() { - return String.format("PartitionInfo(topicId = %s, partition = %s)", topicId, partition); - } - public Uuid topicId() { return topicId; } @@ -110,5 +107,10 @@ public Uuid topicId() { public PartitionRegistration partition() { return partition; } + + @Override + public String toString() { + return String.format("PartitionInfo(topicId = %s, partition = %s)", topicId, partition); + } } }