jsancio commented on code in PR #16008:
URL: https://github.com/apache/kafka/pull/16008#discussion_r1610457959


##########
core/src/main/scala/kafka/server/NodeToControllerChannelManager.scala:
##########
@@ -120,15 +118,15 @@ object RaftControllerNodeProvider {
  */
 class RaftControllerNodeProvider(
   val raftManager: RaftManager[ApiMessageAndVersion],
-  controllerQuorumVoterNodes: Seq[Node],
   val listenerName: ListenerName,
   val securityProtocol: SecurityProtocol,
   val saslMechanism: String
 ) extends ControllerNodeProvider with Logging {
-  private val idToNode = controllerQuorumVoterNodes.map(node => node.id() -> 
node).toMap
+
+  private def idToNode(id: Int): Option[Node] = raftManager.voterNode(id, 
listenerName.value())
 
   override def getControllerInfo(): ControllerInformation =
-    
ControllerInformation(raftManager.leaderAndEpoch.leaderId.asScala.map(idToNode),
+    
ControllerInformation(raftManager.leaderAndEpoch.leaderId.asScala.flatMap(idToNode),

Review Comment:
   Okay. In a future change PR, I'll change this to `Option[Node] 
RaftManager.leaderNode()` since it looks like the node is always the leader 
node a not some arbitrary voters.



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