diff options
author | Harald Musum <musum@yahooinc.com> | 2022-12-03 14:40:39 +0100 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2022-12-03 14:41:03 +0100 |
commit | d603afa302dc5911eda46360f08ff708f19c2a1a (patch) | |
tree | b71d498b48242cab42e18542a57c51cc6397233a /configserver/src/main | |
parent | afcf1bb71cb7b87a03149d197f724cfc7603ef92 (diff) |
Remove unused and undocumented support for permanent-services.xml
Diffstat (limited to 'configserver/src/main')
8 files changed, 2 insertions, 79 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/application/PermanentApplicationPackage.java b/configserver/src/main/java/com/yahoo/vespa/config/server/application/PermanentApplicationPackage.java deleted file mode 100644 index 65c741066c2..00000000000 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/application/PermanentApplicationPackage.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.config.server.application; - -import com.yahoo.config.application.api.ApplicationPackage; -import com.yahoo.config.model.application.provider.FilesApplicationPackage; -import java.util.logging.Level; -import com.yahoo.cloud.config.ConfigserverConfig; -import static com.yahoo.vespa.defaults.Defaults.getDefaults; - -import java.io.File; -import java.util.Optional; -import java.util.logging.Logger; - -/** - * A global permanent application package containing configuration info that is always used during deploy. - * - * @author Ulf Lilleengen - */ -public class PermanentApplicationPackage { - - private static final Logger log = Logger.getLogger(PermanentApplicationPackage.class.getName()); - private final Optional<ApplicationPackage> applicationPackage; - - public PermanentApplicationPackage(ConfigserverConfig config) { - File app = new File(getDefaults().underVespaHome(config.applicationDirectory())); - applicationPackage = Optional.ofNullable(app.exists() ? FilesApplicationPackage.fromFile(app) : null); - if (applicationPackage.isPresent()) { - log.log(Level.FINE, () -> "Detected permanent application package in '" + - getDefaults().underVespaHome(config.applicationDirectory()) + - "'. This might add extra services to config models"); - } - } - - /** - * Get the permanent application package. - * - * @return An {@link Optional} of the application package, as it may not exist. - */ - public Optional<ApplicationPackage> applicationPackage() { - return applicationPackage; - } - -} diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java index 2a19a3b0833..dcd59f6ceff 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java @@ -56,7 +56,6 @@ public class ModelContextImpl implements ModelContext { private final ApplicationPackage applicationPackage; private final Optional<Model> previousModel; - private final Optional<ApplicationPackage> permanentApplicationPackage; private final DeployLogger deployLogger; private final ConfigDefinitionRepo configDefinitionRepo; private final FileRegistry fileRegistry; @@ -83,7 +82,6 @@ public class ModelContextImpl implements ModelContext { public ModelContextImpl(ApplicationPackage applicationPackage, Optional<Model> previousModel, - Optional<ApplicationPackage> permanentApplicationPackage, DeployLogger deployLogger, ConfigDefinitionRepo configDefinitionRepo, FileRegistry fileRegistry, @@ -98,7 +96,6 @@ public class ModelContextImpl implements ModelContext { Version wantedNodeVespaVersion) { this.applicationPackage = applicationPackage; this.previousModel = previousModel; - this.permanentApplicationPackage = permanentApplicationPackage; this.deployLogger = deployLogger; this.configDefinitionRepo = configDefinitionRepo; this.fileRegistry = fileRegistry; @@ -119,9 +116,6 @@ public class ModelContextImpl implements ModelContext { @Override public Optional<Model> previousModel() { return previousModel; } - @Override - public Optional<ApplicationPackage> permanentApplicationPackage() { return permanentApplicationPackage; } - /** * Returns the host provisioner to use, or empty to use the default provisioner, * creating hosts from the application package defined hosts diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ActivatedModelsBuilder.java b/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ActivatedModelsBuilder.java index 019b0386695..9497a298a33 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ActivatedModelsBuilder.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ActivatedModelsBuilder.java @@ -20,7 +20,6 @@ import com.yahoo.vespa.config.server.ServerCache; import com.yahoo.vespa.config.server.application.Application; import com.yahoo.vespa.config.server.application.ApplicationCuratorDatabase; import com.yahoo.vespa.config.server.application.ApplicationSet; -import com.yahoo.vespa.config.server.application.PermanentApplicationPackage; import com.yahoo.vespa.config.server.deploy.ModelContextImpl; import com.yahoo.vespa.config.server.monitoring.MetricUpdater; import com.yahoo.vespa.config.server.monitoring.Metrics; @@ -33,7 +32,6 @@ import com.yahoo.vespa.config.server.tenant.EndpointCertificateRetriever; import com.yahoo.vespa.config.server.tenant.TenantRepository; import com.yahoo.vespa.curator.Curator; import com.yahoo.vespa.flags.FlagSource; - import java.util.Comparator; import java.util.Map; import java.util.Optional; @@ -54,7 +52,6 @@ public class ActivatedModelsBuilder extends ModelsBuilder<Application> { private final long applicationGeneration; private final SessionZooKeeperClient zkClient; private final Optional<ApplicationSet> currentActiveApplicationSet; - private final PermanentApplicationPackage permanentApplicationPackage; private final ConfigDefinitionRepo configDefinitionRepo; private final Metrics metrics; private final Curator curator; @@ -69,7 +66,6 @@ public class ActivatedModelsBuilder extends ModelsBuilder<Application> { ExecutorService executor, Curator curator, Metrics metrics, - PermanentApplicationPackage permanentApplicationPackage, FlagSource flagSource, SecretStore secretStore, HostProvisionerProvider hostProvisionerProvider, @@ -82,7 +78,6 @@ public class ActivatedModelsBuilder extends ModelsBuilder<Application> { this.applicationGeneration = applicationGeneration; this.zkClient = zkClient; this.currentActiveApplicationSet = currentActiveApplicationSet; - this.permanentApplicationPackage = permanentApplicationPackage; this.configDefinitionRepo = configDefinitionRepo; this.metrics = metrics; this.curator = curator; @@ -104,7 +99,6 @@ public class ActivatedModelsBuilder extends ModelsBuilder<Application> { ModelContext modelContext = new ModelContextImpl( applicationPackage, modelOf(modelFactory.version()), - permanentApplicationPackage.applicationPackage(), new SilentDeployLogger(), configDefinitionRepo, getForVersionOrLatest(applicationPackage.getFileRegistries(), modelFactory.version()).orElse(new MockFileRegistry()), diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/PreparedModelsBuilder.java b/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/PreparedModelsBuilder.java index e6ae5c491c0..35c4d761090 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/PreparedModelsBuilder.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/PreparedModelsBuilder.java @@ -29,14 +29,12 @@ import com.yahoo.container.jdisc.secretstore.SecretStore; import com.yahoo.vespa.config.server.application.Application; import com.yahoo.vespa.config.server.application.ApplicationCuratorDatabase; import com.yahoo.vespa.config.server.application.ApplicationSet; -import com.yahoo.vespa.config.server.application.PermanentApplicationPackage; import com.yahoo.vespa.config.server.deploy.ModelContextImpl; import com.yahoo.vespa.config.server.host.HostValidator; import com.yahoo.vespa.config.server.provision.HostProvisionerProvider; import com.yahoo.vespa.config.server.session.PrepareParams; import com.yahoo.vespa.curator.Curator; import com.yahoo.vespa.flags.FlagSource; - import java.io.File; import java.io.IOException; import java.time.Duration; @@ -56,7 +54,6 @@ public class PreparedModelsBuilder extends ModelsBuilder<PreparedModelsBuilder.P private static final Logger log = Logger.getLogger(PreparedModelsBuilder.class.getName()); - private final PermanentApplicationPackage permanentApplicationPackage; private final FlagSource flagSource; private final SecretStore secretStore; private final List<ContainerEndpoint> containerEndpoints; @@ -70,7 +67,6 @@ public class PreparedModelsBuilder extends ModelsBuilder<PreparedModelsBuilder.P private final ExecutorService executor; public PreparedModelsBuilder(ModelFactoryRegistry modelFactoryRegistry, - PermanentApplicationPackage permanentApplicationPackage, FlagSource flagSource, SecretStore secretStore, List<ContainerEndpoint> containerEndpoints, @@ -87,7 +83,6 @@ public class PreparedModelsBuilder extends ModelsBuilder<PreparedModelsBuilder.P ConfigserverConfig configserverConfig, Zone zone) { super(modelFactoryRegistry, configserverConfig, zone, hostProvisionerProvider, deployLogger); - this.permanentApplicationPackage = permanentApplicationPackage; this.flagSource = flagSource; this.secretStore = secretStore; this.containerEndpoints = containerEndpoints; @@ -115,7 +110,6 @@ public class PreparedModelsBuilder extends ModelsBuilder<PreparedModelsBuilder.P ModelContext modelContext = new ModelContextImpl( applicationPackage, modelOf(modelVersion), - permanentApplicationPackage.applicationPackage(), deployLogger(), configDefinitionRepo, fileRegistry, diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java index 4928af488e1..86eba77606b 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java @@ -33,7 +33,6 @@ import com.yahoo.text.XML; import com.yahoo.vespa.config.server.ConfigServerSpec; import com.yahoo.vespa.config.server.TimeoutBudget; import com.yahoo.vespa.config.server.application.ApplicationSet; -import com.yahoo.vespa.config.server.application.PermanentApplicationPackage; import com.yahoo.vespa.config.server.configchange.ConfigChangeActions; import com.yahoo.vespa.config.server.deploy.ZooKeeperDeployer; import com.yahoo.vespa.config.server.filedistribution.FileDistributionFactory; @@ -83,7 +82,6 @@ public class SessionPreparer { private final ModelFactoryRegistry modelFactoryRegistry; private final FileDistributionFactory fileDistributionFactory; private final HostProvisionerProvider hostProvisionerProvider; - private final PermanentApplicationPackage permanentApplicationPackage; private final ConfigserverConfig configserverConfig; private final ConfigDefinitionRepo configDefinitionRepo; private final Curator curator; @@ -96,7 +94,6 @@ public class SessionPreparer { FileDistributionFactory fileDistributionFactory, ExecutorService executor, HostProvisionerProvider hostProvisionerProvider, - PermanentApplicationPackage permanentApplicationPackage, ConfigserverConfig configserverConfig, ConfigDefinitionRepo configDefinitionRepo, Curator curator, @@ -106,7 +103,6 @@ public class SessionPreparer { this.modelFactoryRegistry = modelFactoryRegistry; this.fileDistributionFactory = fileDistributionFactory; this.hostProvisionerProvider = hostProvisionerProvider; - this.permanentApplicationPackage = permanentApplicationPackage; this.configserverConfig = configserverConfig; this.configDefinitionRepo = configDefinitionRepo; this.curator = curator; @@ -206,7 +202,6 @@ public class SessionPreparer { this.athenzDomain = params.athenzDomain(); this.fileRegistry = fileDistributionFactory.createFileRegistry(serverDbSessionDir); this.preparedModelsBuilder = new PreparedModelsBuilder(modelFactoryRegistry, - permanentApplicationPackage, flagSource, secretStore, containerEndpoints, diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java index 9c50636ecfb..77b8a9de2c0 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java @@ -25,7 +25,6 @@ import com.yahoo.transaction.Transaction; import com.yahoo.vespa.config.server.ConfigServerDB; import com.yahoo.vespa.config.server.TimeoutBudget; import com.yahoo.vespa.config.server.application.ApplicationSet; -import com.yahoo.vespa.config.server.application.PermanentApplicationPackage; import com.yahoo.vespa.config.server.application.TenantApplications; import com.yahoo.vespa.config.server.configchange.ConfigChangeActions; import com.yahoo.vespa.config.server.deploy.TenantFileSystemDirs; @@ -110,7 +109,6 @@ public class SessionRepository { private final Curator curator; private final Executor zkWatcherExecutor; private final FileDistributionFactory fileDistributionFactory; - private final PermanentApplicationPackage permanentApplicationPackage; private final FlagSource flagSource; private final TenantFileSystemDirs tenantFileSystemDirs; private final Metrics metrics; @@ -137,7 +135,6 @@ public class SessionRepository { Metrics metrics, StripedExecutor<TenantName> zkWatcherExecutor, FileDistributionFactory fileDistributionFactory, - PermanentApplicationPackage permanentApplicationPackage, FlagSource flagSource, ExecutorService zkCacheExecutor, SecretStore secretStore, @@ -157,7 +154,6 @@ public class SessionRepository { this.sessionLifetime = Duration.ofSeconds(configserverConfig.sessionLifetime()); this.zkWatcherExecutor = command -> zkWatcherExecutor.execute(tenantName, command); this.fileDistributionFactory = fileDistributionFactory; - this.permanentApplicationPackage = permanentApplicationPackage; this.flagSource = flagSource; this.tenantFileSystemDirs = new TenantFileSystemDirs(configServerDB, tenantName); this.applicationRepo = applicationRepo; @@ -548,7 +544,6 @@ public class SessionRepository { sessionPreparer.getExecutor(), curator, metrics, - permanentApplicationPackage, flagSource, secretStore, hostProvisionerProvider, diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java index e044e19331e..69d13bf2dea 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java @@ -2,9 +2,9 @@ package com.yahoo.vespa.config.server.tenant; import com.google.common.collect.ImmutableSet; -import com.yahoo.component.annotation.Inject; import com.yahoo.cloud.config.ConfigserverConfig; import com.yahoo.cloud.config.ZookeeperServerConfig; +import com.yahoo.component.annotation.Inject; import com.yahoo.concurrent.DaemonThreadFactory; import com.yahoo.concurrent.Lock; import com.yahoo.concurrent.Locks; @@ -18,9 +18,8 @@ import com.yahoo.container.jdisc.secretstore.SecretStore; import com.yahoo.path.Path; import com.yahoo.text.Utf8; import com.yahoo.transaction.Transaction; -import com.yahoo.vespa.config.server.ConfigServerDB; import com.yahoo.vespa.config.server.ConfigActivationListener; -import com.yahoo.vespa.config.server.application.PermanentApplicationPackage; +import com.yahoo.vespa.config.server.ConfigServerDB; import com.yahoo.vespa.config.server.application.TenantApplications; import com.yahoo.vespa.config.server.deploy.TenantFileSystemDirs; import com.yahoo.vespa.config.server.filedistribution.FileDirectory; @@ -41,7 +40,6 @@ import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent; import org.apache.curator.framework.state.ConnectionState; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.data.Stat; - import java.time.Clock; import java.time.Duration; import java.time.Instant; @@ -346,12 +344,10 @@ public class TenantRepository { new TenantFileSystemDirs(configServerDB, tenantName), clock, flagSource); - PermanentApplicationPackage permanentApplicationPackage = new PermanentApplicationPackage(configserverConfig); SessionPreparer sessionPreparer = new SessionPreparer(modelFactoryRegistry, fileDistributionFactory, deployHelperExecutor, hostProvisionerProvider, - permanentApplicationPackage, configserverConfig, configDefinitionRepo, curator, @@ -365,7 +361,6 @@ public class TenantRepository { metrics, zkSessionWatcherExecutor, fileDistributionFactory, - permanentApplicationPackage, flagSource, zkCacheExecutor, secretStore, diff --git a/configserver/src/main/resources/configserver-app/services.xml b/configserver/src/main/resources/configserver-app/services.xml index 077980d9523..713b897f23a 100644 --- a/configserver/src/main/resources/configserver-app/services.xml +++ b/configserver/src/main/resources/configserver-app/services.xml @@ -26,7 +26,6 @@ <component id="com.yahoo.vespa.config.server.deploy.InfraDeployerProvider" bundle="configserver" /> <component id="com.yahoo.vespa.curator.Curator" bundle="configserver" /> <component id="com.yahoo.vespa.config.server.tenant.TenantRepository" bundle="configserver" /> - <component id="com.yahoo.vespa.config.server.application.PermanentApplicationPackage" bundle="configserver" /> <component id="com.yahoo.vespa.config.server.host.HostRegistry" bundle="configserver" /> <component id="com.yahoo.vespa.config.server.ApplicationRepository" bundle="configserver" /> <component id="com.yahoo.vespa.config.server.version.VersionState" bundle="configserver" /> |