use of com.yahoo.vespa.config.server.deploy.Deployment in project vespa by vespa-engine.
the class ApplicationRepository method activate.
public ApplicationId activate(Tenant tenant, long sessionId, TimeoutBudget timeoutBudget, boolean ignoreLockFailure, boolean ignoreSessionStaleFailure) {
LocalSession localSession = getLocalSession(tenant, sessionId);
Deployment deployment = deployFromPreparedSession(localSession, tenant, timeoutBudget.timeLeft());
deployment.setIgnoreLockFailure(ignoreLockFailure);
deployment.setIgnoreSessionStaleFailure(ignoreSessionStaleFailure);
deployment.activate();
return localSession.getApplicationId();
}
use of com.yahoo.vespa.config.server.deploy.Deployment in project vespa by vespa-engine.
the class ApplicationRepository method redeployAllApplications.
void redeployAllApplications() throws InterruptedException {
ExecutorService executor = Executors.newFixedThreadPool(configserverConfig.numParallelTenantLoaders(), new DaemonThreadFactory("redeploy apps"));
// Keep track of deployment per application
Map<ApplicationId, Future<?>> futures = new HashMap<>();
tenants.getAllTenants().forEach(tenant -> listApplicationIds(tenant).forEach(appId -> deployFromLocalActive(appId).ifPresent(deployment -> futures.put(appId, executor.submit(deployment::activate)))));
for (Map.Entry<ApplicationId, Future<?>> f : futures.entrySet()) {
try {
f.getValue().get();
} catch (ExecutionException e) {
throw new RuntimeException("Redeploying of " + f.getKey() + " failed", e);
}
}
executor.shutdown();
// Timeout should never happen
executor.awaitTermination(365, TimeUnit.DAYS);
}
Aggregations