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:
dan norwood 2016-08-09 01:34:04 +01:00 committed by Ismael Juma
parent 6b2564811a
commit 7b7f57df62
1 changed files with 5 additions and 2 deletions

View File

@ -559,9 +559,12 @@ object AdminUtils extends Logging {
def fetchTopicMetadataFromZk(topic: String, zkUtils: ZkUtils): MetadataResponse.TopicMetadata =
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]()
topics.map(topic => fetchTopicMetadataFromZk(topic, zkUtils, cachedBrokerInfo))
topics.map(topic => fetchTopicMetadataFromZk(topic, zkUtils, cachedBrokerInfo, protocol))
}
private def fetchTopicMetadataFromZk(topic: String,