This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 360fea5b2e HDDS-11494. Improve the duration option of freon ombg 
(#7246)
360fea5b2e is described below

commit 360fea5b2eeb2c592c242ffc8ceb4e71783a62d6
Author: jianghuazhu <[email protected]>
AuthorDate: Tue Oct 1 18:41:43 2024 +0800

    HDDS-11494. Improve the duration option of freon ombg (#7246)
---
 .../org/apache/hadoop/ozone/freon/BaseFreonGenerator.java   | 13 +++++++++++++
 .../org/apache/hadoop/ozone/freon/OmBucketGenerator.java    |  5 +++++
 2 files changed, 18 insertions(+)

diff --git 
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java
 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java
index 20acad0562..3627b917f0 100644
--- 
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java
+++ 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java
@@ -290,6 +290,10 @@ public class BaseFreonGenerator {
       //replace environment variables to support multi-node execution
       prefix = resolvePrefix(prefix);
     }
+    if (duration != null && !allowDuration()) {
+      LOG.warn("--duration is ignored");
+      duration = null;
+    }
     if (duration != null) {
       durationInSecond = TimeDurationUtil.getTimeDurationHelper(
           "--runtime", duration, TimeUnit.SECONDS);
@@ -554,6 +558,15 @@ public class BaseFreonGenerator {
     return prefix;
   }
 
+  /**
+   * Whether to enable Duration.
+   * If enabled, the command will load the --duration option.
+   * If not enabled, the command will not load the --duration option.
+   */
+  public boolean allowDuration() {
+    return true;
+  }
+
   public MetricRegistry getMetrics() {
     return metrics;
   }
diff --git 
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/OmBucketGenerator.java
 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/OmBucketGenerator.java
index a3e21d58e2..27ebc87763 100644
--- 
a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/OmBucketGenerator.java
+++ 
b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/OmBucketGenerator.java
@@ -57,6 +57,11 @@ public class OmBucketGenerator extends BaseFreonGenerator
 
   private Timer bucketCreationTimer;
 
+  @Override
+  public boolean allowDuration() {
+    return false;
+  }
+
   @Override
   public Void call() throws Exception {
 


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

Reply via email to