You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "cmccabe (via GitHub)" <gi...@apache.org> on 2023/03/09 00:57:14 UTC

[GitHub] [kafka] cmccabe commented on a diff in pull request #13337: MINOR: Refactor the MetadataPublisher interface

cmccabe commented on code in PR #13337:
URL: https://github.com/apache/kafka/pull/13337#discussion_r1130248758


##########
metadata/src/main/java/org/apache/kafka/image/publisher/MetadataPublisher.java:
##########
@@ -40,33 +40,30 @@ public interface MetadataPublisher extends AutoCloseable {
     String name();
 
     /**
-     * Publish a new cluster metadata snapshot that we loaded.
+     * Handle a change in the current controller.
      *
-     * @param delta    The delta between the previous state and the new one.
-     * @param newImage The complete new state.
-     * @param manifest The contents of what was published.
+     * @param newLeaderAndEpoch The new quorum leader and epoch. The new leader will be
+     *                          OptionalInt.empty if there is currently no active controller.
      */
-    void publishSnapshot(
-            MetadataDelta delta,
-            MetadataImage newImage,
-            SnapshotManifest manifest
-    );
+    default void handleControllerChange(LeaderAndEpoch newLeaderAndEpoch) { }

Review Comment:
   How about
   `void onControllerChange(LeaderAndEpoch newLeaderAndEpoch)`
   and
   `void onMetadataUpdate(MetadataDelta delta, MetadataImage newImage, LoaderManifest manifest);`?
   Might be clearer.



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org