diff options
author | Harald Musum <musum@oath.com> | 2018-12-10 14:24:44 +0100 |
---|---|---|
committer | Harald Musum <musum@oath.com> | 2018-12-10 14:24:44 +0100 |
commit | 6e83fe1594ffb86693f55e7812ef51215c339a73 (patch) | |
tree | cebc6a6957e5e9ba70173577e444fc2230a1ccbc /configserver | |
parent | bec7ce30bf9263ab2d8b212b935e1514b105a8b5 (diff) |
Simplify. No functional changes
Diffstat (limited to 'configserver')
9 files changed, 67 insertions, 62 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java index 9b40d826fc4..172d9c025d5 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java @@ -38,20 +38,19 @@ public class RemoteSession extends Session { * * @param tenant The name of the tenant creating session * @param sessionId The session id for this session. - * @param globalComponentRegistry a registry of global components + * @param componentRegistry a registry of global components * @param zooKeeperClient a SessionZooKeeperClient instance */ public RemoteSession(TenantName tenant, long sessionId, - GlobalComponentRegistry globalComponentRegistry, - SessionZooKeeperClient zooKeeperClient, - Clock clock) { + GlobalComponentRegistry componentRegistry, + SessionZooKeeperClient zooKeeperClient) { super(tenant, sessionId, zooKeeperClient); - this.applicationLoader = new ActivatedModelsBuilder(tenant, sessionId, zooKeeperClient, globalComponentRegistry); - this.clock = clock; + this.applicationLoader = new ActivatedModelsBuilder(tenant, sessionId, zooKeeperClient, componentRegistry); + this.clock = componentRegistry.getClock(); } - public void loadPrepared() { + void loadPrepared() { Curator.CompletionWaiter waiter = zooKeeperClient.getPrepareWaiter(); ensureApplicationLoaded(); notifyCompletion(waiter); @@ -89,7 +88,7 @@ public class RemoteSession extends Session { return zooKeeperClient.createWriteStatusTransaction(Status.DELETE); } - public void makeActive(ReloadHandler reloadHandler) { + void makeActive(ReloadHandler reloadHandler) { Curator.CompletionWaiter waiter = zooKeeperClient.getActiveWaiter(); log.log(LogLevel.DEBUG, logPre() + "Getting session from repo: " + getSessionId()); ApplicationSet app = ensureApplicationLoaded(); @@ -109,7 +108,7 @@ public class RemoteSession extends Session { return TenantRepository.logPre(getTenant()); } - public void confirmUpload() { + void confirmUpload() { Curator.CompletionWaiter waiter = zooKeeperClient.getUploadWaiter(); log.log(LogLevel.DEBUG, "Notifying upload waiter for session " + getSessionId()); notifyCompletion(waiter); diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSessionFactory.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSessionFactory.java index 44641b79d65..d9265423c7d 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSessionFactory.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSessionFactory.java @@ -10,8 +10,6 @@ import com.yahoo.vespa.config.server.tenant.TenantRepository; import com.yahoo.vespa.config.server.zookeeper.ConfigCurator; import com.yahoo.vespa.curator.Curator; -import java.time.Clock; - /** * @author Ulf Lilleengen */ @@ -24,11 +22,8 @@ public class RemoteSessionFactory { private final ConfigDefinitionRepo defRepo; private final TenantName tenant; private final ConfigserverConfig configserverConfig; - private final Clock clock; - public RemoteSessionFactory(GlobalComponentRegistry componentRegistry, - TenantName tenant, - Clock clock) { + public RemoteSessionFactory(GlobalComponentRegistry componentRegistry, TenantName tenant) { this.componentRegistry = componentRegistry; this.curator = componentRegistry.getCurator(); this.configCurator = componentRegistry.getConfigCurator(); @@ -36,7 +31,6 @@ public class RemoteSessionFactory { this.tenant = tenant; this.defRepo = componentRegistry.getConfigDefinitionRepo(); this.configserverConfig = componentRegistry.getConfigserverConfig(); - this.clock = clock; } public RemoteSession createSession(long sessionId) { @@ -47,7 +41,7 @@ public class RemoteSessionFactory { defRepo, configserverConfig.serverId(), componentRegistry.getZone().nodeFlavors()); - return new RemoteSession(tenant, sessionId, componentRegistry, sessionZKClient, clock); + return new RemoteSession(tenant, sessionId, componentRegistry, sessionZKClient); } } diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantBuilder.java b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantBuilder.java index d157d8383ea..95d58ecd5bb 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantBuilder.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantBuilder.java @@ -15,7 +15,6 @@ import com.yahoo.vespa.config.server.deploy.TenantFileSystemDirs; import com.yahoo.vespa.config.server.monitoring.Metrics; import com.yahoo.vespa.config.server.session.*; -import java.time.Clock; import java.util.Collections; /** @@ -82,7 +81,7 @@ public class TenantBuilder { public Tenant build() { createTenantRequestHandler(); createApplicationRepo(); - createRemoteSessionFactory(componentRegistry.getClock()); + createRemoteSessionFactory(); createRemoteSessionRepo(); createServerDbDirs(); createSessionFactory(); @@ -143,9 +142,9 @@ public class TenantBuilder { } } - private void createRemoteSessionFactory(Clock clock) { + private void createRemoteSessionFactory() { if (remoteSessionFactory == null) { - remoteSessionFactory = new RemoteSessionFactory(componentRegistry, tenant, clock); + remoteSessionFactory = new RemoteSessionFactory(componentRegistry, tenant); } } diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/HostHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/HostHandlerTest.java index 04b187f6b1d..2d3dcc592f7 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/HostHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/HostHandlerTest.java @@ -26,7 +26,6 @@ import org.junit.Test; import java.io.File; import java.io.IOException; -import java.time.Clock; import java.util.Collections; import static org.hamcrest.CoreMatchers.is; @@ -34,7 +33,6 @@ import static org.junit.Assert.assertThat; /** * @author hmusum - * @since 5.4 */ public class HostHandlerTest { private static final String urlPrefix = "http://myhost:14000/application/v2/host/"; @@ -47,14 +45,14 @@ public class HostHandlerTest { private HostRegistries hostRegistries; private HostHandler hostHandler; - static void addMockApplication(Tenant tenant, ApplicationId applicationId, long sessionId, Clock clock) { + static void addMockApplication(Tenant tenant, ApplicationId applicationId, long sessionId) { tenant.getApplicationRepo().createPutApplicationTransaction(applicationId, sessionId).commit(); ApplicationPackage app = FilesApplicationPackage.fromFile(testApp); tenant.getLocalSessionRepo().addSession(new SessionHandlerTest.MockSession(sessionId, app, applicationId)); TestComponentRegistry componentRegistry = new TestComponentRegistry.Builder() .modelFactoryRegistry(new ModelFactoryRegistry(Collections.singletonList(new VespaModelFactory(new NullConfigModelRegistry())))) .build(); - tenant.getRemoteSessionRepo().addSession(new RemoteSession(tenant.getName(), sessionId, componentRegistry, new MockSessionZKClient(app), clock)); + tenant.getRemoteSessionRepo().addSession(new RemoteSession(tenant.getName(), sessionId, componentRegistry, new MockSessionZKClient(app))); } @Before @@ -84,14 +82,14 @@ public class HostHandlerTest { assertThat(hostRegistries, is(hostHandler.hostRegistries)); long sessionId = 1; ApplicationId id = ApplicationId.from(mytenant, ApplicationName.defaultName(), InstanceName.defaultName()); - addMockApplication(tenantRepository.getTenant(mytenant), id, sessionId, Clock.systemUTC()); + addMockApplication(tenantRepository.getTenant(mytenant), id, sessionId); assertApplicationForHost(hostname, mytenant, id, Zone.defaultZone()); } @Test public void require_that_handler_gives_error_for_unknown_hostname() throws Exception { long sessionId = 1; - addMockApplication(tenantRepository.getTenant(mytenant), ApplicationId.defaultId(), sessionId, Clock.systemUTC()); + addMockApplication(tenantRepository.getTenant(mytenant), ApplicationId.defaultId(), sessionId); final String hostname = "unknown"; assertErrorForHost(hostname, Response.Status.NOT_FOUND, diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionActiveHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionActiveHandlerTest.java index 8572854b462..d606b898496 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionActiveHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionActiveHandlerTest.java @@ -213,13 +213,13 @@ public class SessionActiveHandlerTest extends SessionHandlerTest { assertFalse(hostProvisioner.activated); } - private RemoteSession createRemoteSession(long sessionId, Session.Status status, SessionZooKeeperClient zkClient, Clock clock) throws IOException { + private RemoteSession createRemoteSession(long sessionId, Session.Status status, SessionZooKeeperClient zkClient) throws IOException { zkClient.writeStatus(status); ZooKeeperClient zkC = new ZooKeeperClient(componentRegistry.getConfigCurator(), new BaseDeployLogger(), false, TenantRepository.getSessionsPath(tenantName).append(String.valueOf(sessionId))); zkC.write(Collections.singletonMap(modelFactory.version(), new MockFileRegistry())); zkC.write(AllocatedHosts.withHosts(Collections.emptySet())); - RemoteSession session = new RemoteSession(tenantName, sessionId, componentRegistry, zkClient, clock); + RemoteSession session = new RemoteSession(tenantName, sessionId, componentRegistry, zkClient); remoteSessionRepo.addSession(session); return session; } @@ -318,7 +318,7 @@ public class SessionActiveHandlerTest extends SessionHandlerTest { SessionZooKeeperClient zkClient = new MockSessionZKClient(curator, tenantName, sessionId, Optional.of(AllocatedHosts.withHosts(Collections.singleton(new HostSpec("bar", Collections.emptyList()))))); - session = createRemoteSession(sessionId, initialStatus, zkClient, clock); + session = createRemoteSession(sessionId, initialStatus, zkClient); addLocalSession(sessionId, deployData, zkClient); metaData = localRepo.getSession(sessionId).getMetaData(); actResponse = handler.handle(SessionHandlerTest.createTestRequest(pathPrefix, HttpRequest.Method.PUT, Cmd.ACTIVE, sessionId, subPath)); diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionPrepareHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionPrepareHandlerTest.java index e8b20217a76..64beacfc12a 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionPrepareHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionPrepareHandlerTest.java @@ -161,8 +161,7 @@ public class SessionPrepareHandlerTest extends SessionHandlerTest { if (ls.getStatus()!=null) zooKeeperClient.writeStatus(ls.getStatus()); RemoteSession remSess = new RemoteSession(tenant, ls.getSessionId(), new TestComponentRegistry.Builder().curator(curator).build(), - zooKeeperClient, - clock); + zooKeeperClient); remoteSessionRepo.addSession(remSess); } return zooKeeperClient; diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/TenantHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/TenantHandlerTest.java index a4117ee7b51..6effa3359b1 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/TenantHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/TenantHandlerTest.java @@ -112,7 +112,7 @@ public class TenantHandlerTest { int sessionId = 1; ApplicationId app = ApplicationId.from(a, ApplicationName.from("foo"), InstanceName.defaultName()); - HostHandlerTest.addMockApplication(tenant, app, sessionId, Clock.systemUTC()); + HostHandlerTest.addMockApplication(tenant, app, sessionId); try { handler.handleDELETE(HttpRequest.createTestRequest("http://deploy.example.yahoo.com:80/application/v2/tenant/" + a, Method.DELETE)); diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/session/RemoteSessionTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/session/RemoteSessionTest.java index 6050b7818c2..a7b74e69a21 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/session/RemoteSessionTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/session/RemoteSessionTest.java @@ -66,7 +66,7 @@ public class RemoteSessionTest { @Test public void require_that_applications_are_loaded() { - RemoteSession session = createSession(3, Arrays.asList(new MockModelFactory(), new VespaModelFactory(new NullConfigModelRegistry())), Clock.systemUTC()); + RemoteSession session = createSession(3, Arrays.asList(new MockModelFactory(), new VespaModelFactory(new NullConfigModelRegistry()))); session.loadPrepared(); ApplicationSet applicationSet = session.ensureApplicationLoaded(); assertNotNull(applicationSet); @@ -92,7 +92,7 @@ public class RemoteSessionTest { okFactory.vespaVersion = new Version(1, 1, 0); okFactory.throwOnLoad = false; - RemoteSession session = createSession(3, Arrays.asList(okFactory, failingFactory), failingFactory.clock()); + RemoteSession session = createSession(3, Arrays.asList(okFactory, failingFactory)); session.loadPrepared(); } @@ -110,7 +110,7 @@ public class RemoteSessionTest { failingFactory.vespaVersion = new Version(2, 0, 0); failingFactory.throwOnLoad = true; - RemoteSession session = createSession(3, Arrays.asList(okFactory1, failingFactory, okFactory2), failingFactory.clock()); + RemoteSession session = createSession(3, Arrays.asList(okFactory1, failingFactory, okFactory2)); session.loadPrepared(); } @@ -125,7 +125,7 @@ public class RemoteSessionTest { okFactory.vespaVersion = new Version(1, 2, 0); okFactory.throwOnLoad = false; - RemoteSession session = createSession(3, Arrays.asList(okFactory, failingFactory), failingFactory.clock()); + RemoteSession session = createSession(3, Arrays.asList(okFactory, failingFactory)); session.loadPrepared(); } @@ -160,7 +160,7 @@ public class RemoteSessionTest { tooNewFactory.vespaVersion = new Version(2, 0, 0); tooNewFactory.throwOnLoad = true; - RemoteSession session = createSession(3, Arrays.asList(tooNewFactory, okFactory, failingFactory), failingFactory.clock()); + RemoteSession session = createSession(3, Arrays.asList(tooNewFactory, okFactory, failingFactory)); session.loadPrepared(); } @@ -182,7 +182,7 @@ public class RemoteSessionTest { okFactory.throwErrorOnLoad = false; SessionZooKeeperClient zkc = new MockSessionZKClient(curator, tenantName, 3, application); - RemoteSession session = createSession(3, zkc, Arrays.asList(okFactory, failingFactory), failingFactory.clock()); + RemoteSession session = createSession(3, zkc, Arrays.asList(okFactory, failingFactory)); session.loadPrepared(); // Does not cause an error because model version 3 is skipped @@ -206,7 +206,7 @@ public class RemoteSessionTest { okFactory.throwErrorOnLoad = false; SessionZooKeeperClient zkc = new MockSessionZKClient(curator, tenantName, 3, application); - RemoteSession session = createSession(4, zkc, Arrays.asList(okFactory, failingFactory), failingFactory.clock()); + RemoteSession session = createSession(4, zkc, Arrays.asList(okFactory, failingFactory)); session.loadPrepared(); // Does not cause an error because model version 4 is skipped @@ -229,7 +229,7 @@ public class RemoteSessionTest { try { int sessionId = 3; SessionZooKeeperClient zkc = new MockSessionZKClient(curator, tenantName, sessionId); - createSession(sessionId, zkc, Collections.singletonList(mockModelFactory), permanentApp, mockModelFactory.clock()).ensureApplicationLoaded(); + createSession(sessionId, zkc, Collections.singletonList(mockModelFactory), permanentApp, Clock.systemUTC()).ensureApplicationLoaded(); } catch (Exception e) { e.printStackTrace(); // ignore, we're not interested in deploy errors as long as the below state is OK. @@ -238,36 +238,51 @@ public class RemoteSessionTest { assertTrue(mockModelFactory.modelContext.permanentApplicationPackage().isPresent()); } + private RemoteSession createSession(long sessionId) { + return createSession(sessionId, Collections.singletonList(new VespaModelFactory(new NullConfigModelRegistry())), Clock.systemUTC()); + } + private RemoteSession createSession(long sessionId, Clock clock) { return createSession(sessionId, Collections.singletonList(new VespaModelFactory(new NullConfigModelRegistry())), clock); } + private RemoteSession createSession(long sessionId, SessionZooKeeperClient zkc, Clock clock) { return createSession(sessionId, zkc, Collections.singletonList(new VespaModelFactory(new NullConfigModelRegistry())), clock); } + + private RemoteSession createSession(long sessionId, List<ModelFactory> modelFactories) { + SessionZooKeeperClient zkc = new MockSessionZKClient(curator, tenantName, sessionId); + return createSession(sessionId, zkc, modelFactories, Clock.systemUTC()); + } + private RemoteSession createSession(long sessionId, List<ModelFactory> modelFactories, Clock clock) { SessionZooKeeperClient zkc = new MockSessionZKClient(curator, tenantName, sessionId); return createSession(sessionId, zkc, modelFactories, clock); } + private RemoteSession createSession(long sessionId, SessionZooKeeperClient zkc, List<ModelFactory> modelFactories) { + return createSession(sessionId, zkc, modelFactories, Optional.empty(), Clock.systemUTC()); + } + private RemoteSession createSession(long sessionId, SessionZooKeeperClient zkc, List<ModelFactory> modelFactories, Clock clock) { return createSession(sessionId, zkc, modelFactories, Optional.empty(), clock); } - private RemoteSession createSession(long sessionId, SessionZooKeeperClient zkc, List<ModelFactory> modelFactories, - Optional<PermanentApplicationPackage> permanentApplicationPackage, Clock clock) { + private RemoteSession createSession(long sessionId, SessionZooKeeperClient zkc, + List<ModelFactory> modelFactories, + Optional<PermanentApplicationPackage> permanentApplicationPackage, + Clock clock) { zkc.writeStatus(Session.Status.NEW); zkc.writeApplicationId(new ApplicationId.Builder().applicationName("foo").instanceName("bim").build()); TestComponentRegistry.Builder registryBuilder = new TestComponentRegistry.Builder() .curator(curator) + .clock(clock) .modelFactoryRegistry(new ModelFactoryRegistry(modelFactories)); if (permanentApplicationPackage.isPresent()) registryBuilder.permanentApplicationPackage(permanentApplicationPackage.get()); - return new RemoteSession(tenantName, sessionId, - registryBuilder.build(), - zkc, - clock); + return new RemoteSession(tenantName, sessionId, registryBuilder.build(), zkc); } private class MockModelFactory implements ModelFactory { diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantRequestHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantRequestHandlerTest.java index fab67b25610..5f18046cb81 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantRequestHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantRequestHandlerTest.java @@ -48,7 +48,6 @@ import org.xml.sax.SAXException; import java.io.File; import java.io.IOException; -import java.time.Clock; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; @@ -85,7 +84,10 @@ public class TenantRequestHandlerTest { List<ReloadListener> listeners = new ArrayList<>(); listeners.add(listener); server = new TenantRequestHandler(sh, tenant, listeners, new UncompressedConfigResponseFactory(), new HostRegistries()); - componentRegistry = new TestComponentRegistry.Builder().curator(curator).modelFactoryRegistry(createRegistry()).build(); + componentRegistry = new TestComponentRegistry.Builder() + .curator(curator) + .modelFactoryRegistry(createRegistry()) + .build(); } private void feedApp(File appDir, long sessionId, ApplicationId appId, boolean internalRedeploy) throws IOException { @@ -107,14 +109,14 @@ public class TenantRequestHandlerTest { AllocatedHosts.withHosts(Collections.emptySet())); } - private ApplicationSet reloadConfig(long sessionId, Clock clock) { - return reloadConfig(sessionId, "default", clock); + private ApplicationSet reloadConfig(long sessionId) { + return reloadConfig(sessionId, "default"); } - private ApplicationSet reloadConfig(long sessionId, String application, Clock clock) { + private ApplicationSet reloadConfig(long sessionId, String application) { SessionZooKeeperClient zkc = new SessionZooKeeperClient(curator, TenantRepository.getSessionsPath(tenant).append(String.valueOf(sessionId))); zkc.writeApplicationId(new ApplicationId.Builder().tenant(tenant).applicationName(application).build()); - RemoteSession session = new RemoteSession(tenant, sessionId, componentRegistry, zkc, clock); + RemoteSession session = new RemoteSession(tenant, sessionId, componentRegistry, zkc); return session.ensureApplicationLoaded(); } @@ -162,17 +164,16 @@ public class TenantRequestHandlerTest { @Test public void testReloadConfig() throws IOException { - Clock clock = Clock.systemUTC(); ApplicationId applicationId = new ApplicationId.Builder().applicationName(ApplicationName.defaultName()).tenant(tenant).build(); - server.reloadConfig(reloadConfig(1, clock)); + server.reloadConfig(reloadConfig(1)); assertThat(listener.reloaded.get(), is(1)); // Using only payload list for this simple test SimpletypesConfig config = resolve(SimpletypesConfig.class, server, defaultApp(), vespaVersion, ""); assertThat(config.intval(), is(1337)); assertThat(server.getApplicationGeneration(applicationId, Optional.of(vespaVersion)), is(1l)); - server.reloadConfig(reloadConfig(1L, clock)); + server.reloadConfig(reloadConfig(1L)); ConfigResponse configResponse = getConfigResponse(SimpletypesConfig.class, server, defaultApp(), vespaVersion, ""); assertFalse(configResponse.isInternalRedeploy()); config = resolve(SimpletypesConfig.class, server, defaultApp(), vespaVersion, ""); @@ -184,7 +185,7 @@ public class TenantRequestHandlerTest { listener.reloaded.set(0); feedApp(app2, 2, defaultApp(), true); - server.reloadConfig(reloadConfig(2L, clock)); + server.reloadConfig(reloadConfig(2L)); configResponse = getConfigResponse(SimpletypesConfig.class, server, defaultApp(), vespaVersion, ""); assertTrue(configResponse.isInternalRedeploy()); config = resolve(SimpletypesConfig.class, server, defaultApp(), vespaVersion,""); @@ -195,7 +196,7 @@ public class TenantRequestHandlerTest { @Test public void testRemoveApplication() { - server.reloadConfig(reloadConfig(1, Clock.systemUTC())); + server.reloadConfig(reloadConfig(1)); assertThat(listener.removed.get(), is(0)); server.removeApplication(new ApplicationId.Builder().applicationName(ApplicationName.defaultName()).tenant(tenant).build()); assertThat(listener.removed.get(), is(1)); @@ -209,7 +210,7 @@ public class TenantRequestHandlerTest { .tenant(tenant) .applicationName("myapp").instanceName("myinst").build(); zkc.writeApplicationId(appId); - RemoteSession session = new RemoteSession(appId.tenant(), id, componentRegistry, zkc, Clock.systemUTC()); + RemoteSession session = new RemoteSession(appId.tenant(), id, componentRegistry, zkc); server.reloadConfig(session.ensureApplicationLoaded()); SimpletypesConfig config = resolve(SimpletypesConfig.class, server, appId, vespaVersion, ""); assertThat(config.intval(), is(1337)); @@ -248,7 +249,7 @@ public class TenantRequestHandlerTest { feedApp(appDir, sessionId, appId, false); SessionZooKeeperClient zkc = new SessionZooKeeperClient(curator, TenantRepository.getSessionsPath(tenant).append(String.valueOf(sessionId))); zkc.writeApplicationId(appId); - RemoteSession session = new RemoteSession(tenant, sessionId, componentRegistry, zkc, Clock.systemUTC()); + RemoteSession session = new RemoteSession(tenant, sessionId, componentRegistry, zkc); server.reloadConfig(session.ensureApplicationLoaded()); } @@ -280,7 +281,7 @@ public class TenantRequestHandlerTest { @Test public void testHasApplication() { assertdefaultAppNotFound(); - server.reloadConfig(reloadConfig(1l, Clock.systemUTC())); + server.reloadConfig(reloadConfig(1)); assertTrue(server.hasApplication(new ApplicationId.Builder().applicationName(ApplicationName.defaultName()).tenant(tenant).build(), Optional.of(vespaVersion))); } @@ -292,7 +293,7 @@ public class TenantRequestHandlerTest { @Test public void testMultipleApplicationsReload() { assertdefaultAppNotFound(); - server.reloadConfig(reloadConfig(1l, "foo", Clock.systemUTC())); + server.reloadConfig(reloadConfig(1, "foo")); assertdefaultAppNotFound(); assertTrue(server.hasApplication(new ApplicationId.Builder().tenant(tenant).applicationName("foo").build(), Optional.of(vespaVersion))); |