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


##########
core/src/main/scala/kafka/server/metadata/BrokerMetadataPublisher.scala:
##########
@@ -213,7 +213,7 @@ class BrokerMetadataPublisher(
       }
 
       // Apply configuration deltas.
-      dynamicConfigPublisher.publish(delta, newImage)
+      dynamicConfigPublisher.publish(delta, newImage, null)

Review Comment:
   Any way to avoid this null? 



##########
core/src/main/scala/kafka/server/metadata/DynamicConfigPublisher.scala:
##########
@@ -35,7 +35,13 @@ class DynamicConfigPublisher(
 ) extends Logging with org.apache.kafka.image.publisher.MetadataPublisher {
   logIdent = s"[${name()}] "
 
-  def publish(delta: MetadataDelta, newImage: MetadataImage): Unit = {
+  override def name(): String = s"DynamicConfigPublisher ${nodeType} 
id=${conf.nodeId}"
+
+  def publish(
+    delta: MetadataDelta,
+    newImage: MetadataImage,
+    manifest: LoaderManifest

Review Comment:
   If we're going to pass the `null` here, we should probably add a comment



##########
core/src/main/scala/kafka/server/metadata/DynamicConfigPublisher.scala:
##########
@@ -31,10 +32,16 @@ class DynamicConfigPublisher(
   faultHandler: FaultHandler,
   dynamicConfigHandlers: Map[String, ConfigHandler],
   nodeType: String
-) extends Logging {
+) extends org.apache.kafka.image.publisher.MetadataPublisher with Logging {
   logIdent = s"[DynamicConfigPublisher nodeType=${nodeType} id=${conf.nodeId}] 
"
 
-  def publish(delta: MetadataDelta, newImage: MetadataImage): Unit = {
+  def name(): String = "DynamicConfigPublisher"
+
+  def publish(

Review Comment:
   Should this have the override annotation?



##########
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:
   nit: "publishControllerChange" to keep the naming consistent? 



##########
metadata/src/main/java/org/apache/kafka/image/loader/LoaderManifest.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kafka.image.loader;
+
+import org.apache.kafka.image.MetadataProvenance;
+
+
+/**
+ * Contains information about what was loaded.
+ */
+public interface LoaderManifest {

Review Comment:
   Why can't we include the manifest type in the MetadataProvenance? 



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