diff options
author | gjoranv <gv@verizonmedia.com> | 2022-01-18 20:59:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 20:59:06 +0100 |
commit | 530eb9c9f9534251a227bf05113e55d2a6a6ea98 (patch) | |
tree | 4bf17be8c2aa6cb9f810a7e267eccfe50056af0a /configserver/src | |
parent | c7afad052b3287a95d36617bcab1d1e30af4394c (diff) | |
parent | 7c2bf0f9b449ce16d3ea729e98e6f5633d578974 (diff) |
Merge pull request #20846 from vespa-engine/deprecate-LoggingRequestHandler
Deprecate logging request handler [run-systemtest]
Diffstat (limited to 'configserver/src')
16 files changed, 23 insertions, 23 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpHandler.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpHandler.java index 9f4f8b5f9ce..190005771c7 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpHandler.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpHandler.java @@ -9,8 +9,8 @@ import com.yahoo.config.provision.exception.ActivationConflictException; import com.yahoo.config.provision.exception.LoadBalancerServiceException; import com.yahoo.container.jdisc.HttpRequest; import com.yahoo.container.jdisc.HttpResponse; -import com.yahoo.container.jdisc.LoggingRequestHandler; import com.yahoo.vespa.config.server.application.ConfigNotConvergedException; +import com.yahoo.container.jdisc.ThreadedHttpRequestHandler; import com.yahoo.yolean.Exceptions; import java.io.PrintWriter; @@ -25,7 +25,7 @@ import java.util.logging.Level; * * @author hmusum */ -public class HttpHandler extends LoggingRequestHandler { +public class HttpHandler extends ThreadedHttpRequestHandler { public HttpHandler(HttpHandler.Context ctx) { super(ctx); diff --git a/configserver/src/main/java/com/yahoo/vespa/serviceview/StateRequestHandler.java b/configserver/src/main/java/com/yahoo/vespa/serviceview/StateRequestHandler.java index d81297a87e9..d3c19bb0ba5 100644 --- a/configserver/src/main/java/com/yahoo/vespa/serviceview/StateRequestHandler.java +++ b/configserver/src/main/java/com/yahoo/vespa/serviceview/StateRequestHandler.java @@ -3,7 +3,7 @@ package com.yahoo.vespa.serviceview; import com.google.inject.Inject; import com.yahoo.cloud.config.ConfigserverConfig; -import com.yahoo.container.jdisc.LoggingRequestHandler; +import com.yahoo.container.jdisc.ThreadedHttpRequestHandler; import com.yahoo.restapi.RestApi; import com.yahoo.restapi.RestApiRequestHandler; import com.yahoo.restapi.UriBuilder; @@ -57,7 +57,7 @@ public class StateRequestHandler extends RestApiRequestHandler<StateRequestHandl } @Inject - public StateRequestHandler(LoggingRequestHandler.Context context, + public StateRequestHandler(ThreadedHttpRequestHandler.Context context, ConfigserverConfig configserverConfig) { super(context, StateRequestHandler::createRestApiDefinition); this.restApiPort = configserverConfig.httpport(); diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpGetConfigHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpGetConfigHandlerTest.java index 8816e695e64..279f3a237e8 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpGetConfigHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpGetConfigHandlerTest.java @@ -63,7 +63,7 @@ public class HttpGetConfigHandlerTest { .withOrchestrator(new OrchestratorMock()) .withConfigserverConfig(configserverConfig) .build(); - handler = new HttpGetConfigHandler(HttpGetConfigHandler.testOnlyContext(), tenantRepository); + handler = new HttpGetConfigHandler(HttpGetConfigHandler.testContext(), tenantRepository); applicationRepository.deploy(testApp, prepareParams()); } diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpHandlerTest.java index 8f092ec9d54..40671294b4c 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpHandlerTest.java @@ -45,7 +45,7 @@ public class HttpHandlerTest { private static class HttpTestHandler extends HttpHandler { private final RuntimeException exception; HttpTestHandler(RuntimeException exception) { - super(HttpHandler.testOnlyContext()); + super(HttpHandler.testContext()); this.exception = exception; } diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpListConfigsHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpListConfigsHandlerTest.java index 45c74f0d49f..520b4d0edc5 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpListConfigsHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpListConfigsHandlerTest.java @@ -70,7 +70,7 @@ public class HttpListConfigsHandlerTest { .build(); applicationRepository.deploy(testApp, prepareParams()); - HttpListConfigsHandler.Context ctx = HttpListConfigsHandler.testOnlyContext(); + HttpListConfigsHandler.Context ctx = HttpListConfigsHandler.testContext(); handler = new HttpListConfigsHandler(ctx, tenantRepository); namedHandler = new HttpListNamedConfigsHandler(ctx, tenantRepository); } diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/status/StatusHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/status/StatusHandlerTest.java index 18fa307a9d3..ed739d73860 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/status/StatusHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/status/StatusHandlerTest.java @@ -29,7 +29,7 @@ public class StatusHandlerTest { public void require_that_handler_works() throws IOException { ModelFactoryRegistry modelFactoryRegistry = new ModelFactoryRegistry(List.of(new VespaModelFactory(new NullConfigModelRegistry()))); ConfigserverConfig configserverConfig = new ConfigserverConfig.Builder().build(); - StatusHandler handler = new StatusHandler(StatusHandler.testOnlyContext(), modelFactoryRegistry, configserverConfig); + StatusHandler handler = new StatusHandler(StatusHandler.testContext(), modelFactoryRegistry, configserverConfig); HttpResponse response = handler.handle(HttpRequest.createTestRequest("/status", GET)); JsonNode jsonNode = mapper.readTree(SessionHandlerTest.getRenderedString(response)); 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 322a2b924bd..1d891c0547c 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 @@ -69,7 +69,7 @@ public class ApplicationContentHandlerTest extends ContentHandlerTestBase { .build(); applicationRepository.deploy(testApp, prepareParams(appId1)); - handler = new ApplicationHandler(ApplicationHandler.testOnlyContext(), + handler = new ApplicationHandler(ApplicationHandler.testContext(), Zone.defaultZone(), applicationRepository); pathPrefix = createPath(appId1, Zone.defaultZone()); 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 36930e27de4..005dd715dd4 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 @@ -756,7 +756,7 @@ public class ApplicationHandlerTest { "/environment/" + zone.environment().value() + "/region/" + zone.region().value() + "/instance/" + applicationId.instance().value() + "\"]"; - ListApplicationsHandler listApplicationsHandler = new ListApplicationsHandler(ListApplicationsHandler.testOnlyContext(), + ListApplicationsHandler listApplicationsHandler = new ListApplicationsHandler(ListApplicationsHandler.testContext(), tenantRepository, Zone.defaultZone()); ListApplicationsHandlerTest.assertResponse(listApplicationsHandler, @@ -808,7 +808,7 @@ public class ApplicationHandlerTest { } private ApplicationHandler createApplicationHandler(ApplicationRepository applicationRepository) { - return new ApplicationHandler(ApplicationHandler.testOnlyContext(), Zone.defaultZone(), applicationRepository); + return new ApplicationHandler(ApplicationHandler.testContext(), Zone.defaultZone(), applicationRepository); } private PrepareParams prepareParams(ApplicationId applicationId) { 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 6bbbc451094..fbc5e87c329 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 @@ -62,7 +62,7 @@ public class HostHandlerTest { .withOrchestrator(new OrchestratorMock()) .withConfigserverConfig(configserverConfig) .build(); - handler = new HostHandler(HostHandler.testOnlyContext(), applicationRepository); + handler = new HostHandler(HostHandler.testContext(), applicationRepository); } @Test diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/HttpGetConfigHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/HttpGetConfigHandlerTest.java index 3d207f9f64a..9aae64cb884 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/HttpGetConfigHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/HttpGetConfigHandlerTest.java @@ -72,7 +72,7 @@ public class HttpGetConfigHandlerTest { .withOrchestrator(new OrchestratorMock()) .withConfigserverConfig(configserverConfig) .build(); - handler = new HttpGetConfigHandler(HttpGetConfigHandler.testOnlyContext(), tenantRepository); + handler = new HttpGetConfigHandler(HttpGetConfigHandler.testContext(), tenantRepository); applicationRepository.deploy(testApp, prepareParams()); } diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/HttpListConfigsHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/HttpListConfigsHandlerTest.java index 141f8a52f13..2ee1064f614 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/HttpListConfigsHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/HttpListConfigsHandlerTest.java @@ -76,10 +76,10 @@ public class HttpListConfigsHandlerTest { .withConfigserverConfig(configserverConfig) .build(); applicationRepository.deploy(testApp, prepareParams()); - handler = new HttpListConfigsHandler(HttpListConfigsHandler.testOnlyContext(), + handler = new HttpListConfigsHandler(HttpListConfigsHandler.testContext(), tenantRepository, Zone.defaultZone()); - namedHandler = new HttpListNamedConfigsHandler(HttpListConfigsHandler.testOnlyContext(), + namedHandler = new HttpListNamedConfigsHandler(HttpListConfigsHandler.testContext(), tenantRepository, Zone.defaultZone()); } diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ListApplicationsHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ListApplicationsHandlerTest.java index e2ad65786a4..76790e6264d 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ListApplicationsHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ListApplicationsHandlerTest.java @@ -55,7 +55,7 @@ public class ListApplicationsHandlerTest { tenantRepository.addTenant(foobar); applicationRepo = tenantRepository.getTenant(mytenant).getApplicationRepo(); applicationRepo2 = tenantRepository.getTenant(foobar).getApplicationRepo(); - handler = new ListApplicationsHandler(ListApplicationsHandler.testOnlyContext(), + handler = new ListApplicationsHandler(ListApplicationsHandler.testContext(), tenantRepository, new Zone(Environment.dev, RegionName.from("us-east"))); } 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 c6f84c2d6ae..ecb8d7603f6 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 @@ -164,7 +164,7 @@ public class SessionActiveHandlerTest { } private SessionActiveHandler createHandler() { - return new SessionActiveHandler(SessionActiveHandler.testOnlyContext(), + return new SessionActiveHandler(SessionActiveHandler.testContext(), applicationRepository, Zone.defaultZone()); } diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionContentHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionContentHandlerTest.java index f13ec6cd5c8..ec96be0d0c8 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionContentHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionContentHandlerTest.java @@ -183,7 +183,7 @@ public class SessionContentHandlerTest extends ContentHandlerTestBase { private SessionContentHandler createHandler() { return new SessionContentHandler( - SessionContentHandler.testOnlyContext(), + SessionContentHandler.testContext(), new ApplicationRepository.Builder() .withTenantRepository(tenantRepository) .withProvisioner(new MockProvisioner()) diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionCreateHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionCreateHandlerTest.java index 4cb69ce5d20..702dd2792da 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionCreateHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionCreateHandlerTest.java @@ -195,7 +195,7 @@ public class SessionCreateHandlerTest extends SessionHandlerTest { } private SessionCreateHandler createHandler() { - return new SessionCreateHandler(SessionCreateHandler.testOnlyContext(), + return new SessionCreateHandler(SessionCreateHandler.testContext(), applicationRepository, configserverConfig); } 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 4a19e8d16fb..3d2e108a75e 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 @@ -247,7 +247,7 @@ public class SessionPrepareHandlerTest extends SessionHandlerTest { public void test_out_of_capacity_response() throws IOException { long sessionId = applicationRepository.createSession(applicationId(), timeoutBudget, app); String exceptionMessage = "Out of capacity"; - FailingSessionPrepareHandler handler = new FailingSessionPrepareHandler(SessionPrepareHandler.testOnlyContext(), + FailingSessionPrepareHandler handler = new FailingSessionPrepareHandler(SessionPrepareHandler.testContext(), applicationRepository, configserverConfig, new OutOfCapacityException(exceptionMessage)); @@ -262,7 +262,7 @@ public class SessionPrepareHandlerTest extends SessionHandlerTest { public void test_that_nullpointerexception_gives_internal_server_error() throws IOException { long sessionId = applicationRepository.createSession(applicationId(), timeoutBudget, app); String exceptionMessage = "nullpointer thrown in test handler"; - FailingSessionPrepareHandler handler = new FailingSessionPrepareHandler(SessionPrepareHandler.testOnlyContext(), + FailingSessionPrepareHandler handler = new FailingSessionPrepareHandler(SessionPrepareHandler.testContext(), applicationRepository, configserverConfig, new NullPointerException(exceptionMessage)); @@ -277,7 +277,7 @@ public class SessionPrepareHandlerTest extends SessionHandlerTest { public void test_application_lock_failure() throws IOException { String exceptionMessage = "Timed out after waiting PT1M to acquire lock '/provision/v1/locks/foo/bar/default'"; long sessionId = applicationRepository.createSession(applicationId(), timeoutBudget, app); - FailingSessionPrepareHandler handler = new FailingSessionPrepareHandler(SessionPrepareHandler.testOnlyContext(), + FailingSessionPrepareHandler handler = new FailingSessionPrepareHandler(SessionPrepareHandler.testContext(), applicationRepository, configserverConfig, new ApplicationLockException(new UncheckedTimeoutException(exceptionMessage))); @@ -314,7 +314,7 @@ public class SessionPrepareHandlerTest extends SessionHandlerTest { } private SessionHandler createHandler() { - return new SessionPrepareHandler(SessionPrepareHandler.testOnlyContext(), applicationRepository, configserverConfig); + return new SessionPrepareHandler(SessionPrepareHandler.testContext(), applicationRepository, configserverConfig); } private HttpResponse request(HttpRequest.Method put, long l) { |