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");
}
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);
}
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));
}
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);
}
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);
}
}
}
Aggregations