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

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_r158463116
 
 

 ##########
 File path: core/src/main/scala/kafka/zk/ZkData.scala
 ##########
 @@ -338,3 +341,41 @@ object AclChangeNotificationSequenceZNode {
   def encode(resourceName : String): Array[Byte] = resourceName.getBytes(UTF_8)
   def decode(bytes: Array[Byte]): String = new String(bytes, UTF_8)
 }
+
+object ClusterIdZNode {
+  def path = "/cluster/id"
+
+  def toJson(id: String): Array[Byte] = {
+    Json.encodeAsBytes(Map("version" -> "1", "id" -> id).asJava)
+  }
+
+  def fromJson(clusterIdJson:  Array[Byte]): String = {
+    
Json.parseBytes(clusterIdJson).map(_.asJsonObject("id").to[String]).getOrElse {
+      throw new KafkaException(s"Failed to parse the cluster id json 
$clusterIdJson")
+    }
+  }
+}
+
+object BrokerSequenceIdZNode {
+  def path = s"${BrokersZNode.path}/seqid"
+}
+
+object ProducerIdBlockZNode {
+  def path = "/latest_producer_id_block"
+}
+
+object ZkData {
+  // These are persistent ZK paths that should exist on kafka broker startup.
+  val PersistentZkPaths = Seq(
+    "/consumers",  // old consumer path
+    BrokerIdsZNode.path,
+    TopicsZNode.path,
+    ConfigEntityChangeNotificationZNode.path,
+    ConfigEntityTypeZNode.path(ConfigType.Topic),
+    ConfigEntityTypeZNode.path(ConfigType.Client),
 
 Review comment:
   Shouldn't we do this for `Broker` and `User` as well?

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