diff options
author | Harald Musum <musum@verizonmedia.com> | 2021-04-08 09:41:33 +0200 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2021-04-08 09:41:33 +0200 |
commit | 52a5aa107a526326022b0a5779a54f6b48f585e5 (patch) | |
tree | 70f96190f0de4e6fd699fa3dfb9d3ad566cc1b65 /configserver | |
parent | 710092a282bd71f363901831d3feeeca43c64d08 (diff) | |
parent | 0f8387d7f21d392f9d7ab5ee60b10acce1dff4d8 (diff) |
Merge branch 'master' into hmusum/cleanup-7
Diffstat (limited to 'configserver')
11 files changed, 74 insertions, 65 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java b/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java index f77f3112d82..eb179d2d9aa 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java @@ -466,7 +466,7 @@ public class TenantApplications implements RequestHandler, HostValidator<Applica // If all config servers responded, return if (respondents.size() == curator.zooKeeperEnsembleCount()) { - log.log(Level.FINE, barrierCompletedMessage(respondents, startTime)); + logBarrierCompleted(respondents, startTime); break; } @@ -477,7 +477,7 @@ public class TenantApplications implements RequestHandler, HostValidator<Applica // Give up if more than some time has passed since we got quorum, otherwise continue if (Duration.between(Instant.now(), gotQuorumTime.plus(waitForAll)).isNegative()) { - log.log(Level.FINE, barrierCompletedMessage(respondents, startTime)); + logBarrierCompleted(respondents, startTime); break; } } @@ -488,8 +488,14 @@ public class TenantApplications implements RequestHandler, HostValidator<Applica return respondents; } - private String barrierCompletedMessage(List<String> respondents, Instant startTime) { - return barrierPath + " completed in " + Duration.between(startTime, Instant.now()).toString() + + private void logBarrierCompleted(List<String> respondents, Instant startTime) { + Duration duration = Duration.between(startTime, Instant.now()); + Level level = (duration.minus(Duration.ofSeconds(5))).isNegative() ? Level.FINE : Level.INFO; + log.log(level, barrierCompletedMessage(respondents, duration)); + } + + private String barrierCompletedMessage(List<String> respondents, Duration duration) { + return barrierPath + " completed in " + duration.toString() + ", " + respondents.size() + "/" + curator.zooKeeperEnsembleCount() + " responded: " + respondents; } diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java index a1a8548f5f1..b4dd81ad7aa 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java @@ -166,7 +166,6 @@ public class ModelContextImpl implements ModelContext { private final boolean skipCommunicationManagerThread; private final boolean skipMbusRequestThread; private final boolean skipMbusReplyThread; - private final boolean useAccessControlTlsHandshakeClientAuth; private final boolean useAsyncMessageHandlingOnSchedule; private final double feedConcurrency; private final boolean useBucketExecutorForLidSpaceCompact; @@ -191,7 +190,6 @@ public class ModelContextImpl implements ModelContext { this.skipCommunicationManagerThread = flagValue(source, appId, Flags.SKIP_COMMUNICATIONMANAGER_THREAD); this.skipMbusRequestThread = flagValue(source, appId, Flags.SKIP_MBUS_REQUEST_THREAD); this.skipMbusReplyThread = flagValue(source, appId, Flags.SKIP_MBUS_REPLY_THREAD); - this.useAccessControlTlsHandshakeClientAuth = flagValue(source, appId, Flags.USE_ACCESS_CONTROL_CLIENT_AUTHENTICATION); this.useAsyncMessageHandlingOnSchedule = flagValue(source, appId, Flags.USE_ASYNC_MESSAGE_HANDLING_ON_SCHEDULE); this.feedConcurrency = flagValue(source, appId, Flags.FEED_CONCURRENCY); this.useBucketExecutorForLidSpaceCompact = flagValue(source, appId, Flags.USE_BUCKET_EXECUTOR_FOR_LID_SPACE_COMPACT); @@ -216,7 +214,6 @@ public class ModelContextImpl implements ModelContext { @Override public boolean skipCommunicationManagerThread() { return skipCommunicationManagerThread; } @Override public boolean skipMbusRequestThread() { return skipMbusRequestThread; } @Override public boolean skipMbusReplyThread() { return skipMbusReplyThread; } - @Override public boolean useAccessControlTlsHandshakeClientAuth() { return useAccessControlTlsHandshakeClientAuth; } @Override public boolean useAsyncMessageHandlingOnSchedule() { return useAsyncMessageHandlingOnSchedule; } @Override public double feedConcurrency() { return feedConcurrency; } @Override public boolean useBucketExecutorForLidSpaceCompact() { return useBucketExecutorForLidSpaceCompact; } diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java index c195f1a9f96..b2e239c7ebc 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java @@ -35,13 +35,11 @@ public class LbServicesProducer implements LbServicesConfig.Producer { private final Map<TenantName, Set<ApplicationInfo>> models; private final Zone zone; - private final BooleanFlag usePowerOfTwoChoicesLb; private final BooleanFlag generateNonMtlsEndpoint; public LbServicesProducer(Map<TenantName, Set<ApplicationInfo>> models, Zone zone, FlagSource flagSource) { this.models = models; this.zone = zone; - usePowerOfTwoChoicesLb = Flags.USE_POWER_OF_TWO_CHOICES_LOAD_BALANCING.bindTo(flagSource); generateNonMtlsEndpoint = Flags.GENERATE_NON_MTLS_ENDPOINT.bindTo(flagSource); } @@ -74,7 +72,7 @@ public class LbServicesProducer implements LbServicesConfig.Producer { private LbServicesConfig.Tenants.Applications.Builder getAppConfig(ApplicationInfo app) { LbServicesConfig.Tenants.Applications.Builder ab = new LbServicesConfig.Tenants.Applications.Builder(); ab.activeRotation(getActiveRotation(app)); - ab.usePowerOfTwoChoicesLb(usePowerOfTwoChoicesLb(app)); + ab.usePowerOfTwoChoicesLb(true); ab.generateNonMtlsEndpoint(generateNonMtlsEndpoint(app)); app.getModel().getHosts().stream() .sorted((a, b) -> a.getHostname().compareTo(b.getHostname())) @@ -96,10 +94,6 @@ public class LbServicesProducer implements LbServicesConfig.Producer { return activeRotation; } - private boolean usePowerOfTwoChoicesLb(ApplicationInfo app) { - return usePowerOfTwoChoicesLb.with(FetchVector.Dimension.APPLICATION_ID, app.getApplicationId().serializedForm()).value(); - } - private boolean generateNonMtlsEndpoint(ApplicationInfo app) { return generateNonMtlsEndpoint.with(FetchVector.Dimension.APPLICATION_ID, app.getApplicationId().serializedForm()).value(); } diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizer.java index 8353e3fab1f..4dfa8384822 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizer.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizer.java @@ -161,7 +161,7 @@ public class MultiTenantRpcAuthorizer implements RpcAuthorizer { JrtErrorCode error = isAuthorizationException ? JrtErrorCode.UNAUTHORIZED : JrtErrorCode.AUTHORIZATION_FAILED; request.setError(error.code, errorMessage); request.returnRequest(); - throwUnchecked(throwable); // rethrow exception to ensure that subsequent completion stages are not executed (don't execute implementation of rpc method). + throw throwUnchecked(throwable); // rethrow exception to ensure that subsequent completion stages are not executed (don't execute implementation of rpc method). } // TODO Make peer identity mandatory once TLS mixed mode is removed diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java index 9fd20453bcd..52d1484897c 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java @@ -103,7 +103,8 @@ public class TenantRepository { private final Metrics metrics; private final MetricUpdater metricUpdater; private final ExecutorService zkCacheExecutor; - private final StripedExecutor<TenantName> zkWatcherExecutor; + private final StripedExecutor<TenantName> zkSessionWatcherExecutor; + private final StripedExecutor<TenantName> zkApplicationWatcherExecutor; private final FileDistributionFactory fileDistributionFactory; private final FlagSource flagSource; private final SecretStore secretStore; @@ -141,6 +142,7 @@ public class TenantRepository { configCurator, metrics, new StripedExecutor<>(), + new StripedExecutor<>(), new FileDistributionFactory(configserverConfig), flagSource, Executors.newFixedThreadPool(1, ThreadFactoryFactory.getThreadFactory(TenantRepository.class.getName())), @@ -159,7 +161,8 @@ public class TenantRepository { public TenantRepository(HostRegistry hostRegistry, ConfigCurator configCurator, Metrics metrics, - StripedExecutor<TenantName> zkWatcherExecutor, + StripedExecutor<TenantName> zkApplicationWatcherExecutor , + StripedExecutor<TenantName> zkSessionWatcherExecutor, FileDistributionFactory fileDistributionFactory, FlagSource flagSource, ExecutorService zkCacheExecutor, @@ -181,7 +184,8 @@ public class TenantRepository { this.metrics = metrics; metricUpdater = metrics.getOrCreateMetricUpdater(Collections.emptyMap()); this.zkCacheExecutor = zkCacheExecutor; - this.zkWatcherExecutor = zkWatcherExecutor; + this.zkApplicationWatcherExecutor = zkApplicationWatcherExecutor; + this.zkSessionWatcherExecutor = zkSessionWatcherExecutor; this.fileDistributionFactory = fileDistributionFactory; this.flagSource = flagSource; this.secretStore = secretStore; @@ -318,7 +322,7 @@ public class TenantRepository { TenantApplications applicationRepo = new TenantApplications(tenantName, curator, - zkWatcherExecutor, + zkApplicationWatcherExecutor, zkCacheExecutor, metrics, reloadListener, @@ -342,7 +346,7 @@ public class TenantRepository { sessionPreparer, configCurator, metrics, - zkWatcherExecutor, + zkSessionWatcherExecutor, permanentApplicationPackage, flagSource, zkCacheExecutor, @@ -511,12 +515,12 @@ public class TenantRepository { case CHILD_ADDED: TenantName t1 = getTenantNameFromEvent(event); if ( ! tenants.containsKey(t1)) - zkWatcherExecutor.execute(t1, () -> bootstrapTenant(t1)); + zkApplicationWatcherExecutor.execute(t1, () -> bootstrapTenant(t1)); break; case CHILD_REMOVED: TenantName t2 = getTenantNameFromEvent(event); if (tenants.containsKey(t2)) - zkWatcherExecutor.execute(t2, () -> deleteTenant(t2)); + zkApplicationWatcherExecutor.execute(t2, () -> deleteTenant(t2)); break; default: break; // Nothing to do @@ -537,7 +541,8 @@ public class TenantRepository { try { zkCacheExecutor.shutdown(); checkForRemovedApplicationsService.shutdown(); - zkWatcherExecutor.shutdownAndWait(); + zkApplicationWatcherExecutor.shutdownAndWait(); + zkSessionWatcherExecutor.shutdownAndWait(); zkCacheExecutor.awaitTermination(50, TimeUnit.SECONDS); checkForRemovedApplicationsService.awaitTermination(50, TimeUnit.SECONDS); } 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 4fbb001b880..63b9def7448 100644 --- a/configserver/src/main/java/com/yahoo/vespa/serviceview/StateRequestHandler.java +++ b/configserver/src/main/java/com/yahoo/vespa/serviceview/StateRequestHandler.java @@ -4,9 +4,9 @@ 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.restapi.JacksonJsonResponse; import com.yahoo.restapi.RestApi; import com.yahoo.restapi.RestApiRequestHandler; +import com.yahoo.restapi.UriBuilder; import com.yahoo.vespa.serviceview.bindings.ApplicationView; import com.yahoo.vespa.serviceview.bindings.ConfigClient; import com.yahoo.vespa.serviceview.bindings.HealthClient; @@ -79,13 +79,13 @@ public class StateRequestHandler extends RestApiRequestHandler<StateRequestHandl .get(self::getUserInfo)) .addRoute(RestApi.route("/serviceview/v1/tenant/{tenantName}/application/{applicationName}/environment/{environmentName}/region/{regionName}/instance/{instanceName}/service/{serviceIdentifier}/{*}") .get(self::singleService)) - .addResponseMapper(HashMap.class, (hashMap, context) -> new JacksonJsonResponse<>(200, hashMap, true)) - .addResponseMapper(ApplicationView.class, (applicationView, context) -> new JacksonJsonResponse<>(200, applicationView, true)) + .registerJacksonResponseEntity(HashMap.class) + .registerJacksonResponseEntity(ApplicationView.class) .build(); } private ApplicationView getDefaultUserInfo(RestApi.RequestContext context) { - return getUserInfo(context.request().getUri(), "default", "default", "default", "default", "default"); + return getUserInfo(context.uriBuilder(), "default", "default", "default", "default", "default"); } private ApplicationView getUserInfo(RestApi.RequestContext context) { @@ -94,7 +94,7 @@ public class StateRequestHandler extends RestApiRequestHandler<StateRequestHandl String environmentName = context.pathParameters().getStringOrThrow("environmentName"); String regionName = context.pathParameters().getStringOrThrow("regionName"); String instanceName = context.pathParameters().getStringOrThrow("instanceName"); - return getUserInfo(context.request().getUri(), tenantName, applicationName, environmentName, regionName, instanceName); + return getUserInfo(context.uriBuilder(), tenantName, applicationName, environmentName, regionName, instanceName); } public HashMap<?, ?> singleService(RestApi.RequestContext context) { @@ -105,14 +105,14 @@ public class StateRequestHandler extends RestApiRequestHandler<StateRequestHandl String instanceName = context.pathParameters().getStringOrThrow("instanceName"); String identifier = context.pathParameters().getStringOrThrow("serviceIdentifier"); String apiParams = context.pathParameters().getString("*").orElse(""); - return singleService(context.request().getUri(), tenantName, applicationName, environmentName, regionName, instanceName, identifier, apiParams); + return singleService(context.uriBuilder(), context.request().getUri(), tenantName, applicationName, environmentName, regionName, instanceName, identifier, apiParams); } - protected ApplicationView getUserInfo(URI requestUri, String tenantName, String applicationName, String environmentName, String regionName, String instanceName) { + protected ApplicationView getUserInfo(UriBuilder uriBuilder, String tenantName, String applicationName, String environmentName, String regionName, String instanceName) { ServiceModel model = new ServiceModel( getModelConfig(tenantName, applicationName, environmentName, regionName, instanceName)); return model.showAllClusters( - baseUri(requestUri).toString(), + baseUri(uriBuilder).toString(), applicationIdentifier(tenantName, applicationName, environmentName, regionName, instanceName)); } @@ -123,13 +123,13 @@ public class StateRequestHandler extends RestApiRequestHandler<StateRequestHandl } protected HashMap<?, ?> singleService( - URI requestUri, String tenantName, String applicationName, String environmentName, String regionName, String instanceName, String identifier, String apiParams) { + UriBuilder uriBuilder, URI requestUri, String tenantName, String applicationName, String environmentName, String regionName, String instanceName, String identifier, String apiParams) { ServiceModel model = new ServiceModel(getModelConfig(tenantName, applicationName, environmentName, regionName, instanceName)); Service s = model.getService(identifier); int requestedPort = s.matchIdentifierWithPort(identifier); HealthClient resource = getHealthClient(apiParams, s, requestedPort, requestUri.getRawQuery(), client); HashMap<?, ?> apiResult = resource.getHealthInfo(); - rewriteResourceLinks(requestUri, apiResult, model, s, applicationIdentifier(tenantName, applicationName, environmentName, regionName, instanceName), identifier); + rewriteResourceLinks(uriBuilder, apiResult, model, s, applicationIdentifier(tenantName, applicationName, environmentName, regionName, instanceName), identifier); return apiResult; } @@ -149,7 +149,7 @@ public class StateRequestHandler extends RestApiRequestHandler<StateRequestHandl + "/instance/" + instance; } - private void rewriteResourceLinks(URI requestUri, + private void rewriteResourceLinks(UriBuilder uriBuilder, Object apiResult, ServiceModel model, Service self, @@ -160,7 +160,7 @@ public class StateRequestHandler extends RestApiRequestHandler<StateRequestHandl Object resource = i.next(); if (resource instanceof String) { try { - StringBuilder buffer = linkBuffer(requestUri, applicationIdentifier); + StringBuilder buffer = linkBuffer(uriBuilder, applicationIdentifier); // if it points to a port and host not part of the application, rewriting will not occur, so this is kind of safe retarget(model, self, buffer, (String) resource); i.set(buffer.toString()); @@ -168,7 +168,7 @@ public class StateRequestHandler extends RestApiRequestHandler<StateRequestHandl break; // assume relatively homogenous lists when doing rewrites to avoid freezing up on scanning long lists } } else { - rewriteResourceLinks(requestUri, resource, model, self, applicationIdentifier, incomingIdentifier); + rewriteResourceLinks(uriBuilder, resource, model, self, applicationIdentifier, incomingIdentifier); } } } else if (apiResult instanceof Map) { @@ -177,14 +177,14 @@ public class StateRequestHandler extends RestApiRequestHandler<StateRequestHandl for (Map.Entry<Object, Object> entry : api.entrySet()) { if (SINGLE_API_LINK.equals(entry.getKey()) && entry.getValue() instanceof String) { try { - rewriteSingleLink(entry, model, self, linkBuffer(requestUri, applicationIdentifier)); + rewriteSingleLink(entry, model, self, linkBuffer(uriBuilder, applicationIdentifier)); } catch (GiveUpLinkRetargetingException e) { // NOP } } else if ("link".equals(entry.getKey()) && entry.getValue() instanceof String) { - buildSingleLink(entry, linkBuffer(requestUri, applicationIdentifier), incomingIdentifier); + buildSingleLink(entry, linkBuffer(uriBuilder, applicationIdentifier), incomingIdentifier); } else { - rewriteResourceLinks(requestUri, entry.getValue(), model, self, applicationIdentifier, incomingIdentifier); + rewriteResourceLinks(uriBuilder, entry.getValue(), model, self, applicationIdentifier, incomingIdentifier); } } } @@ -205,8 +205,8 @@ public class StateRequestHandler extends RestApiRequestHandler<StateRequestHandl } } - private StringBuilder linkBuffer(URI requestUri, String applicationIdentifier) { - return baseUri(requestUri).append(applicationIdentifier); + private StringBuilder linkBuffer(UriBuilder uriBuilder, String applicationIdentifier) { + return baseUri(uriBuilder).append(applicationIdentifier); } private void rewriteSingleLink(Map.Entry<Object, Object> entry, @@ -242,12 +242,7 @@ public class StateRequestHandler extends RestApiRequestHandler<StateRequestHandl newUri.append(link.getRawPath()); } - private static StringBuilder baseUri(URI requestUri) { - return new StringBuilder(requestUri.getScheme()) - .append("://") - .append(requestUri.getHost()) - .append(':') - .append(requestUri.getPort()) - .append("/serviceview/v1/"); + private static StringBuilder baseUri(UriBuilder uriBuilder) { + return new StringBuilder(uriBuilder.withPath("/serviceview/v1/").toString()); } } diff --git a/configserver/src/main/resources/configserver-app/services.xml b/configserver/src/main/resources/configserver-app/services.xml index 51fc26bdbaa..8c792089810 100644 --- a/configserver/src/main/resources/configserver-app/services.xml +++ b/configserver/src/main/resources/configserver-app/services.xml @@ -63,8 +63,29 @@ <component id="com.yahoo.vespa.orchestrator.controller.RetryingClusterControllerClientFactory" bundle="orchestrator" /> <component id="com.yahoo.vespa.orchestrator.OrchestratorImpl" bundle="orchestrator" /> - <rest-api path="orchestrator" jersey2="true"> - <components bundle="orchestrator" /> + <rest-api path="orchestrator/v1/suspensions/applications" jersey2="true"> + <components bundle="orchestrator"> + <package>com.yahoo.vespa.orchestrator.resources.appsuspension</package> + </components> + </rest-api> + <rest-api path="orchestrator/v1/health" jersey2="true"> + <components bundle="orchestrator"> + <package>com.yahoo.vespa.orchestrator.resources.health</package> + </components> + </rest-api> + <rest-api path="orchestrator/v1/hosts" jersey2="true"> + <components bundle="orchestrator"> + <package>com.yahoo.vespa.orchestrator.resources.host</package> + </components> + </rest-api> + <handler id="com.yahoo.vespa.orchestrator.resources.HostSuspensionHandler" bundle="orchestrator"> + <binding>http://*/orchestrator/v1/suspensions/hosts</binding> + <binding>http://*/orchestrator/v1/suspensions/hosts/*</binding> + </handler> + <rest-api path="orchestrator/v1/instances" jersey2="true"> + <components bundle="orchestrator"> + <package>com.yahoo.vespa.orchestrator.resources.instance</package> + </components> </rest-api> <handler id="com.yahoo.vespa.serviceview.StateRequestHandler" bundle="configserver"> diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java index 31746b66806..e94a99f59d7 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java @@ -113,18 +113,6 @@ public class LbServicesProducerTest { } @Test - public void use_power_of_two_lb_is_configured_from_feature_flag() { - RegionName regionName = RegionName.from("us-east-1"); - - LbServicesConfig conf = createModelAndGetLbServicesConfig(regionName); - assertFalse(conf.tenants("foo").applications("foo:prod:" + regionName.value() + ":default").usePowerOfTwoChoicesLb()); - - flagSource.withBooleanFlag(Flags.USE_POWER_OF_TWO_CHOICES_LOAD_BALANCING.id(), true); - conf = createModelAndGetLbServicesConfig(regionName); - assertTrue(conf.tenants("foo").applications("foo:prod:" + regionName.value() + ":default").usePowerOfTwoChoicesLb()); - } - - @Test public void generate_non_mtls_endpoints_from_feature_flag() { RegionName regionName = RegionName.from("us-east-1"); diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantRepositoryTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantRepositoryTest.java index ae9e451b037..6f7e0541cc7 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantRepositoryTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantRepositoryTest.java @@ -212,7 +212,8 @@ public class TenantRepositoryTest { ConfigCurator.create(new MockCurator()), Metrics.createTestMetrics(), new StripedExecutor<>(new InThreadExecutorService()), - new FileDistributionFactory(configserverConfig), + new StripedExecutor<>(new InThreadExecutorService()), + new FileDistributionFactory(new ConfigserverConfig.Builder().build()), new InMemoryFlagSource(), new InThreadExecutorService(), new MockSecretStore(), diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TestTenantRepository.java b/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TestTenantRepository.java index 8279bf4df5e..687d58fd23b 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TestTenantRepository.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TestTenantRepository.java @@ -50,6 +50,7 @@ public class TestTenantRepository extends TenantRepository { ConfigCurator.create(curator), metrics, new StripedExecutor<>(new InThreadExecutorService()), + new StripedExecutor<>(new InThreadExecutorService()), fileDistributionFactory, flagSource, new InThreadExecutorService(), diff --git a/configserver/src/test/java/com/yahoo/vespa/serviceview/StateRequestHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/serviceview/StateRequestHandlerTest.java index a0bb8a5acc7..68eca62e54b 100644 --- a/configserver/src/test/java/com/yahoo/vespa/serviceview/StateRequestHandlerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/serviceview/StateRequestHandlerTest.java @@ -3,6 +3,7 @@ package com.yahoo.vespa.serviceview; import com.yahoo.cloud.config.ConfigserverConfig; import com.yahoo.jdisc.test.MockMetric; +import com.yahoo.restapi.UriBuilder; import com.yahoo.vespa.serviceview.bindings.ApplicationView; import com.yahoo.vespa.serviceview.bindings.HealthClient; import com.yahoo.vespa.serviceview.bindings.ModelResponse; @@ -74,14 +75,14 @@ public class StateRequestHandlerTest { public final void test() { Service s = correspondingModel.resolve("vespa.yahoo.com", 8080, null); String api = "/state/v1"; - HashMap<?, ?> boom = testHandler.singleService(URI.create(EXTERNAL_BASE_URI), "default", "default", "default", "default", "default", s.getIdentifier(8080), api); + HashMap<?, ?> boom = testHandler.singleService(new UriBuilder("http://someserver:8080"), URI.create(EXTERNAL_BASE_URI), "default", "default", "default", "default", "default", s.getIdentifier(8080), api); assertEquals(EXTERNAL_BASE_URI + "tenant/default/application/default/environment/default/region/default/instance/default/service/" + s.getIdentifier(8080) + api, ((Map<?, ?>) ((List<?>) boom.get("resources")).get(0)).get("url")); } @Test public final void testLinkEquality() { - ApplicationView explicitParameters = testHandler.getUserInfo(URI.create(EXTERNAL_BASE_URI), "default", "default", "default", "default", "default"); + ApplicationView explicitParameters = testHandler.getUserInfo(new UriBuilder("http://someserver:8080"), "default", "default", "default", "default", "default"); assertEquals(EXTERNAL_BASE_URI + "tenant/default/application/default/environment/default/region/default/instance" + "/default/service/container-clustercontroller-2ul67p8psr451t3w8kdd0qwgg/state/v1/", explicitParameters.clusters.get(0).services.get(0).url); |