mimaison commented on code in PR #19762:
URL: https://github.com/apache/kafka/pull/19762#discussion_r2180102742


##########
metadata/src/main/java/org/apache/kafka/image/TopicsImage.java:
##########
@@ -119,4 +127,40 @@ public Map<Uuid, String> topicIdToNameView() {
     public String toString() {
         return new TopicsImageByNameNode(this).stringify();
     }
+
+    /**
+     * Returns true if the given topic partition should not be on the current 
broker according to the metadata image.
+     *
+     * @param newTopicsImage The new topics image after broker has been 
reloaded
+     * @param brokerId       The ID of the current broker.
+     * @param topicId        The topic ID
+     * @param partitionId    The partition ID
+     * @param log            The log
+     * @return true if the topic partition should not exist on the broker, 
false otherwise.
+     */
+    public static boolean isStrayReplica(TopicsImage newTopicsImage, int 
brokerId, Optional<Uuid> topicId, int partitionId, String log) {

Review Comment:
   The reasons I put it here are that:
   - it's a single method related to `TopicsImage`
   - the `TopicsImageTest` class has utility methods that helped simplify the 
test logic



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