Search in sources :

Example 1 with PrepareResult

use of com.yahoo.vespa.config.server.http.v2.PrepareResult 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 2 with PrepareResult

use of com.yahoo.vespa.config.server.http.v2.PrepareResult in project vespa by vespa-engine.

the class ApplicationRepository method prepareAndActivate.

public PrepareResult prepareAndActivate(Tenant tenant, long sessionId, PrepareParams prepareParams, boolean ignoreLockFailure, boolean ignoreSessionStaleFailure, Instant now) {
    PrepareResult result = prepare(tenant, sessionId, prepareParams, now);
    activate(tenant, sessionId, prepareParams.getTimeoutBudget(), ignoreLockFailure, ignoreSessionStaleFailure);
    return result;
}
Also used : PrepareResult(com.yahoo.vespa.config.server.http.v2.PrepareResult)

Example 3 with PrepareResult

use of com.yahoo.vespa.config.server.http.v2.PrepareResult in project vespa by vespa-engine.

the class ApplicationRepositoryTest method createAndPrepareAndActivate.

@Test
public void createAndPrepareAndActivate() throws IOException {
    PrepareResult result = createAndPrepareAndActivateApp();
    assertTrue(result.configChangeActions().getRefeedActions().isEmpty());
    assertTrue(result.configChangeActions().getRestartActions().isEmpty());
}
Also used : PrepareResult(com.yahoo.vespa.config.server.http.v2.PrepareResult) Test(org.junit.Test) SessionHandlerTest(com.yahoo.vespa.config.server.http.SessionHandlerTest) CompressedApplicationInputStreamTest(com.yahoo.vespa.config.server.http.CompressedApplicationInputStreamTest)

Example 4 with PrepareResult

use of com.yahoo.vespa.config.server.http.v2.PrepareResult in project vespa by vespa-engine.

the class ApplicationRepositoryTest method prepareAndActivate.

@Test
public void prepareAndActivate() throws IOException {
    PrepareResult result = prepareAndActivateApp(testApp);
    assertTrue(result.configChangeActions().getRefeedActions().isEmpty());
    assertTrue(result.configChangeActions().getRestartActions().isEmpty());
}
Also used : PrepareResult(com.yahoo.vespa.config.server.http.v2.PrepareResult) Test(org.junit.Test) SessionHandlerTest(com.yahoo.vespa.config.server.http.SessionHandlerTest) CompressedApplicationInputStreamTest(com.yahoo.vespa.config.server.http.CompressedApplicationInputStreamTest)

Example 5 with PrepareResult

use of com.yahoo.vespa.config.server.http.v2.PrepareResult in project vespa by vespa-engine.

the class ApplicationRepositoryTest method prepareAndActivateWithRestart.

@Test
public void prepareAndActivateWithRestart() throws IOException {
    prepareAndActivateApp(testAppJdiscOnly);
    PrepareResult result = prepareAndActivateApp(testApp);
    assertTrue(result.configChangeActions().getRefeedActions().isEmpty());
    assertFalse(result.configChangeActions().getRestartActions().isEmpty());
}
Also used : PrepareResult(com.yahoo.vespa.config.server.http.v2.PrepareResult) Test(org.junit.Test) SessionHandlerTest(com.yahoo.vespa.config.server.http.SessionHandlerTest) CompressedApplicationInputStreamTest(com.yahoo.vespa.config.server.http.CompressedApplicationInputStreamTest)

Aggregations

PrepareResult (com.yahoo.vespa.config.server.http.v2.PrepareResult)5 CompressedApplicationInputStreamTest (com.yahoo.vespa.config.server.http.CompressedApplicationInputStreamTest)3 SessionHandlerTest (com.yahoo.vespa.config.server.http.SessionHandlerTest)3 Test (org.junit.Test)3 DeployLogger (com.yahoo.config.application.api.DeployLogger)1 ApplicationId (com.yahoo.config.provision.ApplicationId)1 Slime (com.yahoo.slime.Slime)1 ApplicationSet (com.yahoo.vespa.config.server.application.ApplicationSet)1 ConfigChangeActions (com.yahoo.vespa.config.server.configchange.ConfigChangeActions)1 DeployHandlerLogger (com.yahoo.vespa.config.server.deploy.DeployHandlerLogger)1 LocalSession (com.yahoo.vespa.config.server.session.LocalSession)1 SilentDeployLogger (com.yahoo.vespa.config.server.session.SilentDeployLogger)1