chia7712 commented on code in PR #18437:
URL: https://github.com/apache/kafka/pull/18437#discussion_r1908497153


##########
core/src/main/scala/kafka/server/NodeToControllerChannelManager.scala:
##########
@@ -244,7 +210,6 @@ case class NodeToControllerQueueItem(
 
 class NodeToControllerRequestThread(
   initialNetworkClient: KafkaClient,
-  var isNetworkClientForZkController: Boolean,
   networkClientFactory: ControllerInformation => KafkaClient,

Review Comment:
   `networkClientFactory` can be removed now



##########
core/src/main/scala/kafka/server/NodeToControllerChannelManager.scala:
##########
@@ -262,22 +227,6 @@ class NodeToControllerRequestThread(
 
   this.logIdent = logPrefix
 
-  private def maybeResetNetworkClient(controllerInformation: 
ControllerInformation): Unit = {
-    if (isNetworkClientForZkController != 
controllerInformation.isZkController) {
-      debug("Controller changed to " + (if (isNetworkClientForZkController) 
"kraft" else "zk") + " mode. " +
-        s"Resetting network client with new controller information : 
${controllerInformation}")
-      // Close existing network client.
-      val oldClient = networkClient
-      oldClient.initiateClose()
-      oldClient.close()
-
-      isNetworkClientForZkController = controllerInformation.isZkController
-      updateControllerAddress(controllerInformation.node.orNull)
-      controllerInformation.node.foreach(n => 
metadataUpdater.setNodes(Seq(n).asJava))
-      networkClient = networkClientFactory(controllerInformation)

Review Comment:
   we don't change `networkClient` anymore, so `networkClient` can be declared 
as final variable.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to