symious commented on code in PR #3874:
URL: https://github.com/apache/ozone/pull/3874#discussion_r1113893448


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/DiskBalancerConfiguration.java:
##########
@@ -55,6 +71,88 @@ public final class DiskBalancerConfiguration {
       description = "The max parallel balance thread count.")
   private int parallelThread = 5;
 
+  @Config(key = "should.run.default",
+      defaultValue = "false",
+      type = ConfigType.BOOLEAN,
+      tags = { DATANODE, ConfigTag.DISKBALANCER},
+      description =
+          "If DiskBalancer fails to get information from diskbalancer.info, " +
+              "it will choose this value to decide if this service should be " 
+
+              "running."
+  )
+  private boolean diskBalancerShouldRun = false;
+
+  public boolean getDiskBalancerShouldRun() {
+    return diskBalancerShouldRun;
+  }
+
+  public void setDiskBalancerShouldRun(boolean shouldRun) {
+    this.diskBalancerShouldRun = shouldRun;
+  }
+
+  @Config(key = "service.interval",
+      defaultValue = "60s",
+      type = ConfigType.TIME,
+      tags = { DATANODE, ConfigTag.DISKBALANCER},
+      description = "Time interval of the Datanode DiskBalancer service. " +
+          "The Datanode will check the service periodically and update " +
+          "the config and running status for DiskBalancer service. " +
+          "Unit could be defined with postfix (ns,ms,s,m,h,d). "
+  )
+  private long diskBalancerInterval = Duration.ofSeconds(60).toMillis();
+
+  public Duration getDiskBalancerInterval() {
+    return Duration.ofMillis(diskBalancerInterval);
+  }
+
+  public void setDiskBalancerInterval(Duration duration) {
+    this.diskBalancerInterval = duration.toMillis();
+  }
+
+  @Config(key = "service.timeout",
+      defaultValue = "300s",
+      type = ConfigType.TIME,
+      tags = { DATANODE, ConfigTag.DISKBALANCER},
+      description = "Timeout for the Datanode DiskBalancer service. "
+          + "Unit could be defined with postfix (ns,ms,s,m,h,d). "
+  )
+  private long diskBalancerTimeout = Duration.ofSeconds(300).toMillis();
+
+  public Duration getDiskBalancerTimeout() {
+    return Duration.ofMillis(diskBalancerTimeout);
+  }
+
+  public void setDiskBalancerTimeout(Duration duration) {
+    this.diskBalancerTimeout = duration.toMillis();
+  }
+
+  @Config(key = "version",
+      defaultValue = "ONE",
+      type = ConfigType.STRING,
+      tags = { DATANODE, ConfigTag.DISKBALANCER},
+      description = "The version of the disk balancer service"
+  )
+  private String diskBalancerVersion = "ONE";
+
+  public String getDiskBalancerVersion() {
+    return diskBalancerVersion;
+  }
+
+  public void setDiskBalancerVersion(String version) {
+    this.diskBalancerVersion = version;
+  }
+
+  public DiskBalancerConfiguration() {
+  }
+
+  public DiskBalancerConfiguration(Optional<Double> threshold,
+      Optional<Long> bandwidthInMB,
+      Optional<Integer> parallelThread) {

Review Comment:
   @neils-dev Thanks for the review.
   
   I was preparing to add the balancePolicy part in another ticket after the 
basic framework.



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