Copilot commented on code in PR #8391:
URL: https://github.com/apache/ozone/pull/8391#discussion_r2127956052


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java:
##########
@@ -287,6 +287,14 @@ public String getNamespace() {
               .register(REPLICATION_STREAMS_LIMIT_KEY,
                   this::reconfigReplicationStreamsLimit);
 
+      reconfigurationHandler.setReconfigurationCompleteCallback((status, 
newConf) -> {

Review Comment:
   Multiple modules register similar reconfiguration-complete callbacks for 
logging; consider extracting a common helper method to centralize this callback 
logic and reduce duplicate code.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -519,7 +522,22 @@ private OzoneManager(OzoneConfiguration conf, 
StartupOption startupOption)
                 this::reconfOzoneReadOnlyAdmins)
             .register(OZONE_OM_VOLUME_LISTALL_ALLOWED, 
this::reconfigureAllowListAllVolumes)
             .register(OZONE_KEY_DELETING_LIMIT_PER_TASK,
-                this::reconfOzoneKeyDeletingLimitPerTask);
+                this::reconfOzoneKeyDeletingLimitPerTask)
+            .register(OZONE_DIR_DELETING_SERVICE_INTERVAL, 
this::reconfOzoneDirDeletingServiceInterval);
+
+    reconfigurationHandler.setReconfigurationCompleteCallback((status, 
newConf) -> {
+      if (status.getStatus() != null && !status.getStatus().isEmpty()) {
+        LOG.info("Reconfiguration completed with {} updated properties.", 
status.getStatus().size());
+      } else {
+        LOG.info("Reconfiguration complete. No properties were changed.");
+      }
+    });
+
+    reconfigurationHandler.registerCompleteCallback((changedKeys, newConf) -> {
+      if (changedKeys.containsKey(OZONE_DIR_DELETING_SERVICE_INTERVAL)) {
+        
getKeyManager().getDirDeletingService().updateAndRestart(getConfiguration());

Review Comment:
   Consider caching the DirectoryDeletingService instance in OzoneManager 
rather than repeatedly retrieving it through getKeyManager(), to improve 
clarity and reduce potential overhead.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to