mirror of https://github.com/apache/kafka.git
MINOR: Add `fetchTopicMetadataFromZk` overload that takes `SecurityProtocol` parameter
ijuma Author: dan norwood <norwood@confluent.io> Reviewers: Ismael Juma <ismael@juma.me.uk> Closes #1713 from norwood/add-security-protocol-option-for-fetch
This commit is contained in:
parent
6b2564811a
commit
7b7f57df62
|
|
@ -559,9 +559,12 @@ object AdminUtils extends Logging {
|
||||||
def fetchTopicMetadataFromZk(topic: String, zkUtils: ZkUtils): MetadataResponse.TopicMetadata =
|
def fetchTopicMetadataFromZk(topic: String, zkUtils: ZkUtils): MetadataResponse.TopicMetadata =
|
||||||
fetchTopicMetadataFromZk(topic, zkUtils, new mutable.HashMap[Int, Broker])
|
fetchTopicMetadataFromZk(topic, zkUtils, new mutable.HashMap[Int, Broker])
|
||||||
|
|
||||||
def fetchTopicMetadataFromZk(topics: Set[String], zkUtils: ZkUtils): Set[MetadataResponse.TopicMetadata] = {
|
def fetchTopicMetadataFromZk(topics: Set[String], zkUtils: ZkUtils): Set[MetadataResponse.TopicMetadata] =
|
||||||
|
fetchTopicMetadataFromZk(topics, zkUtils, SecurityProtocol.PLAINTEXT)
|
||||||
|
|
||||||
|
def fetchTopicMetadataFromZk(topics: Set[String], zkUtils: ZkUtils, protocol: SecurityProtocol): Set[MetadataResponse.TopicMetadata] = {
|
||||||
val cachedBrokerInfo = new mutable.HashMap[Int, Broker]()
|
val cachedBrokerInfo = new mutable.HashMap[Int, Broker]()
|
||||||
topics.map(topic => fetchTopicMetadataFromZk(topic, zkUtils, cachedBrokerInfo))
|
topics.map(topic => fetchTopicMetadataFromZk(topic, zkUtils, cachedBrokerInfo, protocol))
|
||||||
}
|
}
|
||||||
|
|
||||||
private def fetchTopicMetadataFromZk(topic: String,
|
private def fetchTopicMetadataFromZk(topic: String,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue