Search in sources :

Example 1 with ApplicationId

use of com.yahoo.config.provision.ApplicationId in project vespa by vespa-engine.

the class DomAdminV4Builder method shouldHaveSlobrok.

private boolean shouldHaveSlobrok(ContainerModel containerModel) {
    // Avoid Slobroks on node-admin container cluster, as node-admin is migrating
    // TODO: Remove this hack once node-admin has migrated out the zone app
    ApplicationId applicationId = context.getDeployState().getProperties().applicationId();
    if (!applicationId.equals(ZONE_APPLICATION_ID)) {
        return true;
    }
    // aka clustername, aka application-model's ClusterId
    String clustername = containerModel.getCluster().getName();
    return !Objects.equals(clustername, "node-admin");
}
Also used : ApplicationId(com.yahoo.config.provision.ApplicationId)

Example 2 with ApplicationId

use of com.yahoo.config.provision.ApplicationId in project vespa by vespa-engine.

the class ApplicationRepository method prepare.

public PrepareResult prepare(Tenant tenant, long sessionId, PrepareParams prepareParams, Instant now) {
    validateThatLocalSessionIsNotActive(tenant, sessionId);
    LocalSession session = getLocalSession(tenant, sessionId);
    ApplicationId applicationId = prepareParams.getApplicationId();
    Optional<ApplicationSet> currentActiveApplicationSet = getCurrentActiveApplicationSet(tenant, applicationId);
    Slime deployLog = createDeployLog();
    DeployLogger logger = new DeployHandlerLogger(deployLog.get().setArray("log"), prepareParams.isVerbose(), applicationId);
    ConfigChangeActions actions = session.prepare(logger, prepareParams, currentActiveApplicationSet, tenant.getPath(), now);
    logConfigChangeActions(actions, logger);
    log.log(LogLevel.INFO, Tenants.logPre(applicationId) + "Session " + sessionId + " prepared successfully. ");
    return new PrepareResult(sessionId, actions, deployLog);
}
Also used : PrepareResult(com.yahoo.vespa.config.server.http.v2.PrepareResult) LocalSession(com.yahoo.vespa.config.server.session.LocalSession) ConfigChangeActions(com.yahoo.vespa.config.server.configchange.ConfigChangeActions) DeployHandlerLogger(com.yahoo.vespa.config.server.deploy.DeployHandlerLogger) DeployLogger(com.yahoo.config.application.api.DeployLogger) SilentDeployLogger(com.yahoo.vespa.config.server.session.SilentDeployLogger) ApplicationId(com.yahoo.config.provision.ApplicationId) ApplicationSet(com.yahoo.vespa.config.server.application.ApplicationSet) Slime(com.yahoo.slime.Slime)

Example 3 with ApplicationId

use of com.yahoo.config.provision.ApplicationId in project vespa by vespa-engine.

the class HttpConfigRequest method createFromRequestV2FullAppId.

// The URL pattern with full app id given
private static HttpConfigRequest createFromRequestV2FullAppId(HttpRequest req, BindingMatch<?> bm) {
    String cId;
    String cName;
    String cNamespace;
    String tenant = bm.group(2);
    String application = bm.group(3);
    String environment = bm.group(4);
    String region = bm.group(5);
    String instance = bm.group(6);
    String conf = bm.group(7);
    if (bm.groupCount() >= 9) {
        cId = bm.group(8);
    } else {
        cId = "";
    }
    Tuple2<String, String> nns = nameAndNamespace(conf);
    cName = nns.first;
    cNamespace = nns.second;
    ApplicationId appId = new ApplicationId.Builder().tenant(tenant).applicationName(application).instanceName(instance).build();
    return new HttpConfigRequest(new ConfigKey<>(cName, cId, cNamespace), appId, req.getBooleanProperty(HTTP_PROPERTY_NOCACHE));
}
Also used : ApplicationId(com.yahoo.config.provision.ApplicationId)

Example 4 with ApplicationId

use of com.yahoo.config.provision.ApplicationId in project vespa by vespa-engine.

the class RpcServer method configActivated.

/**
 * Checks all delayed responses for config changes and waits until all has been answered.
 * This method should be called when config is reloaded in the server.
 */
@Override
public void configActivated(TenantName tenant, ApplicationSet applicationSet) {
    ApplicationId applicationId = applicationSet.getId();
    configReloaded(delayedConfigResponses.drainQueue(applicationId), Tenants.logPre(applicationId));
    reloadSuperModel(tenant, applicationSet);
}
Also used : ApplicationId(com.yahoo.config.provision.ApplicationId)

Example 5 with ApplicationId

use of com.yahoo.config.provision.ApplicationId in project vespa by vespa-engine.

the class RemoteSessionRepo method loadSessionIfActive.

private void loadSessionIfActive(RemoteSession session) {
    for (ApplicationId applicationId : applicationRepo.listApplications()) {
        try {
            if (applicationRepo.getSessionIdForApplication(applicationId) == session.getSessionId()) {
                log.log(LogLevel.DEBUG, "Found active application for session " + session.getSessionId() + " , loading it");
                loadActiveSession(session);
                break;
            }
        } catch (Exception e) {
            log.log(LogLevel.WARNING, session.logPre() + " error reading session id for " + applicationId);
        }
    }
}
Also used : ApplicationId(com.yahoo.config.provision.ApplicationId)

Aggregations

ApplicationId (com.yahoo.config.provision.ApplicationId)173 Test (org.junit.Test)102 Zone (com.yahoo.config.provision.Zone)52 Node (com.yahoo.vespa.hosted.provision.Node)30 ClusterSpec (com.yahoo.config.provision.ClusterSpec)22 TenantName (com.yahoo.config.provision.TenantName)20 Flavor (com.yahoo.config.provision.Flavor)19 List (java.util.List)16 HashSet (java.util.HashSet)15 HostSpec (com.yahoo.config.provision.HostSpec)12 Duration (java.time.Duration)12 HashMap (java.util.HashMap)12 Map (java.util.Map)12 Set (java.util.Set)12 Collectors (java.util.stream.Collectors)12 Version (com.yahoo.component.Version)11 OutOfCapacityException (com.yahoo.config.provision.OutOfCapacityException)11 Slime (com.yahoo.slime.Slime)11 ArrayList (java.util.ArrayList)11 Optional (java.util.Optional)11