From 540bd3f481385d9bca5267ad003df56dda60daf8 Mon Sep 17 00:00:00 2001 From: frankvicky Date: Tue, 4 Jun 2024 20:05:46 +0800 Subject: [PATCH 1/2] MINOR: Add topicIds and directoryIds to the return value of the toString method. --- .../java/org/apache/kafka/image/LocalReplicaChanges.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 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..e31d49cac26f9 100644 --- a/metadata/src/main/java/org/apache/kafka/image/LocalReplicaChanges.java +++ b/metadata/src/main/java/org/apache/kafka/image/LocalReplicaChanges.java @@ -77,11 +77,13 @@ public Map topicIds() { @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 ); } From e532a4c00d3a8e34b928fd5728c26a06d06498b3 Mon Sep 17 00:00:00 2001 From: frankvicky Date: Tue, 4 Jun 2024 20:24:49 +0800 Subject: [PATCH 2/2] MINOR: rearrange the positions of the methods. --- .../kafka/image/LocalReplicaChanges.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 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 e31d49cac26f9..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,6 +74,10 @@ public Map topicIds() { return topicIds; } + public Map directoryIds() { + return directoryIds; + } + @Override public String toString() { return String.format( @@ -87,10 +91,6 @@ public String toString() { ); } - public Map directoryIds() { - return directoryIds; - } - public static final class PartitionInfo { private final Uuid topicId; private final PartitionRegistration partition; @@ -100,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; } @@ -112,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); + } } }