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



##########
File path: 
metadata/src/main/java/org/apache/kafka/controller/ConfigurationValidator.java
##########
@@ -0,0 +1,33 @@
+/*
+ * 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 org.apache.kafka.controller;
+
+import org.apache.kafka.common.config.ConfigResource;
+
+import java.util.Map;
+
+
+public interface ConfigurationValidator {
+    /**
+     * Throws an ApiException if a configuration is invalid for the given 
resource.
+     *
+     * @param resource      The configuration resource.
+     * @param config        The new configuration.
+     */
+    void validate(ConfigResource resource, Map<String, String> config);

Review comment:
       Yes, there was supposed to be a ControllerConfigurationValidator file. 
Added.

##########
File path: 
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java
##########
@@ -215,6 +216,11 @@ public Builder 
setAlterConfigPolicy(Optional<AlterConfigPolicy> alterConfigPolic
             return this;
         }
 
+        public Builder setConfigurationValidator(ConfigurationValidator 
configurationValidator) {
+            this.configurationValidator = configurationValidator;
+            return this;
+        }

Review comment:
       Yes, there was supposed to be a ControllerConfigurationValidator file. 
Added.

##########
File path: 
metadata/src/test/java/org/apache/kafka/controller/ConfigurationControlManagerTest.java
##########
@@ -72,6 +73,14 @@
             define("ghi", ConfigDef.Type.BOOLEAN, true, 
ConfigDef.Importance.HIGH, "ghi"));
     }
 
+    static class ExampleConfigurationValidator implements 
ConfigurationValidator {
+        static final ExampleConfigurationValidator INSTANCE = new 
ExampleConfigurationValidator();
+
+        @Override
+        public void validate(ConfigResource resource, Map<String, String> 
config) {
+        }

Review comment:
       good idea, I'll do 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-unsubscr...@kafka.apache.org

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


Reply via email to