Gargi-jais11 commented on code in PR #8488:
URL: https://github.com/apache/ozone/pull/8488#discussion_r2101537149
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/DatanodeStateMachine.java:
##########
@@ -704,6 +711,44 @@ private Thread getCommandHandlerThread(Runnable
processCommandQueue) {
return handlerThread;
}
+ /**
+ * Stops the DiskBalancerService if it is running.
+ */
+ public void stopDiskBalancer() {
+ OzoneContainer ozoneContainer = getContainer();
+ if (ozoneContainer != null) {
+ DiskBalancerService diskBalancerService =
ozoneContainer.getDiskBalancerService();
+ if (diskBalancerService != null) {
+ shouldRun = diskBalancerService.getDiskBalancerInfo().isShouldRun();
+ paused.set(true); // Mark as paused
+ diskBalancerService.setShouldRun(false);
+ }
+ }
+ }
+
+ /**
+ * Resume the DiskBalancerService if it was running previously.
+ */
+ public void resumeDiskBalancer() {
+ OzoneContainer ozoneContainer = getContainer();
+ if (ozoneContainer != null) {
+ DiskBalancerService diskBalancerService =
ozoneContainer.getDiskBalancerService();
+ if (diskBalancerService != null && paused.get()) {
Review Comment:
okay
--
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]