divijvaidya commented on PR #14136: URL: https://github.com/apache/kafka/pull/14136#issuecomment-1661714026
I am not sure I understand why we need to access the factory method. The metadataCache instance is created on broker startup. It is then passed to ReplicaManager. RemoteLogManager is also created on start-up and you can pass this metadataCache in the constructor of RemoteLogManager at https://github.com/apache/kafka/blob/8aaf7daff393f2b26438fb7fe28016e06e23558c/core/src/main/scala/kafka/server/BrokerServer.scala#L573 . I observed that you are already doing this in the change in this PR. Once we have an instance inside RemoteLogManager, you can call Zk/Kraft specific functions using: `val zkMetadataCache = metadataCache.asInstanceOf[ZkMetadataCache]` -- 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