sumitagrawl commented on code in PR #8391: URL: https://github.com/apache/ozone/pull/8391#discussion_r2077653957
########## hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java: ########## @@ -403,6 +403,14 @@ private StorageContainerManager(OzoneConfiguration conf, .register(OZONE_READONLY_ADMINISTRATORS, this::reconfOzoneReadOnlyAdmins); + reconfigurationHandler.setReconfigurationCompleteCallback(status -> { Review Comment: this callback should be registered and as implementation, ``` reconfigurationHandler.setReconfigurationCompleteCallback((status, newConf) -> { if (status.getStatus() != null && !status.getStatus().isEmpty()) { LOG.info("Reconfiguration completed. Properties are updated."); completionCallbacks.forEach(entry -> entry.call(changedKeys, newConf)); } else { LOG.info("Reconfiguration complete. No properties were changed."); } }); ``` need have register callback, Callback Map<String, Boolean> changedKeys; where String is keyName, and Boolean true: modified, false: deleted newConf: updated conf register: void registerCompleteCallback(BiFunction<>); So that required code can receive the callback. Above is just a sample, actual implementation may vary. ########## hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/conf/ReconfigurableBase.java: ########## @@ -0,0 +1,211 @@ +/* + * 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.hadoop.hdds.conf; + +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Optional; +import java.util.function.Consumer; +import org.apache.hadoop.classification.VisibleForTesting; +import org.apache.hadoop.conf.ConfigRedactor; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.conf.Configured; +import org.apache.hadoop.conf.Reconfigurable; +import org.apache.hadoop.conf.ReconfigurationException; +import org.apache.hadoop.conf.ReconfigurationTaskStatus; +import org.apache.hadoop.conf.ReconfigurationUtil; +import org.apache.hadoop.util.Time; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Base class to support dynamic reconfiguration of configuration properties at runtime. + */ +public abstract class ReconfigurableBase extends Configured implements Reconfigurable { Review Comment: We need have test cases for this, as now ozone own this class. -- 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: issues-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org