com.hubspot.singularity.config.SingularityConfiguration Maven / Gradle / Ivy
package com.hubspot.singularity.config;
import io.dropwizard.Configuration;
import io.dropwizard.db.DataSourceFactory;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Optional;
import com.hubspot.singularity.SlavePlacement;
@JsonIgnoreProperties(ignoreUnknown = true)
public class SingularityConfiguration extends Configuration {
@NotNull
private boolean allowRequestsWithoutOwners = true;
@NotNull
private boolean allowTestResourceCalls = false;
@NotNull
private long askDriverToKillTasksAgainAfterMillis = TimeUnit.MINUTES.toMillis(5);
@NotNull
private long cacheStateForMillis = TimeUnit.SECONDS.toMillis(30);
@NotNull
private long checkDeploysEverySeconds = 5;
@NotNull
private long checkNewTasksEverySeconds = 5;
@NotNull
private int checkNewTasksScheduledThreads = 3;
@NotNull
private long checkReconcileWhenRunningEveryMillis = TimeUnit.SECONDS.toMillis(30);
@NotNull
private long checkScheduledJobsEveryMillis = TimeUnit.MINUTES.toMillis(10);
@NotNull
private long checkSchedulerEverySeconds = 5;
@NotNull
private long checkWebhooksEveryMillis = TimeUnit.SECONDS.toMillis(10);
@NotNull
private long cleanupEverySeconds = 5;
@NotNull
private long closeWaitSeconds = 5;
private String commonHostnameSuffixToOmit;
@NotNull
private boolean compressLargeDataObjects = true;
@NotNull
private long considerTaskHealthyAfterRunningForSeconds = 5;
@NotNull
private int cooldownAfterFailures = 3;
@NotNull
private double cooldownAfterPctOfInstancesFail = 1.0;
@NotNull
private long cooldownExpiresAfterMinutes = 15;
@NotNull
private long cooldownMinScheduleSeconds = 120;
@JsonProperty("database")
private DataSourceFactory databaseConfiguration;
@NotNull
private SlavePlacement defaultSlavePlacement = SlavePlacement.GREEDY;
@NotNull
private boolean defaultValueForKillTasksOfPausedRequests = true;
@NotNull
private long deltaAfterWhichTasksAreLateMillis = TimeUnit.SECONDS.toMillis(30);
@NotNull
private long deployHealthyBySeconds = 120;
private boolean enableCorsFilter = false;
@NotNull
private long healthcheckIntervalSeconds = 5;
@NotNull
private int healthcheckStartThreads = 3;
@NotNull
private long healthcheckTimeoutSeconds = 5;
private String hostname;
@NotNull
private long killAfterTasksDoNotRunDefaultSeconds = 600;
@NotNull
private long killNonLongRunningTasksInCleanupAfterSeconds = TimeUnit.HOURS.toSeconds(24);
@JsonProperty("loadBalancerQueryParams")
private Map loadBalancerQueryParams;
@NotNull
private long loadBalancerRequestTimeoutMillis = 2000;
private String loadBalancerUri;
@NotNull
private int logFetchMaxThreads = 15;
@NotNull
private int maxDeployIdSize = 50;
@NotNull
private int maxHealthcheckResponseBodyBytes = 8192;
@NotNull
private int maxQueuedUpdatesPerWebhook = 50;
@NotNull
private int maxRequestIdSize = 100;
@JsonProperty("mesos")
private MesosConfiguration mesosConfiguration;
@NotNull
private int newTaskCheckerBaseDelaySeconds = 1;
@NotNull
private long persistHistoryEverySeconds = TimeUnit.HOURS.toSeconds(1);
@JsonProperty("s3")
private S3Configuration s3Configuration;
@NotNull
private boolean sandboxDefaultsToTaskId = false;
@NotNull
private long sandboxHttpTimeoutMillis = TimeUnit.SECONDS.toMillis(5);
@NotNull
private long saveStateEverySeconds = 60;
@JsonProperty("sentry")
private SentryConfiguration sentryConfiguration;
@JsonProperty("smtp")
private SMTPConfiguration smtpConfiguration;
@NotNull
private long startNewReconcileEverySeconds = TimeUnit.MINUTES.toSeconds(10);
@JsonProperty("ui")
@Valid
private UIConfiguration uiConfiguration = new UIConfiguration();
@NotNull
private long warnIfScheduledJobIsRunningForAtLeastMillis = TimeUnit.DAYS.toMillis(1);
@NotNull
private int warnIfScheduledJobIsRunningPastNextRunPct = 200;
@NotNull
private long zookeeperAsyncTimeout = 5000;
@JsonProperty("zookeeper")
private ZooKeeperConfiguration zooKeeperConfiguration;
public boolean allowTestResourceCalls() {
return allowTestResourceCalls;
}
public long getAskDriverToKillTasksAgainAfterMillis() {
return askDriverToKillTasksAgainAfterMillis;
}
public long getCacheStateForMillis() {
return cacheStateForMillis;
}
public long getCheckDeploysEverySeconds() {
return checkDeploysEverySeconds;
}
public long getCheckNewTasksEverySeconds() {
return checkNewTasksEverySeconds;
}
public int getCheckNewTasksScheduledThreads() {
return checkNewTasksScheduledThreads;
}
public long getCheckReconcileWhenRunningEveryMillis() {
return checkReconcileWhenRunningEveryMillis;
}
public long getCheckScheduledJobsEveryMillis() {
return checkScheduledJobsEveryMillis;
}
public long getCheckSchedulerEverySeconds() {
return checkSchedulerEverySeconds;
}
public long getCheckWebhooksEveryMillis() {
return checkWebhooksEveryMillis;
}
public long getCleanupEverySeconds() {
return cleanupEverySeconds;
}
public long getCloseWaitSeconds() {
return closeWaitSeconds;
}
public Optional getCommonHostnameSuffixToOmit() {
return Optional.fromNullable(commonHostnameSuffixToOmit);
}
public long getConsiderTaskHealthyAfterRunningForSeconds() {
return considerTaskHealthyAfterRunningForSeconds;
}
public int getCooldownAfterFailures() {
return cooldownAfterFailures;
}
public double getCooldownAfterPctOfInstancesFail() {
return cooldownAfterPctOfInstancesFail;
}
public long getCooldownExpiresAfterMinutes() {
return cooldownExpiresAfterMinutes;
}
public long getCooldownMinScheduleSeconds() {
return cooldownMinScheduleSeconds;
}
public Optional getDatabaseConfiguration() {
return Optional.fromNullable(databaseConfiguration);
}
public SlavePlacement getDefaultSlavePlacement() {
return defaultSlavePlacement;
}
public long getDeltaAfterWhichTasksAreLateMillis() {
return deltaAfterWhichTasksAreLateMillis;
}
public long getDeployHealthyBySeconds() {
return deployHealthyBySeconds;
}
public long getHealthcheckIntervalSeconds() {
return healthcheckIntervalSeconds;
}
public int getHealthcheckStartThreads() {
return healthcheckStartThreads;
}
public long getHealthcheckTimeoutSeconds() {
return healthcheckTimeoutSeconds;
}
public String getHostname() {
return hostname;
}
public long getKillAfterTasksDoNotRunDefaultSeconds() {
return killAfterTasksDoNotRunDefaultSeconds;
}
public long getKillNonLongRunningTasksInCleanupAfterSeconds() {
return killNonLongRunningTasksInCleanupAfterSeconds;
}
public Optional © 2015 - 2025 Weber Informatics LLC | Privacy Policy