com.yahoo.vespa.hosted.provision.maintenance.InfrastructureProvisioner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of node-repository Show documentation
Show all versions of node-repository Show documentation
Keeps track of node assignment in a multi-application setup.
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.provision.maintenance;
import com.yahoo.config.provision.InfraDeployer;
import com.yahoo.log.LogLevel;
import com.yahoo.vespa.hosted.provision.NodeRepository;
import java.time.Duration;
import java.util.logging.Logger;
/**
* Periodically deploys infrastructure applications.
* TODO: Merge this with {@link PeriodicApplicationMaintainer}
*
* @author freva
*/
public class InfrastructureProvisioner extends Maintainer {
private static final Logger logger = Logger.getLogger(InfrastructureProvisioner.class.getName());
private final InfraDeployer infraDeployer;
InfrastructureProvisioner(NodeRepository nodeRepository, InfraDeployer infraDeployer, Duration interval) {
super(nodeRepository, interval);
this.infraDeployer = infraDeployer;
}
@Override
protected void maintain() {
infraDeployer.getSupportedInfraDeployments().forEach((application, deployment) -> {
try {
deployment.activate();
} catch (RuntimeException e) {
logger.log(LogLevel.INFO, "Failed to activate " + application, e);
// loop around to activate the next application
}
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy