npawar commented on a change in pull request #3644: Split ValidationManager duties into separate ControllerPeriodicTasks URL: https://github.com/apache/incubator-pinot/pull/3644#discussion_r245759396
########## File path: pinot-controller/src/main/java/com/linkedin/pinot/controller/validation/BrokerResourceValidationManager.java ########## @@ -0,0 +1,80 @@ +/** + * Copyright (C) 2014-2018 LinkedIn Corp. ([email protected]) + * + * Licensed 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 com.linkedin.pinot.controller.validation; + +import com.linkedin.pinot.common.config.TableConfig; +import com.linkedin.pinot.controller.ControllerConf; +import com.linkedin.pinot.controller.helix.core.PinotHelixResourceManager; +import com.linkedin.pinot.controller.helix.core.periodictask.ControllerPeriodicTask; +import java.util.List; +import java.util.Set; +import org.apache.helix.model.InstanceConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * Rebuilds the broker resource if the instance set has changed + */ +public class BrokerResourceValidationManager extends ControllerPeriodicTask { + private static final Logger LOGGER = LoggerFactory.getLogger(BrokerResourceValidationManager.class); + + private List<InstanceConfig> _instanceConfigs; + + public BrokerResourceValidationManager(ControllerConf config, PinotHelixResourceManager pinotHelixResourceManager) { + super("BrokerResourceValidationManager", config.getBrokerResourceValidationFrequencyInSeconds(), + pinotHelixResourceManager); + } + + @Override + protected void preprocess() { + // Cache instance configs to reduce ZK access Review comment: I think it was put there by original author to say that we are fetching instance configs before processing all tables. Removed it, as it is confusing and probably irrelevant now ---------------------------------------------------------------- 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] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
