summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorJon Bratseth <jonbratseth@yahoo.com>2016-10-05 22:15:17 +0200
committerGitHub <noreply@github.com>2016-10-05 22:15:17 +0200
commitbcb85e6bc5076b1425011d331f3d1524cd282edb (patch)
tree91a519dc24aae632df3ccc4e4d4968b1214ed9cb /configserver
parentf6f8b776b5d6a4bda2376e5148114a60f33c87bd (diff)
parent64c6bc96db24ffcf52e6a779768a02513a7cbc1b (diff)
Merge pull request #801 from yahoo/hmusum/http-handlers-refactoring-part-2
Move more stuff from http layer into ApplicationRepository
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java71
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/application/LogServerLogGrabber.java36
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationContentRequest.java4
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java55
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java19
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationContentHandlerTest.java8
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandlerTest.java12
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionActiveHandlerTest.java7
8 files changed, 120 insertions, 92 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
index 9c742bc29f9..a5852d1dd8a 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
@@ -6,13 +6,23 @@ import com.yahoo.cloud.config.ConfigserverConfig;
import com.yahoo.config.application.api.DeployLogger;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.Provisioner;
+import com.yahoo.config.provision.Zone;
+import com.yahoo.container.jdisc.HttpRequest;
+import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.log.LogLevel;
import com.yahoo.transaction.NestedTransaction;
+import com.yahoo.vespa.config.server.application.Application;
+import com.yahoo.vespa.config.server.application.ApplicationConvergenceChecker;
+import com.yahoo.vespa.config.server.application.LogServerLogGrabber;
import com.yahoo.vespa.config.server.application.TenantApplications;
import com.yahoo.vespa.config.server.deploy.Deployment;
+import com.yahoo.vespa.config.server.http.ContentHandler;
+import com.yahoo.vespa.config.server.http.SessionHandler;
+import com.yahoo.vespa.config.server.http.v2.ApplicationContentRequest;
import com.yahoo.vespa.config.server.provision.HostProvisionerProvider;
import com.yahoo.vespa.config.server.session.LocalSession;
import com.yahoo.vespa.config.server.session.LocalSessionRepo;
+import com.yahoo.vespa.config.server.session.RemoteSession;
import com.yahoo.vespa.config.server.session.SilentDeployLogger;
import com.yahoo.vespa.config.server.tenant.ActivateLock;
import com.yahoo.vespa.config.server.tenant.Rotations;
@@ -20,6 +30,8 @@ import com.yahoo.vespa.config.server.tenant.Tenant;
import com.yahoo.vespa.config.server.tenant.Tenants;
import com.yahoo.vespa.curator.Curator;
+import java.io.IOException;
+import java.net.URI;
import java.time.Clock;
import java.time.Duration;
import java.util.Optional;
@@ -35,20 +47,29 @@ import java.util.logging.Logger;
public class ApplicationRepository implements com.yahoo.config.provision.Deployer {
private static final Logger log = Logger.getLogger(ApplicationRepository.class.getName());
-
+
private final Tenants tenants;
private final Optional<Provisioner> hostProvisioner;
private final ConfigserverConfig configserverConfig;
private final Curator curator;
+ private final LogServerLogGrabber logServerLogGrabber;
+ private final ApplicationConvergenceChecker convergeChecker;
+ private final ContentHandler contentHandler = new ContentHandler();
private final Clock clock;
private final DeployLogger logger = new SilentDeployLogger();
- public ApplicationRepository(Tenants tenants, HostProvisionerProvider hostProvisionerProvider,
- ConfigserverConfig configserverConfig, Curator curator) {
+ public ApplicationRepository(Tenants tenants,
+ HostProvisionerProvider hostProvisionerProvider,
+ ConfigserverConfig configserverConfig,
+ Curator curator,
+ LogServerLogGrabber logServerLogGrabber,
+ ApplicationConvergenceChecker applicationConvergenceChecker) {
this.tenants = tenants;
this.hostProvisioner = hostProvisionerProvider.getHostProvisioner();
this.configserverConfig = configserverConfig;
this.curator = curator;
+ this.logServerLogGrabber = logServerLogGrabber;
+ this.convergeChecker = applicationConvergenceChecker;
this.clock = Clock.systemUTC();
}
@@ -75,7 +96,7 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
configserverConfig,
hostProvisioner,
new ActivateLock(curator, tenant.getPath()),
- timeout,
+ timeout,
clock,
/* already deployed, validate: */ false));
}
@@ -88,9 +109,9 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
timeout, clock);
}
- /**
+ /**
* Removes a previously deployed application
- *
+ *
* @return true if the application was found and removed, false if it was not present
* @throws RuntimeException if the remove transaction fails. This method is exception safe.
*/
@@ -100,7 +121,7 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
TenantApplications tenantApplications = owner.get().getApplicationRepo();
if ( ! tenantApplications.listApplications().contains(applicationId)) return false;
-
+
// TODO: Push lookup logic down
long sessionId = tenantApplications.getSessionIdForApplication(applicationId);
LocalSessionRepo localSessionRepo = owner.get().getLocalSessionRepo();
@@ -123,4 +144,40 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
return true;
}
+ public String grabLog(Tenant tenant, ApplicationId applicationId) {
+ Application application = getApplication(tenant, applicationId);
+ return logServerLogGrabber.grabLog(application);
+ }
+
+ public HttpResponse nodeConvergenceCheck(Tenant tenant, ApplicationId applicationId, String hostname, URI uri) {
+ Application application = getApplication(tenant, applicationId);
+ return convergeChecker.nodeConvergenceCheck(application, hostname, uri);
+ }
+
+ public void waitForConfigConverged(Tenant tenant, ApplicationId applicationId, TimeoutBudget timeoutBudget) throws IOException {
+ Application application = getApplication(tenant, applicationId);
+ convergeChecker.waitForConfigConverged(application, timeoutBudget);
+ }
+
+ public HttpResponse listConfigConvergence(Tenant tenant, ApplicationId applicationId, URI uri) {
+ Application application = getApplication(tenant, applicationId);
+ return convergeChecker.listConfigConvergence(application, uri);
+ }
+
+ public Long getApplicationGeneration(Tenant tenant, ApplicationId applicationId) {
+ return getApplication(tenant, applicationId).getApplicationGeneration();
+ }
+
+ public HttpResponse getContent(Tenant tenant, ApplicationId applicationId, Zone zone, HttpRequest request) {
+ LocalSession session = SessionHandler.getSessionFromRequest(tenant.getLocalSessionRepo(),
+ tenant.getApplicationRepo().getSessionIdForApplication(applicationId));
+ return contentHandler.get(ApplicationContentRequest.create(request, session, applicationId, zone));
+ }
+
+ private Application getApplication(Tenant tenant, ApplicationId applicationId) {
+ long sessionId = tenant.getApplicationRepo().getSessionIdForApplication(applicationId);
+ RemoteSession session = tenant.getRemoteSessionRepo().getSession(sessionId, 0);
+ return session.ensureApplicationLoaded().getForVersionOrLatest(Optional.empty());
+ }
+
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/application/LogServerLogGrabber.java b/configserver/src/main/java/com/yahoo/vespa/config/server/application/LogServerLogGrabber.java
index 2ce95e016f4..fdec3939f2f 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/application/LogServerLogGrabber.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/application/LogServerLogGrabber.java
@@ -4,19 +4,14 @@ package com.yahoo.vespa.config.server.application;
import com.yahoo.cloud.config.ModelConfig;
import com.yahoo.component.AbstractComponent;
import com.google.inject.Inject;
-import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.log.LogLevel;
-import com.yahoo.vespa.config.server.http.HttpConfigResponse;
-import com.yahoo.vespa.config.server.http.HttpErrorResponse;
+import com.yahoo.vespa.config.server.http.InternalServerException;
import com.yahoo.yolean.Exceptions;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.PrintWriter;
import java.net.Socket;
-import java.nio.charset.StandardCharsets;
import java.util.Optional;
/**
@@ -28,7 +23,6 @@ import java.util.Optional;
public class LogServerLogGrabber extends AbstractComponent {
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LogServerLogGrabber.class.getName());
- @Inject
public LogServerLogGrabber() {}
private Optional<Integer> getErrorLogPort(ModelConfig.Hosts.Services service) {
@@ -43,7 +37,7 @@ public class LogServerLogGrabber extends AbstractComponent {
int port;
}
- public HttpResponse grabLog(Application application) {
+ public String grabLog(Application application) {
final ModelConfig config;
try {
@@ -61,7 +55,7 @@ public class LogServerLogGrabber extends AbstractComponent {
Optional<Integer> logPort = getErrorLogPort(logService);
if (logPort.isPresent()) {
if (logServerConnectionInfo.hostName != null) {
- throw new RuntimeException("Found several log server ports.");
+ throw new RuntimeException("Found several log server ports");
}
logServerConnectionInfo.hostName = host.name();
logServerConnectionInfo.port = logPort.get();
@@ -69,14 +63,7 @@ public class LogServerLogGrabber extends AbstractComponent {
}));
if (logServerConnectionInfo.hostName == null) {
- return new HttpResponse(503) {
- @Override
- public void render(OutputStream outputStream) throws IOException {
- PrintWriter printWriter = new PrintWriter(outputStream);
- printWriter.print("Did not find any log server in config model.");
- printWriter.close();
- }
- };
+ throw new InternalServerException("Did not find any log server in config model");
}
log.log(LogLevel.DEBUG, "Requested error logs, pulling from logserver on " + logServerConnectionInfo.hostName + " "
+ logServerConnectionInfo.port);
@@ -85,20 +72,9 @@ public class LogServerLogGrabber extends AbstractComponent {
response = readLog(logServerConnectionInfo.hostName, logServerConnectionInfo.port);
log.log(LogLevel.DEBUG, "Requested error logs was " + response.length() + " characters");
} catch (IOException e) {
- return HttpErrorResponse.internalServerError(Exceptions.toMessageString(e));
+ throw new InternalServerException(Exceptions.toMessageString(e));
}
-
- return new HttpResponse(200) {
- @Override
- public void render(OutputStream outputStream) throws IOException {
- outputStream.write(response.getBytes(StandardCharsets.UTF_8));
- }
-
- @Override
- public String getContentType() {
- return HttpConfigResponse.JSON_CONTENT_TYPE;
- }
- };
+ return response;
}
private String readLog(String host, int port) throws IOException {
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationContentRequest.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationContentRequest.java
index ba7eff7c461..2b5bc4b3d35 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationContentRequest.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationContentRequest.java
@@ -15,7 +15,7 @@ import com.yahoo.vespa.config.server.session.LocalSession;
* @author lulf
* @since 5.3
*/
-class ApplicationContentRequest extends ContentRequest {
+public class ApplicationContentRequest extends ContentRequest {
private static final String uriPattern = "http://*/application/v2/tenant/*/application/*/environment/*/region/*/instance/*/content/*";
private final ApplicationId applicationId;
@@ -27,7 +27,7 @@ class ApplicationContentRequest extends ContentRequest {
this.zone = zone;
}
- static ContentRequest create(HttpRequest request, LocalSession session, ApplicationId applicationId, Zone zone) {
+ public static ContentRequest create(HttpRequest request, LocalSession session, ApplicationId applicationId, Zone zone) {
return new ApplicationContentRequest(request, session, applicationId, zone);
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java
index 9e49ebd1fad..e9432e9cf81 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java
@@ -12,27 +12,22 @@ import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.container.logging.AccessLog;
import com.yahoo.jdisc.Response;
import com.yahoo.jdisc.application.BindingMatch;
+import com.yahoo.vespa.config.server.http.HttpConfigResponse;
import com.yahoo.vespa.config.server.tenant.Tenant;
import com.yahoo.vespa.config.server.tenant.Tenants;
import com.yahoo.vespa.config.server.TimeoutBudget;
-import com.yahoo.vespa.config.server.application.Application;
-import com.yahoo.vespa.config.server.application.ApplicationConvergenceChecker;
import com.yahoo.vespa.config.server.application.TenantApplications;
-import com.yahoo.vespa.config.server.application.LogServerLogGrabber;
import com.yahoo.vespa.config.server.ApplicationRepository;
-import com.yahoo.vespa.config.server.http.ContentHandler;
import com.yahoo.vespa.config.server.http.HttpErrorResponse;
import com.yahoo.vespa.config.server.http.HttpHandler;
import com.yahoo.vespa.config.server.http.JSONResponse;
import com.yahoo.vespa.config.server.http.NotFoundException;
-import com.yahoo.vespa.config.server.http.SessionHandler;
import com.yahoo.vespa.config.server.http.Utils;
import com.yahoo.vespa.config.server.provision.HostProvisionerProvider;
-import com.yahoo.vespa.config.server.session.LocalSession;
-import com.yahoo.vespa.config.server.session.RemoteSession;
-import com.yahoo.vespa.config.server.session.RemoteSessionRepo;
import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
import java.time.Clock;
import java.time.Duration;
import java.util.List;
@@ -40,7 +35,7 @@ import java.util.Optional;
import java.util.concurrent.Executor;
/**
- * Handler for deleting a currently active application for a tenant.
+ * Operations on applications (delete, wait for config convergence, restart, application content etc.)
*
* @author hmusum
* @since 5.4
@@ -50,26 +45,20 @@ public class ApplicationHandler extends HttpHandler {
private static final String REQUEST_PROPERTY_TIMEOUT = "timeout";
private final Tenants tenants;
- private final ContentHandler contentHandler = new ContentHandler();
+
private final Optional<Provisioner> hostProvisioner;
- private final ApplicationConvergenceChecker convergeChecker;
private final Zone zone;
- private final LogServerLogGrabber logServerLogGrabber;
private final ApplicationRepository applicationRepository;
public ApplicationHandler(Executor executor, AccessLog accessLog,
Tenants tenants,
HostProvisionerProvider hostProvisionerProvider,
Zone zone,
- ApplicationConvergenceChecker convergeChecker,
- LogServerLogGrabber logServerLogGrabber,
ApplicationRepository applicationRepository) {
super(executor, accessLog);
this.tenants = tenants;
this.hostProvisioner = hostProvisionerProvider.getHostProvisioner();
this.zone = zone;
- this.convergeChecker = convergeChecker;
- this.logServerLogGrabber = logServerLogGrabber;
this.applicationRepository = applicationRepository;
}
@@ -89,27 +78,24 @@ public class ApplicationHandler extends HttpHandler {
Tenant tenant = verifyTenantAndApplication(applicationId);
if (isServiceConvergeRequest(request)) {
- Application application = getApplication(tenant, applicationId);
- return convergeChecker.nodeConvergenceCheck(application, getHostFromRequest(request), request.getUri());
+ return applicationRepository.nodeConvergenceCheck(tenant, applicationId, getHostFromRequest(request), request.getUri());
}
if (isContentRequest(request)) {
- LocalSession session = SessionHandler.getSessionFromRequest(tenant.getLocalSessionRepo(), tenant.getApplicationRepo().getSessionIdForApplication(applicationId));
- return contentHandler.get(ApplicationContentRequest.create(request, session, applicationId, zone));
+ return applicationRepository.getContent(tenant, applicationId, zone, request);
}
- Application application = getApplication(tenant, applicationId);
// TODO: Remove this once the config convergence logic is moved to client and is live for all clusters.
if (isConvergeRequest(request)) {
try {
- convergeChecker.waitForConfigConverged(application, new TimeoutBudget(Clock.systemUTC(), durationFromRequestTimeout(request)));
+ applicationRepository.waitForConfigConverged(tenant, applicationId, new TimeoutBudget(Clock.systemUTC(), durationFromRequestTimeout(request)));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
if (isServiceConvergeListRequest(request)) {
- return convergeChecker.listConfigConvergence(application, request.getUri());
+ return applicationRepository.listConfigConvergence(tenant, applicationId, request.getUri());
}
- return new GetApplicationResponse(Response.Status.OK, application.getApplicationGeneration());
+ return new GetApplicationResponse(Response.Status.OK, applicationRepository.getApplicationGeneration(tenant, applicationId));
}
@Override
@@ -136,8 +122,18 @@ public class ApplicationHandler extends HttpHandler {
if (getBindingMatch(request).groupCount() != 7)
throw new NotFoundException("Illegal POST log request '" + request.getUri() +
"': Must have 6 arguments but had " + ( getBindingMatch(request).groupCount()-1 ) );
- Application application = getApplication(tenant, applicationId);
- return logServerLogGrabber.grabLog(application);
+ final String response = applicationRepository.grabLog(tenant, applicationId);
+ return new HttpResponse(200) {
+ @Override
+ public void render(OutputStream outputStream) throws IOException {
+ outputStream.write(response.getBytes(StandardCharsets.UTF_8));
+ }
+
+ @Override
+ public String getContentType() {
+ return HttpConfigResponse.JSON_CONTENT_TYPE;
+ }
+ };
}
private HostFilter hostFilterFrom(HttpRequest request) {
@@ -164,13 +160,6 @@ public class ApplicationHandler extends HttpHandler {
return Duration.ofSeconds(timeoutInSeconds);
}
- private Application getApplication(Tenant tenant, ApplicationId applicationId) {
- TenantApplications applicationRepo = tenant.getApplicationRepo();
- RemoteSessionRepo remoteSessionRepo = tenant.getRemoteSessionRepo();
- long sessionId = applicationRepo.getSessionIdForApplication(applicationId);
- RemoteSession session = remoteSessionRepo.getSession(sessionId, 0);
- return session.ensureApplicationLoaded().getForVersionOrLatest(Optional.empty());
- }
private List<ApplicationId> listApplicationIds(Tenant tenant) {
TenantApplications applicationRepo = tenant.getApplicationRepo();
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java
index 30a3eec47fd..3c19725c22f 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java
@@ -26,8 +26,9 @@ import com.yahoo.transaction.NestedTransaction;
import com.yahoo.vespa.config.server.ApplicationRepository;
import com.yahoo.vespa.config.server.TestComponentRegistry;
import com.yahoo.vespa.config.server.TimeoutBudget;
+import com.yahoo.vespa.config.server.application.ApplicationConvergenceChecker;
+import com.yahoo.vespa.config.server.application.LogServerLogGrabber;
import com.yahoo.vespa.config.server.modelfactory.ModelFactoryRegistry;
-import com.yahoo.vespa.config.server.modelfactory.ModelResult;
import com.yahoo.vespa.config.server.monitoring.Metrics;
import com.yahoo.vespa.config.server.provision.HostProvisionerProvider;
import com.yahoo.vespa.config.server.session.LocalSession;
@@ -35,13 +36,10 @@ import com.yahoo.vespa.config.server.session.PrepareParams;
import com.yahoo.vespa.config.server.session.SilentDeployLogger;
import com.yahoo.vespa.config.server.tenant.Tenant;
import com.yahoo.vespa.config.server.tenant.Tenants;
-import com.yahoo.vespa.config.server.zookeeper.ConfigCurator;
import com.yahoo.vespa.curator.Curator;
import com.yahoo.vespa.curator.mock.MockCurator;
import com.yahoo.vespa.model.VespaModel;
import com.yahoo.vespa.model.VespaModelFactory;
-import org.apache.curator.framework.CuratorFramework;
-import org.junit.Before;
import java.io.File;
import java.io.IOException;
@@ -112,11 +110,14 @@ public class DeployTester {
}
public Optional<com.yahoo.config.provision.Deployment> redeployFromLocalActive(ApplicationId id) {
- ApplicationRepository applicationRepository = new ApplicationRepository(tenants, HostProvisionerProvider.withProvisioner(createHostProvisioner()),
- new ConfigserverConfig(new ConfigserverConfig.Builder()), curator);
-
- Optional<com.yahoo.config.provision.Deployment> deployment = applicationRepository.deployFromLocalActive(id, Duration.ofSeconds(60));
- return deployment;
+ ApplicationRepository applicationRepository = new ApplicationRepository(tenants,
+ HostProvisionerProvider.withProvisioner(createHostProvisioner()),
+ new ConfigserverConfig(new ConfigserverConfig.Builder()),
+ curator,
+ new LogServerLogGrabber(),
+ new ApplicationConvergenceChecker());
+
+ return applicationRepository.deployFromLocalActive(id, Duration.ofSeconds(60));
}
private Provisioner createHostProvisioner() {
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationContentHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationContentHandlerTest.java
index c5925104484..fc5a672559d 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationContentHandlerTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationContentHandlerTest.java
@@ -11,6 +11,8 @@ import com.yahoo.container.logging.AccessLog;
import com.yahoo.jdisc.Response;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.vespa.config.server.ApplicationRepository;
+import com.yahoo.vespa.config.server.application.ApplicationConvergenceChecker;
+import com.yahoo.vespa.config.server.application.LogServerLogGrabber;
import com.yahoo.vespa.config.server.http.ContentHandlerTestBase;
import com.yahoo.vespa.config.server.provision.HostProvisionerProvider;
import com.yahoo.vespa.config.server.session.Session;
@@ -59,12 +61,12 @@ public class ApplicationContentHandlerTest extends ContentHandlerTestBase {
testTenantBuilder.createTenants(),
HostProvisionerProvider.empty(),
Zone.defaultZone(),
- null,
- null,
new ApplicationRepository(testTenantBuilder.createTenants(),
HostProvisionerProvider.empty(),
new ConfigserverConfig(new ConfigserverConfig.Builder()),
- new MockCurator()));
+ new MockCurator(),
+ new LogServerLogGrabber(),
+ new ApplicationConvergenceChecker()));
pathPrefix = createPath(idTenant1, Zone.defaultZone());
baseUrl = baseServer + pathPrefix;
}
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandlerTest.java
index 7bd4a26180f..f8071721989 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandlerTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandlerTest.java
@@ -100,12 +100,12 @@ public class ApplicationHandlerTest {
tenants,
HostProvisionerProvider.withProvisioner(provisioner),
Zone.defaultZone(),
- convergeChecker,
- logServerLogGrabber,
new ApplicationRepository(tenants,
HostProvisionerProvider.withProvisioner(provisioner),
new ConfigserverConfig(new ConfigserverConfig.Builder()),
- new MockCurator()));
+ new MockCurator(),
+ logServerLogGrabber,
+ convergeChecker));
}
private ApplicationHandler createApplicationHandler(Tenants tenants) {
@@ -115,12 +115,12 @@ public class ApplicationHandlerTest {
tenants,
HostProvisionerProvider.withProvisioner(provisioner),
Zone.defaultZone(),
- new ApplicationConvergenceChecker(stateApiFactory),
- new LogServerLogGrabber(),
new ApplicationRepository(tenants,
HostProvisionerProvider.withProvisioner(provisioner),
new ConfigserverConfig(new ConfigserverConfig.Builder()),
- new MockCurator()));
+ new MockCurator(),
+ new LogServerLogGrabber(),
+ new ApplicationConvergenceChecker(stateApiFactory)));
}
@Test
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 0af43649351..e03282da72b 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
@@ -5,7 +5,6 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
-import java.util.Optional;
import com.yahoo.cloud.config.ConfigserverConfig;
import com.yahoo.config.provision.*;
@@ -16,6 +15,8 @@ import com.yahoo.jdisc.http.HttpRequest;
import com.yahoo.slime.JsonFormat;
import com.yahoo.transaction.NestedTransaction;
import com.yahoo.vespa.config.server.*;
+import com.yahoo.vespa.config.server.application.ApplicationConvergenceChecker;
+import com.yahoo.vespa.config.server.application.LogServerLogGrabber;
import com.yahoo.vespa.config.server.http.HttpErrorResponse;
import com.yahoo.vespa.config.server.http.SessionHandlerTest;
import com.yahoo.vespa.config.server.provision.HostProvisionerProvider;
@@ -167,7 +168,9 @@ public class SessionActiveHandlerTest extends SessionActiveHandlerTestBase {
new ApplicationRepository(testTenantBuilder.createTenants(),
HostProvisionerProvider.withProvisioner(hostProvisioner),
new ConfigserverConfig(new ConfigserverConfig.Builder()),
- curator));
+ curator,
+ new LogServerLogGrabber(),
+ new ApplicationConvergenceChecker()));
}
public static class MockProvisioner implements Provisioner {