showuon commented on code in PR #12729:
URL: https://github.com/apache/kafka/pull/12729#discussion_r1014593992


##########
core/src/main/scala/kafka/zk/AdminZkClient.scala:
##########
@@ -355,18 +355,43 @@ class AdminZkClient(zkClient: KafkaZkClient) extends 
Logging {
    * @param entityName The entityName of the entityType
    * @param configs The config of the entityName
    */
-  def changeConfigs(entityType: String, entityName: String, configs: 
Properties): Unit = {
+  def changeConfigs(entityType: String, entityName: String, configs: 
Properties, isUserClientId: Boolean = false): Unit = {
 
     entityType match {
       case ConfigType.Topic => changeTopicConfig(entityName, configs)
       case ConfigType.Client => changeClientIdConfig(entityName, configs)
-      case ConfigType.User => changeUserOrUserClientIdConfig(entityName, 
configs)
+      case ConfigType.User => changeUserOrUserClientIdConfig(entityName, 
configs, isUserClientId)
       case ConfigType.Broker => changeBrokerConfig(parseBroker(entityName), 
configs)
       case ConfigType.Ip => changeIpConfig(entityName, configs)
       case _ => throw new IllegalArgumentException(s"$entityType is not a 
known entityType. Should be one of ${ConfigType.all}")
     }
   }
 
+  private def tryCleanQuotaNodes(entityType: String, entityName: String, 
isUserClientId: Boolean = false): Boolean = {

Review Comment:
   Could we add some javadoc above this method? And also some inline comments 
for `isUserClientId` case below, to explain what nodes we're trying to delete 
for each case. Thanks.



##########
core/src/main/scala/kafka/zk/AdminZkClient.scala:
##########
@@ -483,9 +508,19 @@ class AdminZkClient(zkClient: KafkaZkClient) extends 
Logging {
     DynamicConfig.Broker.validate(configs)
   }
 
-  private def changeEntityConfig(rootEntityType: String, 
fullSanitizedEntityName: String, configs: Properties): Unit = {
+  private def changeEntityConfig(rootEntityType: String, 
fullSanitizedEntityName: String, configs: Properties, isUserClientId: Boolean = 
false): Unit = {
     val sanitizedEntityPath = rootEntityType + '/' + fullSanitizedEntityName
-    zkClient.setOrCreateEntityConfigs(rootEntityType, fullSanitizedEntityName, 
configs)
+    var needUpdateConfigs = true
+    // If the entityType is quota and node is empty, which means the configs 
are empty and no children left,

Review Comment:
   nit: which means [if] the configs are ....



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

Reply via email to