summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorgjoranv <gjoranv@gmail.com>2019-03-04 13:20:31 +0100
committerGitHub <noreply@github.com>2019-03-04 13:20:31 +0100
commitaa4a3718c0593a683daea6b0f6954d421b8637e8 (patch)
treeba83ab3ddc8da87fdd3a5ab8ba35d1ce989beaff /configserver
parent243a8c2402de679c45e5814d9c2bc41d5e3682eb (diff)
Revert "Gjoranv/use container service type"
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java5
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/application/ConfigConvergenceChecker.java7
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java7
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/serviceview/ServiceModel.java6
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/SuperModelControllerTest.java3
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/application/HttpProxyTest.java9
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/application/MockModel.java4
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandlerTest.java3
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java5
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/serviceview/ServiceModelTest.java3
10 files changed, 18 insertions, 34 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 a31e0bf2fa4..ea7b6a88a9c 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
@@ -12,7 +12,6 @@ import com.yahoo.config.application.api.ApplicationMetaData;
import com.yahoo.config.application.api.DeployLogger;
import com.yahoo.config.model.api.HostInfo;
import com.yahoo.config.model.api.ServiceInfo;
-import com.yahoo.config.model.api.container.ContainerServiceType;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.Environment;
import com.yahoo.config.provision.HostFilter;
@@ -75,7 +74,6 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
-import static com.yahoo.config.model.api.container.ContainerServiceType.CLUSTERCONTROLLER_CONTAINER;
import static java.nio.file.Files.readAttributes;
/**
@@ -337,8 +335,7 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
// TODO: It would be nice to have a simple check to verify pathSuffix doesn't contain /../ components.
String relativePath = "clustercontroller-status/" + pathSuffix;
- return httpProxy.get(getApplication(applicationId), hostName,
- CLUSTERCONTROLLER_CONTAINER.serviceName, relativePath);
+ return httpProxy.get(getApplication(applicationId), hostName, "container-clustercontroller", relativePath);
}
public Long getApplicationGeneration(ApplicationId applicationId) {
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/application/ConfigConvergenceChecker.java b/configserver/src/main/java/com/yahoo/vespa/config/server/application/ConfigConvergenceChecker.java
index 877b2acb86f..771a279e0ab 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/application/ConfigConvergenceChecker.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/application/ConfigConvergenceChecker.java
@@ -31,9 +31,6 @@ import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
-import static com.yahoo.config.model.api.container.ContainerServiceType.CONTAINER;
-import static com.yahoo.config.model.api.container.ContainerServiceType.QRSERVER;
-
/**
* Checks for convergence of config generation for a given application.
*
@@ -47,8 +44,8 @@ public class ConfigConvergenceChecker extends AbstractComponent {
private static final String statePath = "/state/v1/";
private static final String configSubPath = "config";
private final static Set<String> serviceTypesToCheck = new HashSet<>(Arrays.asList(
- CONTAINER.serviceName,
- QRSERVER.serviceName,
+ "container",
+ "qrserver",
"searchnode",
"storagenode",
"distributor"
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 ceeea197440..7835ab2cf03 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
@@ -19,9 +19,6 @@ import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import static com.yahoo.config.model.api.container.ContainerServiceType.CONTAINER;
-import static com.yahoo.config.model.api.container.ContainerServiceType.QRSERVER;
-
/**
* Produces lb-services cfg
*
@@ -71,8 +68,8 @@ public class LbServicesProducer implements LbServicesConfig.Producer {
boolean activeRotation = false;
for (HostInfo hostInfo : app.getModel().getHosts()) {
Optional<ServiceInfo> container = hostInfo.getServices().stream().filter(
- serviceInfo -> serviceInfo.getServiceType().equals(CONTAINER.serviceName) ||
- serviceInfo.getServiceType().equals(QRSERVER.serviceName)).
+ serviceInfo -> serviceInfo.getServiceType().equals("container") ||
+ serviceInfo.getServiceType().equals("qrserver")).
findAny();
if (container.isPresent()) {
activeRotation |= Boolean.valueOf(container.get().getProperty("activeRotation").orElse("false"));
diff --git a/configserver/src/main/java/com/yahoo/vespa/serviceview/ServiceModel.java b/configserver/src/main/java/com/yahoo/vespa/serviceview/ServiceModel.java
index c9574ffaa7e..3c6a20ff58f 100644
--- a/configserver/src/main/java/com/yahoo/vespa/serviceview/ServiceModel.java
+++ b/configserver/src/main/java/com/yahoo/vespa/serviceview/ServiceModel.java
@@ -21,8 +21,6 @@ import com.yahoo.vespa.serviceview.bindings.ServiceView;
import edu.umd.cs.findbugs.annotations.NonNull;
-import static com.yahoo.config.model.api.container.ContainerServiceType.CLUSTERCONTROLLER_CONTAINER;
-
/**
* A transposed view for cloud.config.model.
*
@@ -30,6 +28,8 @@ import static com.yahoo.config.model.api.container.ContainerServiceType.CLUSTERC
*/
public final class ServiceModel {
+ private static final String CLUSTERCONTROLLER_TYPENAME = "container-clustercontroller";
+
private static final String CONTENT_CLUSTER_TYPENAME = "content";
private final Map<String, Service> servicesMap;
@@ -169,7 +169,7 @@ public final class ServiceModel {
private Service getFirstClusterController() {
// This is used assuming all cluster controllers know of all fleet controllers in an application
- return getFirstServiceInstanceByType(CLUSTERCONTROLLER_CONTAINER.serviceName);
+ return getFirstServiceInstanceByType(CLUSTERCONTROLLER_TYPENAME);
}
private StringBuilder getLinkBuilder(String uriBase) {
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/SuperModelControllerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/SuperModelControllerTest.java
index 97496bd4177..bfbf717bb1c 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/SuperModelControllerTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/SuperModelControllerTest.java
@@ -34,7 +34,6 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Optional;
-import static com.yahoo.config.model.api.container.ContainerServiceType.QRSERVER;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
@@ -147,7 +146,7 @@ public class SuperModelControllerTest {
assertThat(hosts.hostname(), is(host));
for (Map.Entry<String, Applications.Hosts.Services> e : app.hosts(host).services().entrySet()) {
System.out.println(e.getKey());
- if (QRSERVER.serviceName.equals(e.getKey())) {
+ if ("qrserver".equals(e.getKey())) {
Applications.Hosts.Services s = e.getValue();
System.out.println(s);
assertThat(s.type(), is("qrserver"));
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/application/HttpProxyTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/application/HttpProxyTest.java
index 32fe6ab82b5..88920895014 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/application/HttpProxyTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/application/HttpProxyTest.java
@@ -12,7 +12,6 @@ import org.mockito.ArgumentCaptor;
import java.net.URL;
-import static com.yahoo.config.model.api.container.ContainerServiceType.CLUSTERCONTROLLER_CONTAINER;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
@@ -40,8 +39,8 @@ public class HttpProxyTest {
HttpResponse response = new StaticResponse(200, "application/json", "body");
when(fetcher.get(actualParams.capture(), actualUrl.capture())).thenReturn(response);
- HttpResponse actualResponse = proxy.get(applicationMock, hostname, CLUSTERCONTROLLER_CONTAINER.serviceName,
- "clustercontroller-status/v1/clusterName");
+ HttpResponse actualResponse = proxy.get(
+ applicationMock, hostname, "container-clustercontroller", "clustercontroller-status/v1/clusterName");
assertEquals(1, actualParams.getAllValues().size());
assertEquals(2000, actualParams.getValue().readTimeoutMs);
@@ -59,7 +58,7 @@ public class HttpProxyTest {
public void testFetchException() {
when(fetcher.get(any(), any())).thenThrow(new RequestTimeoutException("timed out"));
- HttpResponse actualResponse = proxy.get(applicationMock, hostname, CLUSTERCONTROLLER_CONTAINER.serviceName,
- "clustercontroller-status/v1/clusterName");
+ HttpResponse actualResponse = proxy.get(
+ applicationMock, hostname, "container-clustercontroller", "clustercontroller-status/v1/clusterName");
}
}
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/application/MockModel.java b/configserver/src/test/java/com/yahoo/vespa/config/server/application/MockModel.java
index 433a63f4ad2..dcc60de0a3a 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/application/MockModel.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/application/MockModel.java
@@ -23,8 +23,6 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
-import static com.yahoo.config.model.api.container.ContainerServiceType.CLUSTERCONTROLLER_CONTAINER;
-
/**
* Model with two services, one that does not have a state port
*
@@ -49,7 +47,7 @@ public class MockModel implements Model {
ServiceInfo container = createServiceInfo(
hostname,
"foo", // name
- CLUSTERCONTROLLER_CONTAINER.serviceName,
+ "container-clustercontroller", // type
ClusterSpec.Type.container,
statePort,
"state http external query");
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 d3dcbcc2252..2c84e2d8ad4 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
@@ -40,7 +40,6 @@ import static com.github.tomakehurst.wiremock.client.WireMock.get;
import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
-import static com.yahoo.config.model.api.container.ContainerServiceType.CLUSTERCONTROLLER_CONTAINER;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
@@ -168,7 +167,7 @@ public class ApplicationHandlerTest {
new ConfigserverConfig(new ConfigserverConfig.Builder()),
new OrchestratorMock());
ApplicationHandler mockHandler = createApplicationHandler(applicationRepository);
- when(mockHttpProxy.get(any(), eq(host), eq(CLUSTERCONTROLLER_CONTAINER.serviceName),eq("clustercontroller-status/v1/clusterName1")))
+ when(mockHttpProxy.get(any(), eq(host), eq("container-clustercontroller"), eq("clustercontroller-status/v1/clusterName1")))
.thenReturn(new StaticResponse(200, "text/html", "<html>...</html>"));
HttpResponse response = mockHandler.handle(HttpRequest.createTestRequest(url, com.yahoo.jdisc.http.HttpRequest.Method.GET));
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 352245757ca..a7c4131d620 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
@@ -30,7 +30,6 @@ import java.util.Map;
import java.util.Random;
import java.util.Set;
-import static com.yahoo.config.model.api.container.ContainerServiceType.QRSERVER;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
@@ -63,7 +62,7 @@ public class LbServicesProducerTest {
public void testConfigAliases() throws IOException, SAXException {
Map<TenantName, Set<ApplicationInfo>> testModel = createTestModel(new DeployState.Builder());
LbServicesConfig conf = getLbServicesConfig(Zone.defaultZone(), testModel);
- final LbServicesConfig.Tenants.Applications.Hosts.Services services = conf.tenants("foo").applications("foo:prod:default:default").hosts("foo.foo.yahoo.com").services(QRSERVER.serviceName);
+ final LbServicesConfig.Tenants.Applications.Hosts.Services services = conf.tenants("foo").applications("foo:prod:default:default").hosts("foo.foo.yahoo.com").services("qrserver");
assertThat(services.servicealiases().size(), is(1));
assertThat(services.endpointaliases().size(), is(2));
@@ -107,7 +106,7 @@ public class LbServicesProducerTest {
Map<TenantName, Set<ApplicationInfo>> testModel = createTestModel(new DeployState.Builder().rotations(rotations));
RegionName regionName = RegionName.from("us-east-1");
LbServicesConfig conf = getLbServicesConfig(new Zone(Environment.prod, regionName), testModel);
- final LbServicesConfig.Tenants.Applications.Hosts.Services services = conf.tenants("foo").applications("foo:prod:" + regionName.value() + ":default").hosts("foo.foo.yahoo.com").services(QRSERVER.serviceName);
+ final LbServicesConfig.Tenants.Applications.Hosts.Services services = conf.tenants("foo").applications("foo:prod:" + regionName.value() + ":default").hosts("foo.foo.yahoo.com").services("qrserver");
assertThat(services.servicealiases().size(), is(1));
assertThat(services.endpointaliases().size(), is(4));
diff --git a/configserver/src/test/java/com/yahoo/vespa/serviceview/ServiceModelTest.java b/configserver/src/test/java/com/yahoo/vespa/serviceview/ServiceModelTest.java
index 93fe424710e..c7b08c08387 100644
--- a/configserver/src/test/java/com/yahoo/vespa/serviceview/ServiceModelTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/serviceview/ServiceModelTest.java
@@ -14,7 +14,6 @@ import org.junit.Test;
import java.util.Arrays;
import java.util.Collections;
-import static com.yahoo.config.model.api.container.ContainerServiceType.CLUSTERCONTROLLER_CONTAINER;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -55,7 +54,7 @@ public class ServiceModelTest {
service1.clustername = "examplecluster";
service1.clustertype = "somethingservers";
service1.index = 2L;
- service1.type = CLUSTERCONTROLLER_CONTAINER.serviceName;
+ service1.type = "container-clustercontroller";
service1.name = "clustercontroller";
service1.configid = "clustercontroller/lbl.0";
ServicePort port = new ServicePort();