This is an automated email from the ASF dual-hosted git repository.

showuon pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 2e5cd0b4765 MINOR: Refine javadoc in TopicsDelta TopicDelta 
LocalReplicaChanges (#16195)
2e5cd0b4765 is described below

commit 2e5cd0b4765bc79bb7b1a29e422e8b3ecc3db6b2
Author: Kuan-Po (Cooper) Tseng <brandb...@gmail.com>
AuthorDate: Fri Jun 14 11:22:19 2024 +0800

    MINOR: Refine javadoc in TopicsDelta TopicDelta LocalReplicaChanges (#16195)
    
    Add more description to TopicsDelta TopicDelta LocalReplicaChanges
    
    Reviewers: Luke Chen <show...@gmail.com>
---
 .../org/apache/kafka/image/LocalReplicaChanges.java    |  1 +
 .../main/java/org/apache/kafka/image/TopicDelta.java   | 18 +++++++++++-------
 .../main/java/org/apache/kafka/image/TopicsDelta.java  | 18 +++++++++++-------
 3 files changed, 23 insertions(+), 14 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 4bcfc207086..d41dbb2f082 100644
--- a/metadata/src/main/java/org/apache/kafka/image/LocalReplicaChanges.java
+++ b/metadata/src/main/java/org/apache/kafka/image/LocalReplicaChanges.java
@@ -36,6 +36,7 @@ public final class LocalReplicaChanges {
     private final Map<TopicPartition, PartitionInfo> followers;
     // The topic name -> topic id map in leaders and followers changes
     private final Map<String, Uuid> topicIds;
+    // partitions for which directory id changes or newly added to the broker
     private final Map<TopicIdPartition, Uuid> directoryIds;
 
     LocalReplicaChanges(
diff --git a/metadata/src/main/java/org/apache/kafka/image/TopicDelta.java 
b/metadata/src/main/java/org/apache/kafka/image/TopicDelta.java
index 45b6b499526..22115499e3a 100644
--- a/metadata/src/main/java/org/apache/kafka/image/TopicDelta.java
+++ b/metadata/src/main/java/org/apache/kafka/image/TopicDelta.java
@@ -118,17 +118,21 @@ public final class TopicDelta {
 
     /**
      * Find the partitions that have change based on the replica given.
-     *
+     * <p>
      * The changes identified are:
-     *   1. deletes: partitions for which the broker is not a replica anymore
-     *   2. electedLeaders: partitions for which the broker is now a leader 
(leader epoch bump on the leader)
-     *   3. leaders: partitions for which the isr or replicas change if the 
broker is a leader (partition epoch bump on the leader)
-     *   4. followers: partitions for which the broker is now a follower or 
follower with isr or replica updates (partition epoch bump on follower)
-     *
+     * <ul>
+     *   <li>deletes: partitions for which the broker is not a replica 
anymore</li>
+     *   <li>electedLeaders: partitions for which the broker is now a leader 
(leader epoch bump on the leader)</li>
+     *   <li>leaders: partitions for which the isr or replicas change if the 
broker is a leader (partition epoch bump on the leader)</li>
+     *   <li>followers: partitions for which the broker is now a follower or 
follower with isr or replica updates (partition epoch bump on follower)</li>
+     *   <li>topicIds: a map of topic names to topic IDs in leaders and 
followers changes</li>
+     *   <li>directoryIds: partitions for which directory id changes or newly 
added to the broker</li>
+     * </ul>
+     * <p>
      * Leader epoch bumps are a strict subset of all partition epoch bumps, so 
all partitions in electedLeaders will be in leaders.
      *
      * @param brokerId the broker id
-     * @return the list of partitions which the broker should remove, become 
leader, become/update leader, or become/update follower.
+     * @return the LocalReplicaChanges that cover changes in the broker
      */
     @SuppressWarnings("checkstyle:cyclomaticComplexity")
     public LocalReplicaChanges localChanges(int brokerId) {
diff --git a/metadata/src/main/java/org/apache/kafka/image/TopicsDelta.java 
b/metadata/src/main/java/org/apache/kafka/image/TopicsDelta.java
index 75ba3e0cbe6..f21793833e5 100644
--- a/metadata/src/main/java/org/apache/kafka/image/TopicsDelta.java
+++ b/metadata/src/main/java/org/apache/kafka/image/TopicsDelta.java
@@ -178,17 +178,21 @@ public final class TopicsDelta {
 
     /**
      * Find the topic partitions that have change based on the replica given.
-     *
+     * <p>
      * The changes identified are:
-     *   1. deletes: partitions for which the broker is not a replica anymore
-     *   2. electedLeaders: partitions for which the broker is now a leader 
(leader epoch bump on the leader)
-     *   3. leaders: partitions for which the isr or replicas change if the 
broker is a leader (partition epoch bump on the leader)
-     *   4. followers: partitions for which the broker is now a follower or 
follower with isr or replica updates (partition epoch bump on follower)
-     *
+     * <ul>
+     *   <li>deletes: partitions for which the broker is not a replica 
anymore</li>
+     *   <li>electedLeaders: partitions for which the broker is now a leader 
(leader epoch bump on the leader)</li>
+     *   <li>leaders: partitions for which the isr or replicas change if the 
broker is a leader (partition epoch bump on the leader)</li>
+     *   <li>followers: partitions for which the broker is now a follower or 
follower with isr or replica updates (partition epoch bump on follower)</li>
+     *   <li>topicIds: a map of topic names to topic IDs in leaders and 
followers changes</li>
+     *   <li>directoryIds: partitions for which directory id changes or newly 
added to the broker</li>
+     * </ul>
+     * <p>
      * Leader epoch bumps are a strict subset of all partition epoch bumps, so 
all partitions in electedLeaders will be in leaders.
      *
      * @param brokerId the broker id
-     * @return the list of topic partitions which the broker should remove, 
become leader or become follower.
+     * @return the LocalReplicaChanges that cover changes in the broker
      */
     public LocalReplicaChanges localChanges(int brokerId) {
         Set<TopicPartition> deletes = new HashSet<>();

Reply via email to