Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-11494. Improve the duration option of freon #7246

Merged
merged 4 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ public void init() {
//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);
Expand Down Expand Up @@ -554,6 +558,15 @@ public String getPrefix() {
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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ public class OmBucketGenerator extends BaseFreonGenerator

private Timer bucketCreationTimer;

@Override
public boolean allowDuration() {
return false;
}

@Override
public Void call() throws Exception {

Expand Down