diff options
author | Martin Polden <mpolden@mpolden.no> | 2018-06-19 10:31:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-19 10:31:36 +0200 |
commit | 0b8db6130a386423d5e372fd6beef7d031fca085 (patch) | |
tree | 1450b4b5d2241e76e88116b2f070401a6d35c6eb | |
parent | d758fceda5534761762064e4a6095d13caf5bb90 (diff) | |
parent | b39b411c459bba208468a14dc34a13c036f0d1db (diff) |
Merge pull request #6225 from vespa-engine/hmusum/run-tenants-maintainer-in-all-zones
Run TenantsMaintainer in all zones
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/ConfigServerMaintenance.java | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/ConfigServerMaintenance.java b/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/ConfigServerMaintenance.java index 2a53f9ee45c..fd5d09a4ff2 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/ConfigServerMaintenance.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/ConfigServerMaintenance.java @@ -3,8 +3,6 @@ package com.yahoo.vespa.config.server.maintenance; import com.yahoo.cloud.config.ConfigserverConfig; import com.yahoo.component.AbstractComponent; -import com.yahoo.config.provision.Environment; -import com.yahoo.config.provision.SystemName; import com.yahoo.vespa.config.server.ApplicationRepository; import com.yahoo.vespa.config.server.session.FileDistributionFactory; import com.yahoo.vespa.curator.Curator; @@ -23,7 +21,7 @@ public class ConfigServerMaintenance extends AbstractComponent { Curator curator, FileDistributionFactory fileDistributionFactory) { DefaultTimes defaults = new DefaultTimes(configserverConfig); - tenantsMaintainer = new TenantsMaintainer(applicationRepository, curator, defaults.tenantsMaintainerInterval); + tenantsMaintainer = new TenantsMaintainer(applicationRepository, curator, defaults.defaultInterval); zooKeeperDataMaintainer = new ZooKeeperDataMaintainer(applicationRepository, curator, defaults.defaultInterval); fileDistributionMaintainer = new FileDistributionMaintainer(applicationRepository, curator, defaults.defaultInterval, configserverConfig); } @@ -42,18 +40,9 @@ public class ConfigServerMaintenance extends AbstractComponent { private static class DefaultTimes { private final Duration defaultInterval; - private final Duration tenantsMaintainerInterval; DefaultTimes(ConfigserverConfig configserverConfig) { - boolean isCd = configserverConfig.system().equals(SystemName.cd.name()); - boolean isTest = Environment.from(configserverConfig.environment()).isTest(); - this.defaultInterval = Duration.ofMinutes(configserverConfig.maintainerIntervalMinutes()); - // TODO: Want job control or feature flag to control when to run this, for now use a very - // long interval to avoid running the maintainer - this.tenantsMaintainerInterval = isCd || isTest || configserverConfig.region().equals("us-central-1") - ? defaultInterval - : Duration.ofMinutes(configserverConfig.tenantsMaintainerIntervalMinutes()); } } |