[ 
https://issues.apache.org/jira/browse/KAFKA-6320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16301227#comment-16301227
 ] 

ASF GitHub Bot commented on KAFKA-6320:
---------------------------------------

ijuma commented on a change in pull request #4351: KAFKA-6320: move ZK metrics 
in KafkaHealthCheck to ZookeeperClient
URL: https://github.com/apache/kafka/pull/4351#discussion_r158464621
 
 

 ##########
 File path: core/src/test/scala/unit/kafka/zk/KafkaZkClientTest.scala
 ##########
 @@ -411,6 +415,44 @@ class KafkaZkClientTest extends ZooKeeperTestHarness {
     assertTrue(zkClient.getEntityConfigs(ConfigType.Topic, topic1).isEmpty)
   }
 
+  @Test
+  def testBrokerRegistrationMethods() {
+    zkClient.createTopLevelPaths()
+
+    val brokerInfo = new BrokerInfo(1, "test.host", 9999,
+      Seq(new EndPoint("test.host", 9999, 
ListenerName.forSecurityProtocol(SecurityProtocol.PLAINTEXT), 
SecurityProtocol.PLAINTEXT)),
+      9998, None, ApiVersion.latestVersion)
+
+    zkClient.registerBrokerInZk(brokerInfo)
+    val broker = zkClient.getBroker(1).getOrElse(fail("Unregistered broker"))
+
+    assertEquals(brokerInfo.id, broker.id)
+    assertEquals(brokerInfo.endpoints(), broker.endPoints.mkString(","))
+  }
+
+  @Test
+  def testClusterIdMethods() {
+    val clusterId = CoreUtils.generateUuidAsBase64
+
+    zkClient.createOrGetClusterId(clusterId)
+    assertEquals(clusterId, zkClient.getClusterId.getOrElse(fail("No cluster 
id found")))
 
 Review comment:
   Nit: we can assert that that the cluster id is `Some(clusterId)`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> move ZK metrics in KafkaHealthCheck to ZookeeperClient
> ------------------------------------------------------
>
>                 Key: KAFKA-6320
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6320
>             Project: Kafka
>          Issue Type: Sub-task
>    Affects Versions: 1.0.0
>            Reporter: Jun Rao
>            Assignee: Jun Rao
>             Fix For: 1.1.0
>
>
> In KAFKA-5473, we will be de-commissioning the usage of KafkaHealthCheck. So, 
> we need to move the ZK metrics SessionState and ZooKeeper${eventType}PerSec 
> in that class to somewhere else (e.g. ZookeeperClient).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to