You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/12/03 01:11:59 UTC

[GitHub] [kafka] cmccabe commented on a change in pull request #11416: KAFKA-13490: Fix createTopics and incrementalAlterConfigs for KRaft mode

cmccabe commented on a change in pull request #11416:
URL: https://github.com/apache/kafka/pull/11416#discussion_r761580186



##########
File path: core/src/main/scala/kafka/server/ControllerConfigurationValidator.scala
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package kafka.server
+
+import java.util
+import java.util.Properties
+
+import kafka.log.LogConfig
+import org.apache.kafka.common.config.ConfigResource
+import org.apache.kafka.common.config.ConfigResource.Type.{BROKER, TOPIC}
+import org.apache.kafka.controller.ConfigurationValidator
+import org.apache.kafka.common.errors.InvalidRequestException
+
+import scala.collection.mutable
+
+class ControllerConfigurationValidator extends ConfigurationValidator {
+  override def validate(resource: ConfigResource, config: util.Map[String, String]): Unit = {
+    resource.`type`() match {
+      case TOPIC =>
+        val properties = new Properties()
+        val nullTopicConfigs = new mutable.ArrayBuffer[String]()
+        config.entrySet().forEach(e => {
+          if (e.getValue() == null) {
+            nullTopicConfigs += e.getKey()
+          } else {
+            properties.setProperty(e.getKey(), e.getValue())
+          }
+        })
+        if (!nullTopicConfigs.isEmpty) {
+          throw new InvalidRequestException("Null value not supported for topic configs : " +
+            nullTopicConfigs.mkString(","))
+        }
+        LogConfig.validate(properties)
+      case BROKER =>
+        // TODO: add broker configuration validation
+      case _ =>

Review comment:
       `BROKER_LOGGER` is handled by individual brokers and not persisted anywhere in the metadata.
   
   One thing we should do, though, is allow people to use `BROKER_LOGGER` on controller-only nodes. Filed https://issues.apache.org/jira/browse/KAFKA-13502 for that.




-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org