guihecheng commented on a change in pull request #2875:
URL: https://github.com/apache/ozone/pull/2875#discussion_r759071510



##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerScrubberConfiguration.java
##########
@@ -17,55 +17,100 @@
  */
 package org.apache.hadoop.ozone.container.ozoneimpl;
 
+import org.apache.hadoop.conf.StorageUnit;
 import org.apache.hadoop.hdds.conf.Config;
 import org.apache.hadoop.hdds.conf.ConfigGroup;
 import org.apache.hadoop.hdds.conf.ConfigTag;
 import org.apache.hadoop.hdds.conf.ConfigType;
+import org.apache.hadoop.hdds.conf.PostConstruct;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.time.Duration;
 
 /**
  * This class defines configuration parameters for container scrubber.
  **/
 @ConfigGroup(prefix = "hdds.container.scrub")
 public class ContainerScrubberConfiguration {
 
+  private static final Logger LOG =
+      LoggerFactory.getLogger(ContainerScrubberConfiguration.class);
+
   // only for log
   public static final String HDDS_CONTAINER_SCRUB_ENABLED =
       "hdds.container.scrub.enabled";
+  static final String METADATA_SCAN_INTERVAL_KEY =
+      "hdds.container.scrub.metadata.scan.interval";
+  static final String DATA_SCAN_INTERVAL_KEY =
+      "hdds.container.scrub.data.scan.interval";
+  static final String VOLUME_BYTES_PER_SECOND_KEY =
+      "hdds.container.scrub.volume.bytes.per.second";
+
+  static final long METADATA_SCAN_INTERVAL_DEFAULT =
+      Duration.ofHours(3).toMillis();
+  static final long DATA_SCAN_INTERVAL_DEFAULT =
+      Duration.ofDays(1).toMillis();
+  static final long BANDWIDTH_PER_VOLUME_DEFAULT =
+      (long) StorageUnit.MB.toBytes(1);
 
   @Config(key = "enabled",
       type = ConfigType.BOOLEAN,
       defaultValue = "false",
       tags = {ConfigTag.STORAGE},
       description = "Config parameter to enable container scrubber.")
-  private boolean enabled;
+  private boolean enabled = false;
 
   @Config(key = "metadata.scan.interval",
       type = ConfigType.TIME,
       defaultValue = "3h",
       tags = {ConfigTag.STORAGE},
-      description = "Config parameter define time interval in milliseconds" +
-          " between two metadata scans by container scrubber.")
-  private long metadataScanInterval;
+      description = "Config parameter define time interval" +
+          " between two metadata scans by container scrubber." +
+          " Unit could be defined with postfix (ns,ms,s,m,h,d).")
+  private long metadataScanInterval = METADATA_SCAN_INTERVAL_DEFAULT;
 
   @Config(key = "data.scan.interval",
       type = ConfigType.TIME,
-      defaultValue = "1m",
+      defaultValue = "1d",
       tags = {ConfigTag.STORAGE},
       description = "Minimum time interval between two iterations of container"
           + " data scanning.  If an iteration takes less time than this, the"
-          + " scanner will wait before starting the next iteration."
-  )
-  private long dataScanInterval;
+          + " scanner will wait before starting the next iteration." +
+          " Unit could be defined with postfix (ns,ms,s,m,h,d).")
+  private long dataScanInterval = DATA_SCAN_INTERVAL_DEFAULT;
 
   @Config(key = "volume.bytes.per.second",
-      type = ConfigType.LONG,
-      defaultValue = "1048576",
+      type = ConfigType.SIZE,
+      defaultValue = "1MB",

Review comment:
       Ah, this is an incompatible change as you said, so I should revert this 
type back to LONG, thanks~




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