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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -521,7 +528,26 @@ 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. Properties are updated.");
+      } else {
+        LOG.info("Reconfiguration complete. No properties were changed.");
+      }
+    });
+
+    reconfigurationHandler.registerCompleteCallback((changedKeys, newConf) -> {
+      Set<String> relevantKeys = new HashSet<>();
+      relevantKeys.add(OZONE_DIR_DELETING_SERVICE_INTERVAL);
+
+      boolean shouldRestart = 
changedKeys.keySet().stream().anyMatch(relevantKeys::contains);
+      if (shouldRestart) {
+        initOrUpdateDirDeletingService((OzoneConfiguration) newConf);
+      }
+    });

Review Comment:
   Can simplify,
   ```suggestion
       reconfigurationHandler.registerCompleteCallback((changedKeys, newConf) 
-> {
     if (changedKeys.containsKey(OZONE_DIR_DELETING_SERVICE_INTERVAL)) {
       initOrUpdateDirDeletingService(getConfiguration()); 
     }
   });
   ```



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -5097,6 +5123,12 @@ private String reconfigureAllowListAllVolumes(String 
newVal) {
     return String.valueOf(allowListAllVolumes);
   }
 
+  private String reconfOzoneDirDeletingServiceInterval(String newVal) {
+    getConfiguration().set(OZONE_DIR_DELETING_SERVICE_INTERVAL, newVal);

Review Comment:
   We can also check for an IllegalArgumentException while setting the interval.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -5097,6 +5123,12 @@ private String reconfigureAllowListAllVolumes(String 
newVal) {
     return String.valueOf(allowListAllVolumes);
   }
 
+  private String reconfOzoneDirDeletingServiceInterval(String newVal) {
+    getConfiguration().set(OZONE_DIR_DELETING_SERVICE_INTERVAL, newVal);
+    
getKeyManager().getDirDeletingService().setDirDeletingServiceInterval(newVal);

Review Comment:
   We don't need this line, as I don't find any usage of 
"dirDeletingServiceInterval" in DirectoryDeletingService.java. So we can remove 
this line!



-- 
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