Search in sources :

Example 1 with PrepareParams

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

the class ApplicationApiHandler method handlePOST.

@Override
protected HttpResponse handlePOST(HttpRequest request) {
    Tenant tenant = getExistingTenant(request);
    TenantName tenantName = tenant.getName();
    TimeoutBudget timeoutBudget = SessionHandler.getTimeoutBudget(request, zookeeperBarrierTimeout);
    PrepareParams prepareParams = PrepareParams.fromHttpRequest(request, tenantName, zookeeperBarrierTimeout);
    Slime deployLog = createDeployLog();
    DeployLogger logger = SessionCreateHandler.createLogger(request, deployLog, tenantName);
    String name = SessionCreateHandler.getNameProperty(request, logger);
    SessionCreateHandler.validateDataAndHeader(request);
    PrepareResult result = applicationRepository.createSessionAndPrepareAndActivate(tenant, request.getData(), request.getHeader(contentTypeHeader), timeoutBudget, name, prepareParams, shouldIgnoreLockFailure(request), shouldIgnoreSessionStaleFailure(request), Instant.now());
    return new SessionPrepareAndActivateResponse(result, tenantName, request, prepareParams.getApplicationId(), zone);
}
Also used : Tenant(com.yahoo.vespa.config.server.tenant.Tenant) TenantName(com.yahoo.config.provision.TenantName) TimeoutBudget(com.yahoo.vespa.config.server.TimeoutBudget) DeployLogger(com.yahoo.config.application.api.DeployLogger) Slime(com.yahoo.slime.Slime) PrepareParams(com.yahoo.vespa.config.server.session.PrepareParams)

Example 2 with PrepareParams

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

the class SessionPrepareHandler method handlePUT.

@Override
protected HttpResponse handlePUT(HttpRequest request) {
    Tenant tenant = getExistingTenant(request);
    TenantName tenantName = tenant.getName();
    long sessionId = getSessionIdV2(request);
    PrepareParams prepareParams = PrepareParams.fromHttpRequest(request, tenantName, zookeeperBarrierTimeout);
    PrepareResult result = applicationRepository.prepare(tenant, sessionId, prepareParams, Instant.now());
    return new SessionPrepareResponse(result, tenantName, request);
}
Also used : Tenant(com.yahoo.vespa.config.server.tenant.Tenant) TenantName(com.yahoo.config.provision.TenantName) PrepareParams(com.yahoo.vespa.config.server.session.PrepareParams)

Example 3 with PrepareParams

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

the class ApplicationApiHandler method handlePUT.

@Override
protected HttpResponse handlePUT(HttpRequest request) {
    Tenant tenant = getExistingTenant(request);
    TenantName tenantName = tenant.getName();
    long sessionId = getSessionIdV2(request);
    PrepareParams prepareParams = PrepareParams.fromHttpRequest(request, tenantName, zookeeperBarrierTimeout);
    PrepareResult result = applicationRepository.prepareAndActivate(tenant, sessionId, prepareParams, shouldIgnoreLockFailure(request), shouldIgnoreSessionStaleFailure(request), Instant.now());
    return new SessionPrepareAndActivateResponse(result, tenantName, request, prepareParams.getApplicationId(), zone);
}
Also used : Tenant(com.yahoo.vespa.config.server.tenant.Tenant) TenantName(com.yahoo.config.provision.TenantName) PrepareParams(com.yahoo.vespa.config.server.session.PrepareParams)

Aggregations

TenantName (com.yahoo.config.provision.TenantName)3 PrepareParams (com.yahoo.vespa.config.server.session.PrepareParams)3 Tenant (com.yahoo.vespa.config.server.tenant.Tenant)3 DeployLogger (com.yahoo.config.application.api.DeployLogger)1 Slime (com.yahoo.slime.Slime)1 TimeoutBudget (com.yahoo.vespa.config.server.TimeoutBudget)1