Search in sources :

Example 6 with TimeoutBudget

use of com.yahoo.vespa.config.server.TimeoutBudget in project vespa by vespa-engine.

the class SessionActiveHandler method handlePUT.

@Override
protected HttpResponse handlePUT(HttpRequest request) {
    final TenantName tenantName = Utils.getTenantNameFromSessionRequest(request);
    Utils.checkThatTenantExists(tenants, tenantName);
    Tenant tenant = tenants.getTenant(tenantName);
    TimeoutBudget timeoutBudget = getTimeoutBudget(request, DEFAULT_ACTIVATE_TIMEOUT);
    final Long sessionId = getSessionIdV2(request);
    ApplicationId applicationId = applicationRepository.activate(tenant, sessionId, timeoutBudget, shouldIgnoreLockFailure(request), shouldIgnoreSessionStaleFailure(request));
    ApplicationMetaData metaData = applicationRepository.getMetadataFromSession(tenant, sessionId);
    return new SessionActiveResponse(metaData.getSlime(), request, applicationId, sessionId, zone);
}
Also used : ApplicationMetaData(com.yahoo.config.application.api.ApplicationMetaData) Tenant(com.yahoo.vespa.config.server.tenant.Tenant) TenantName(com.yahoo.config.provision.TenantName) TimeoutBudget(com.yahoo.vespa.config.server.TimeoutBudget) ApplicationId(com.yahoo.config.provision.ApplicationId)

Example 7 with TimeoutBudget

use of com.yahoo.vespa.config.server.TimeoutBudget in project vespa by vespa-engine.

the class DeployTester method deployApp.

/**
 * Do the initial "deploy" with the existing API-less code as the deploy API doesn't support first deploys yet.
 */
public ApplicationId deployApp(String appName, String vespaVersion, Instant now) {
    Tenant tenant = tenant();
    TimeoutBudget timeoutBudget = new TimeoutBudget(clock, Duration.ofSeconds(60));
    ApplicationId id = ApplicationId.from(tenant.getName(), ApplicationName.from(appName), InstanceName.defaultName());
    PrepareParams.Builder paramsBuilder = new PrepareParams.Builder().applicationId(id);
    if (vespaVersion != null)
        paramsBuilder.vespaVersion(vespaVersion);
    long sessionId = applicationRepository.createSession(tenant, timeoutBudget, testApp, appName);
    applicationRepository.prepare(tenant, sessionId, paramsBuilder.build(), now);
    applicationRepository.activate(tenant, sessionId, timeoutBudget, false, false);
    this.id = id;
    return id;
}
Also used : Tenant(com.yahoo.vespa.config.server.tenant.Tenant) TimeoutBudget(com.yahoo.vespa.config.server.TimeoutBudget) ApplicationId(com.yahoo.config.provision.ApplicationId) PrepareParams(com.yahoo.vespa.config.server.session.PrepareParams)

Aggregations

TimeoutBudget (com.yahoo.vespa.config.server.TimeoutBudget)7 Tenant (com.yahoo.vespa.config.server.tenant.Tenant)4 ApplicationId (com.yahoo.config.provision.ApplicationId)3 TenantName (com.yahoo.config.provision.TenantName)3 DeployLogger (com.yahoo.config.application.api.DeployLogger)2 Slime (com.yahoo.slime.Slime)2 PrepareParams (com.yahoo.vespa.config.server.session.PrepareParams)2 ApplicationMetaData (com.yahoo.config.application.api.ApplicationMetaData)1 NestedTransaction (com.yahoo.transaction.NestedTransaction)1 ActivationConflictException (com.yahoo.vespa.config.server.ActivationConflictException)1 NotFoundException (com.yahoo.vespa.config.server.NotFoundException)1 InternalServerException (com.yahoo.vespa.config.server.http.InternalServerException)1 ActivateLock (com.yahoo.vespa.config.server.tenant.ActivateLock)1