swaminathanmanish commented on code in PR #14340: URL: https://github.com/apache/pinot/pull/14340#discussion_r1827433650
########## pinot-controller/src/main/java/org/apache/pinot/controller/util/TaskConfigUtils.java: ########## @@ -0,0 +1,56 @@ +/** + * 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.pinot.controller.util; + +import java.util.Map; +import org.apache.pinot.controller.helix.core.minion.PinotTaskManager; +import org.apache.pinot.controller.helix.core.minion.generator.PinotTaskGenerator; +import org.apache.pinot.controller.helix.core.minion.generator.TaskGeneratorRegistry; +import org.apache.pinot.spi.config.table.TableConfig; +import org.apache.pinot.spi.config.table.TableTaskConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class TaskConfigUtils { + private static final Logger LOGGER = LoggerFactory.getLogger(TaskConfigUtils.class); + + private TaskConfigUtils() { + } + + public static void validateTaskConfigs(TableConfig tableConfig, PinotTaskManager pinotTaskManager) { Review Comment: @shounakmk219 , @tibrewalpratik17 The motivation for doing this is that we want to provide the ability for custom task implementations to add their validations. This is to fail table updates, if there are incompatible or incorrect configs in the taskConfig of a particular task. Example - Instead of doing the below, we would have the corresponding realtime to offline task generator contain the validation. All task specific validations would happen in the corresponding generators. // Task Specific validation for REALTIME_TO_OFFLINE_TASK_TYPE // TODO task specific validate logic should directly call to PinotTaskGenerator API if (taskTypeConfigName.equals(REALTIME_TO_OFFLINE_TASK_TYPE)) { // check table is not upsert Are we creating a generator every time? I think its a factory instance created once and used there after. -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org