Search in sources :

Example 11 with RemoteSession

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

the class TenantRequestHandlerTest method feedAndReloadApp.

private void feedAndReloadApp(File appDir, long sessionId, ApplicationId appId) throws IOException {
    feedApp(appDir, sessionId, appId);
    SessionZooKeeperClient zkc = new SessionZooKeeperClient(curator, Tenants.getSessionsPath(tenant).append(String.valueOf(sessionId)));
    zkc.writeApplicationId(appId);
    RemoteSession session = new RemoteSession(tenant, sessionId, componentRegistry, zkc, Clock.systemUTC());
    server.reloadConfig(session.ensureApplicationLoaded());
}
Also used : RemoteSession(com.yahoo.vespa.config.server.session.RemoteSession) SessionZooKeeperClient(com.yahoo.vespa.config.server.session.SessionZooKeeperClient)

Example 12 with RemoteSession

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

the class TenantRequestHandlerTest method testResolveForAppId.

@Test
public void testResolveForAppId() {
    long id = 1l;
    SessionZooKeeperClient zkc = new SessionZooKeeperClient(curator, configCurator, Tenants.getSessionsPath(tenant).append(String.valueOf(id)), new TestConfigDefinitionRepo(), "", Optional.empty());
    ApplicationId appId = new ApplicationId.Builder().tenant(tenant).applicationName("myapp").instanceName("myinst").build();
    zkc.writeApplicationId(appId);
    RemoteSession session = new RemoteSession(appId.tenant(), id, componentRegistry, zkc, Clock.systemUTC());
    server.reloadConfig(session.ensureApplicationLoaded());
    SimpletypesConfig config = resolve(SimpletypesConfig.class, server, appId, vespaVersion, "");
    assertThat(config.intval(), is(1337));
}
Also used : SimpletypesConfig(com.yahoo.config.SimpletypesConfig) TestConfigDefinitionRepo(com.yahoo.vespa.config.server.TestConfigDefinitionRepo) RemoteSession(com.yahoo.vespa.config.server.session.RemoteSession) ApplicationId(com.yahoo.config.provision.ApplicationId) SessionZooKeeperClient(com.yahoo.vespa.config.server.session.SessionZooKeeperClient) Test(org.junit.Test)

Aggregations

RemoteSession (com.yahoo.vespa.config.server.session.RemoteSession)12 SessionZooKeeperClient (com.yahoo.vespa.config.server.session.SessionZooKeeperClient)5 HttpResponse (com.yahoo.container.jdisc.HttpResponse)3 SessionHandlerTest (com.yahoo.vespa.config.server.http.SessionHandlerTest)3 Test (org.junit.Test)3 ApplicationPackage (com.yahoo.config.application.api.ApplicationPackage)2 NullConfigModelRegistry (com.yahoo.config.model.NullConfigModelRegistry)2 FilesApplicationPackage (com.yahoo.config.model.application.provider.FilesApplicationPackage)2 TestComponentRegistry (com.yahoo.vespa.config.server.TestComponentRegistry)2 TestConfigDefinitionRepo (com.yahoo.vespa.config.server.TestConfigDefinitionRepo)2 HandlerTest (com.yahoo.vespa.config.server.http.HandlerTest)2 ModelFactoryRegistry (com.yahoo.vespa.config.server.modelfactory.ModelFactoryRegistry)2 SessionTest (com.yahoo.vespa.config.server.session.SessionTest)2 VespaModelFactory (com.yahoo.vespa.model.VespaModelFactory)2 Clock (java.time.Clock)2 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)2 SimpletypesConfig (com.yahoo.config.SimpletypesConfig)1 BaseDeployLogger (com.yahoo.config.model.application.provider.BaseDeployLogger)1 MockFileRegistry (com.yahoo.config.model.application.provider.MockFileRegistry)1 ApplicationId (com.yahoo.config.provision.ApplicationId)1