summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@verizonmedia.com>2021-07-29 13:11:07 +0200
committerGitHub <noreply@github.com>2021-07-29 13:11:07 +0200
commit0ee098ce8f4fa965145849101c28d836a2552f31 (patch)
treec285c2aaadd7377c66562e00820fc8563416674d
parentfba423de8235b3b66a6cf6aa5b9502de8607f9e6 (diff)
parentf046f8cf92f4a07183c6d6baa0e22066d7b1fc51 (diff)
Merge pull request #18653 from vespa-engine/revert-18650-hakonhall/orc-of-proxies
Revert "Pass around orchestration parameters"
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstanceId.java3
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/ClusterId.java2
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceCluster.java16
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiFactory.java11
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java9
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java8
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ApplicationParams.java68
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ClusterParams.java61
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaOrchestration.java106
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/OrchestrationParams.java53
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java17
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ModelTestUtils.java17
-rw-r--r--service-monitor/src/main/java/com/yahoo/vespa/service/duper/InfraApplication.java2
-rw-r--r--service-monitor/src/main/java/com/yahoo/vespa/service/duper/ProxyApplication.java21
14 files changed, 18 insertions, 376 deletions
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstanceId.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstanceId.java
index ed2b06a18f3..801213dcf40 100644
--- a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstanceId.java
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstanceId.java
@@ -16,9 +16,6 @@ public class ApplicationInstanceId {
public boolean isConfigServerHost() { return id.startsWith("configserver-host:"); }
public static final ApplicationInstanceId CONTROLLER_HOST = new ApplicationInstanceId("controller-host:prod:default:default");
public boolean isTenantHost() { return id.startsWith("tenant-host:"); }
- public boolean isProxyHost() { return id.startsWith("proxy-host:"); }
- // Routing application instance ID is of the form: routing:prod:eu-west-1:default
- public boolean isProxy() { return id.startsWith("routing:"); }
private final String id;
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ClusterId.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ClusterId.java
index 40fdbd52a92..d7995b41616 100644
--- a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ClusterId.java
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ClusterId.java
@@ -14,8 +14,6 @@ public class ClusterId {
public static final ClusterId CONTROLLER = new ClusterId("controller");
public static final ClusterId CONFIG_SERVER_HOST = new ClusterId("configserver-host");
public static final ClusterId CONTROLLER_HOST = new ClusterId("controller-host");
- public static final ClusterId PROXY_HOST = new ClusterId("proxy-host");
- public static final ClusterId ROUTING = new ClusterId("routing");
public static final ClusterId TENANT_HOST = new ClusterId("tenant-host");
private final String id;
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceCluster.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceCluster.java
index f7398d0478f..baede298896 100644
--- a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceCluster.java
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceCluster.java
@@ -98,28 +98,12 @@ public class ServiceCluster {
Objects.equals(serviceType, ServiceType.HOST_ADMIN);
}
- @JsonIgnore
- public boolean isProxy() {
- return isHostedVespaApplicationWithPredicate(ApplicationInstanceId::isProxy) &&
- Objects.equals(clusterId, ClusterId.ROUTING) &&
- Objects.equals(serviceType, ServiceType.CONTAINER);
- }
-
- @JsonIgnore
- public boolean isProxyHost() {
- return isHostedVespaApplicationWithPredicate(ApplicationInstanceId::isProxyHost) &&
- Objects.equals(clusterId, ClusterId.PROXY_HOST) &&
- Objects.equals(serviceType, ServiceType.HOST_ADMIN);
- }
-
public String nodeDescription(boolean plural) {
String pluralSuffix = plural ? "s" : "";
return isConfigServer() ? "config server" + pluralSuffix :
isConfigServerHost() ? "config server host" + pluralSuffix :
isController() ? "controller" + pluralSuffix :
isControllerHost() ? "controller host" + pluralSuffix :
- isProxy() ? (plural ? "proxies" : "proxy") :
- isProxyHost() ? "proxy host" + pluralSuffix :
isTenantHost() ? "tenant host" + pluralSuffix :
"node" + pluralSuffix + " of {" + serviceType + "," + clusterId + "}";
}
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiFactory.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiFactory.java
index a3f2fd6e235..d913a1791ba 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiFactory.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiFactory.java
@@ -1,11 +1,7 @@
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.orchestrator.model;
-import com.yahoo.config.provision.ApplicationId;
-import com.yahoo.vespa.orchestrator.OrchestratorUtil;
import com.yahoo.vespa.orchestrator.controller.ClusterControllerClientFactory;
-import com.yahoo.vespa.orchestrator.policy.HostedVespaOrchestration;
-import com.yahoo.vespa.orchestrator.policy.OrchestrationParams;
import com.yahoo.vespa.orchestrator.status.ApplicationLock;
import java.time.Clock;
@@ -15,20 +11,19 @@ import java.time.Clock;
*/
public class ApplicationApiFactory {
- private final OrchestrationParams orchestrationParams;
+ private final int numberOfConfigServers;
private final Clock clock;
public ApplicationApiFactory(int numberOfConfigServers, Clock clock) {
- this.orchestrationParams = HostedVespaOrchestration.create(numberOfConfigServers, 0);
+ this.numberOfConfigServers = numberOfConfigServers;
this.clock = clock;
}
public ApplicationApi create(NodeGroup nodeGroup,
ApplicationLock lock,
ClusterControllerClientFactory clusterControllerClientFactory) {
- ApplicationId applicationId = OrchestratorUtil.toApplicationId(lock.getApplicationInstanceReference());
return new ApplicationApiImpl(nodeGroup, lock, clusterControllerClientFactory,
- orchestrationParams.getApplicationParams(applicationId), clock);
+ numberOfConfigServers, clock);
}
}
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java
index 804aff70a7f..efbf9ff7981 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java
@@ -9,7 +9,6 @@ import com.yahoo.vespa.applicationmodel.ServiceInstance;
import com.yahoo.vespa.orchestrator.OrchestratorContext;
import com.yahoo.vespa.orchestrator.OrchestratorUtil;
import com.yahoo.vespa.orchestrator.controller.ClusterControllerClientFactory;
-import com.yahoo.vespa.orchestrator.policy.ApplicationParams;
import com.yahoo.vespa.orchestrator.status.ApplicationInstanceStatus;
import com.yahoo.vespa.orchestrator.status.ApplicationLock;
import com.yahoo.vespa.orchestrator.status.HostInfos;
@@ -39,13 +38,13 @@ public class ApplicationApiImpl implements ApplicationApi {
public ApplicationApiImpl(NodeGroup nodeGroup,
ApplicationLock lock,
ClusterControllerClientFactory clusterControllerClientFactory,
- ApplicationParams params, Clock clock) {
+ int numberOfConfigServers, Clock clock) {
this.applicationInstance = nodeGroup.getApplication();
this.nodeGroup = nodeGroup;
this.lock = lock;
this.clock = clock;
this.hostInfos = lock.getHostInfos();
- this.clusterInOrder = makeClustersInOrder(nodeGroup, hostInfos, clusterControllerClientFactory, params);
+ this.clusterInOrder = makeClustersInOrder(nodeGroup, hostInfos, clusterControllerClientFactory, numberOfConfigServers);
}
@Override
@@ -114,7 +113,7 @@ public class ApplicationApiImpl implements ApplicationApi {
private List<ClusterApi> makeClustersInOrder(NodeGroup nodeGroup,
HostInfos hostInfos,
ClusterControllerClientFactory clusterControllerClientFactory,
- ApplicationParams params) {
+ int numberOfConfigServers) {
Set<ServiceCluster> clustersInGroup = getServiceClustersInGroup(nodeGroup);
return clustersInGroup.stream()
.map(serviceCluster -> new ClusterApiImpl(
@@ -123,7 +122,7 @@ public class ApplicationApiImpl implements ApplicationApi {
nodeGroup,
hostInfos,
clusterControllerClientFactory,
- params.clusterParamsFor(serviceCluster.clusterId(), serviceCluster.serviceType()),
+ numberOfConfigServers,
clock))
.sorted(ApplicationApiImpl::compareClusters)
.collect(Collectors.toList());
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java
index 6e88b227e61..57dcb5f3069 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java
@@ -8,7 +8,6 @@ import com.yahoo.vespa.applicationmodel.ServiceInstance;
import com.yahoo.vespa.applicationmodel.ServiceStatus;
import com.yahoo.vespa.applicationmodel.ServiceType;
import com.yahoo.vespa.orchestrator.controller.ClusterControllerClientFactory;
-import com.yahoo.vespa.orchestrator.policy.ClusterParams;
import com.yahoo.vespa.orchestrator.policy.SuspensionReasons;
import com.yahoo.vespa.orchestrator.status.HostInfos;
import com.yahoo.vespa.orchestrator.status.HostStatus;
@@ -60,7 +59,7 @@ class ClusterApiImpl implements ClusterApi {
NodeGroup nodeGroup,
HostInfos hostInfos,
ClusterControllerClientFactory clusterControllerClientFactory,
- ClusterParams clusterParams,
+ int numberOfConfigServers,
Clock clock) {
this.applicationApi = applicationApi;
this.serviceCluster = serviceCluster;
@@ -82,8 +81,9 @@ class ClusterApiImpl implements ClusterApi {
servicesDownAndNotInGroup = servicesNotInGroup.stream().filter(this::serviceEffectivelyDown).collect(Collectors.toSet());
int serviceInstances = serviceCluster.serviceInstances().size();
- if (clusterParams.size().isPresent() && serviceInstances < clusterParams.size().getAsInt()) {
- missingServices = clusterParams.size().getAsInt() - serviceInstances;
+ if ((serviceCluster.isConfigServerLike() || serviceCluster.isConfigServerHostLike()) &&
+ serviceInstances < numberOfConfigServers) {
+ missingServices = numberOfConfigServers - serviceInstances;
descriptionOfMissingServices = missingServices + " missing " + serviceCluster.nodeDescription(missingServices > 1);
} else {
missingServices = 0;
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ApplicationParams.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ApplicationParams.java
deleted file mode 100644
index 97574fc90ce..00000000000
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ApplicationParams.java
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.orchestrator.policy;
-
-import com.yahoo.vespa.applicationmodel.ClusterId;
-import com.yahoo.vespa.applicationmodel.ServiceCluster;
-import com.yahoo.vespa.applicationmodel.ServiceClusterKey;
-import com.yahoo.vespa.applicationmodel.ServiceType;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Per-application parameters controlling the orchestration.
- *
- * @author hakonhall
- */
-public class ApplicationParams {
-
- private static final ApplicationParams DEFAULT = new ApplicationParams.Builder().build();
-
- private final Map<ServiceClusterKey, ClusterParams> clusterParams;
-
- public static class Builder {
- private final Map<ServiceClusterKey, ClusterParams> clusterParams = new HashMap<>();
-
- public Builder() {}
-
- public Builder add(ClusterId clusterId, ServiceType serviceType, ClusterParams clusterParams) {
- this.clusterParams.put(new ServiceClusterKey(clusterId, serviceType), clusterParams);
- return this;
- }
-
- public ApplicationParams build() {
- return new ApplicationParams(clusterParams);
- }
- }
-
- public static ApplicationParams getDefault() {
- return DEFAULT;
- }
-
- private ApplicationParams(Map<ServiceClusterKey, ClusterParams> clusterParams) {
- this.clusterParams = Map.copyOf(clusterParams);
- }
-
- public ClusterParams clusterParamsFor(ServiceCluster serviceCluster) {
- return clusterParamsFor(serviceCluster.clusterId(), serviceCluster.serviceType());
- }
-
- public ClusterParams clusterParamsFor(ClusterId clusterId, ServiceType serviceType) {
- var key = new ServiceClusterKey(clusterId, serviceType);
- return clusterParams.getOrDefault(key, ClusterParams.getDefault());
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- ApplicationParams that = (ApplicationParams) o;
- return clusterParams.equals(that.clusterParams);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(clusterParams);
- }
-}
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ClusterParams.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ClusterParams.java
deleted file mode 100644
index b6f90ab7302..00000000000
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ClusterParams.java
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.orchestrator.policy;
-
-import java.util.Objects;
-import java.util.OptionalInt;
-
-/**
- * Parameters controlling orchestration of a particular service cluster of an implied application.
- *
- * @author hakonhall
- */
-public class ClusterParams {
-
- private static final ClusterParams DEFAULT = new ClusterParams.Builder().build();
-
- private final int size;
-
- public static class Builder {
- private int size = 0;
-
- public Builder() {}
-
- public Builder setSize(int size) {
- this.size = size;
- return this;
- }
-
- public ClusterParams build() {
- return new ClusterParams(size);
- }
- }
-
- public static ClusterParams getDefault() {
- return DEFAULT;
- }
-
- private ClusterParams(int size) {
- this.size = size;
- }
-
- /**
- * The expected and ideal number of members of the cluster: Count missing services as down,
- * and expected to be added to the application soon.
- */
- public OptionalInt size() {
- return size > 0 ? OptionalInt.of(size) : OptionalInt.empty();
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- ClusterParams that = (ClusterParams) o;
- return size == that.size;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(size);
- }
-}
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaOrchestration.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaOrchestration.java
deleted file mode 100644
index d444f922f82..00000000000
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaOrchestration.java
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.orchestrator.policy;
-
-import com.yahoo.cloud.config.ConfigserverConfig;
-import com.yahoo.vespa.applicationmodel.ClusterId;
-import com.yahoo.vespa.applicationmodel.ServiceType;
-import com.yahoo.vespa.service.duper.ConfigServerApplication;
-import com.yahoo.vespa.service.duper.ConfigServerHostApplication;
-import com.yahoo.vespa.service.duper.ControllerApplication;
-import com.yahoo.vespa.service.duper.ControllerHostApplication;
-import com.yahoo.vespa.service.duper.ProxyApplication;
-import com.yahoo.vespa.service.duper.ProxyHostApplication;
-
-/**
- * Creates orchestration parameters for hosted Vespa.
- *
- * @author hakonhall
- */
-public class HostedVespaOrchestration {
- public static OrchestrationParams create(ConfigserverConfig configserverConfig) {
- // todo: get the number of proxy nodes
- return create(configserverConfig.zookeeperserver().size(), 0);
- }
-
- public static OrchestrationParams create(int numConfigServers, int numProxies) {
- // We'll create parameters for both the controller and config server applications, even though
- // only one of them is present, as (a) no harm is done by having the extra parameters, and
- // (b) it leads to simpler code below.
-
- return new OrchestrationParams.Builder()
-
- // Controller host
- .addApplicationParams(new ControllerHostApplication().getApplicationId(),
- new ApplicationParams
- .Builder()
- .add(ClusterId.CONTROLLER,
- ServiceType.HOST_ADMIN,
- new ClusterParams
- .Builder()
- .setSize(numConfigServers)
- .build())
- .build())
-
- // Controller
- .addApplicationParams(new ControllerApplication().getApplicationId(),
- new ApplicationParams
- .Builder()
- .add(ClusterId.CONTROLLER,
- ServiceType.CONTROLLER,
- new ClusterParams
- .Builder()
- .setSize(numConfigServers)
- .build())
- .build())
-
- // Config server host
- .addApplicationParams(new ConfigServerHostApplication().getApplicationId(),
- new ApplicationParams
- .Builder()
- .add(ClusterId.CONFIG_SERVER_HOST,
- ServiceType.HOST_ADMIN,
- new ClusterParams
- .Builder()
- .setSize(numConfigServers)
- .build())
- .build())
-
- // Config server
- .addApplicationParams(new ConfigServerApplication().getApplicationId(),
- new ApplicationParams
- .Builder()
- .add(ClusterId.CONFIG_SERVER,
- ServiceType.CONFIG_SERVER,
- new ClusterParams
- .Builder()
- .setSize(numConfigServers)
- .build())
- .build())
-
- // Proxy host
- .addApplicationParams(new ProxyHostApplication().getApplicationId(),
- new ApplicationParams
- .Builder()
- .add(ClusterId.PROXY_HOST,
- ServiceType.HOST_ADMIN,
- new ClusterParams
- .Builder()
- .setSize(numProxies)
- .build())
- .build())
-
- // Proxy
- .addApplicationParams(new ProxyApplication().getApplicationId(),
- new ApplicationParams
- .Builder()
- .add(ClusterId.ROUTING,
- ServiceType.CONTAINER,
- new ClusterParams
- .Builder()
- .setSize(numProxies)
- .build())
- .build())
-
- .build();
- }
-}
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/OrchestrationParams.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/OrchestrationParams.java
deleted file mode 100644
index 7519564b080..00000000000
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/OrchestrationParams.java
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.orchestrator.policy;
-
-import com.yahoo.config.provision.ApplicationId;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Parameters controlling orchestration.
- *
- * @author hakonhall
- */
-public class OrchestrationParams {
- private final Map<ApplicationId, ApplicationParams> applicationParams;
-
- public static class Builder {
- private final Map<ApplicationId, ApplicationParams> applicationParams = new HashMap<>();
-
- public Builder() {}
-
- public Builder addApplicationParams(ApplicationId applicationId, ApplicationParams params) {
- this.applicationParams.put(applicationId, params);
- return this;
- }
-
- public OrchestrationParams build() {
- return new OrchestrationParams(applicationParams);
- }
- }
-
- private OrchestrationParams(Map<ApplicationId, ApplicationParams> applicationParams) {
- this.applicationParams = Map.copyOf(applicationParams);
- }
-
- public ApplicationParams getApplicationParams(ApplicationId applicationId) {
- return applicationParams.getOrDefault(applicationId, ApplicationParams.getDefault());
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- OrchestrationParams that = (OrchestrationParams) o;
- return applicationParams.equals(that.applicationParams);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(applicationParams);
- }
-}
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java
index 237d418aae5..6bf46052933 100644
--- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java
+++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java
@@ -13,7 +13,6 @@ import com.yahoo.vespa.applicationmodel.ServiceType;
import com.yahoo.vespa.flags.Flags;
import com.yahoo.vespa.flags.InMemoryFlagSource;
import com.yahoo.vespa.orchestrator.OrchestratorUtil;
-import com.yahoo.vespa.orchestrator.policy.ClusterParams;
import com.yahoo.vespa.orchestrator.policy.HostStateChangeDeniedException;
import com.yahoo.vespa.orchestrator.policy.HostedVespaClusterPolicy;
import com.yahoo.vespa.orchestrator.policy.SuspensionReasons;
@@ -89,9 +88,7 @@ public class ClusterApiImplTest {
serviceCluster,
new NodeGroup(modelUtils.createApplicationInstance(new ArrayList<>()), hostName5),
modelUtils.getHostInfos(),
- modelUtils.getClusterControllerClientFactory(),
- ModelTestUtils.APPLICATION_PARAMS.clusterParamsFor(serviceCluster),
- clock);
+ modelUtils.getClusterControllerClientFactory(), ModelTestUtils.NUMBER_OF_CONFIG_SERVERS, clock);
assertEquals("{ clusterId=cluster, serviceType=service-type }", clusterApi.clusterInfo());
assertFalse(clusterApi.isStorageCluster());
@@ -277,9 +274,7 @@ public class ClusterApiImplTest {
serviceCluster,
new NodeGroup(modelUtils.createApplicationInstance(new ArrayList<>()), groupNodes),
modelUtils.getHostInfos(),
- modelUtils.getClusterControllerClientFactory(),
- ModelTestUtils.APPLICATION_PARAMS.clusterParamsFor(serviceCluster),
- clock);
+ modelUtils.getClusterControllerClientFactory(), ModelTestUtils.NUMBER_OF_CONFIG_SERVERS, clock);
assertEquals(expectedNoServicesInGroupIsUp.map(SuspensionReasons::getMessagesInOrder),
clusterApi.reasonsForNoServicesInGroupIsUp().map(SuspensionReasons::getMessagesInOrder));
@@ -310,9 +305,7 @@ public class ClusterApiImplTest {
serviceCluster,
new NodeGroup(applicationInstance, hostName1, hostName3),
new HostInfos(),
- modelUtils.getClusterControllerClientFactory(),
- ModelTestUtils.APPLICATION_PARAMS.clusterParamsFor(serviceCluster),
- clock);
+ modelUtils.getClusterControllerClientFactory(), ModelTestUtils.NUMBER_OF_CONFIG_SERVERS, clock);
assertTrue(clusterApi.isStorageCluster());
assertEquals(Optional.of(hostName1), clusterApi.storageNodeInGroup().map(storageNode -> storageNode.hostName()));
@@ -360,9 +353,7 @@ public class ClusterApiImplTest {
serviceCluster,
new NodeGroup(application, hostnames.get(0)),
modelUtils.getHostInfos(),
- modelUtils.getClusterControllerClientFactory(),
- new ClusterParams.Builder().setSize(clusterSize).build(),
- clock);
+ modelUtils.getClusterControllerClientFactory(), clusterSize, clock);
assertEquals(clusterSize - serviceStatusList.size(), clusterApi.missingServices());
assertEquals(clusterSize == serviceStatusList.size(), clusterApi.noServicesOutsideGroupIsDown());
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ModelTestUtils.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ModelTestUtils.java
index 6ec03ba3c44..7cb20350845 100644
--- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ModelTestUtils.java
+++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ModelTestUtils.java
@@ -24,14 +24,10 @@ import com.yahoo.vespa.orchestrator.OrchestrationException;
import com.yahoo.vespa.orchestrator.Orchestrator;
import com.yahoo.vespa.orchestrator.OrchestratorContext;
import com.yahoo.vespa.orchestrator.OrchestratorImpl;
-import com.yahoo.vespa.orchestrator.OrchestratorUtil;
import com.yahoo.vespa.orchestrator.controller.ClusterControllerClientFactory;
import com.yahoo.vespa.orchestrator.controller.ClusterControllerClientFactoryMock;
-import com.yahoo.vespa.orchestrator.policy.ApplicationParams;
import com.yahoo.vespa.orchestrator.policy.HostedVespaClusterPolicy;
-import com.yahoo.vespa.orchestrator.policy.HostedVespaOrchestration;
import com.yahoo.vespa.orchestrator.policy.HostedVespaPolicy;
-import com.yahoo.vespa.orchestrator.policy.OrchestrationParams;
import com.yahoo.vespa.orchestrator.status.ApplicationLock;
import com.yahoo.vespa.orchestrator.status.HostInfo;
import com.yahoo.vespa.orchestrator.status.HostInfos;
@@ -58,16 +54,7 @@ import static org.mockito.Mockito.mock;
*/
class ModelTestUtils {
- private static final TenantId TENANT_ID = new TenantId("tenant");
- private static final ApplicationInstanceId APPLICATION_INSTANCE_ID =
- new ApplicationInstanceId("application-name:foo:bar:default");
-
public static final int NUMBER_OF_CONFIG_SERVERS = 3;
- public static final OrchestrationParams ORCHESTRATION_PARAMS =
- HostedVespaOrchestration.create(NUMBER_OF_CONFIG_SERVERS, 0);
- public static final ApplicationParams APPLICATION_PARAMS = ORCHESTRATION_PARAMS
- .getApplicationParams(OrchestratorUtil.toApplicationId(
- new ApplicationInstanceReference(TENANT_ID, APPLICATION_INSTANCE_ID)));
private final InMemoryFlagSource flagSource = new InMemoryFlagSource();
private final Map<ApplicationInstanceReference, ApplicationInstance> applications = new HashMap<>();
@@ -147,8 +134,8 @@ class ModelTestUtils {
Set<ServiceCluster> serviceClusterSet = new HashSet<>(serviceClusters);
ApplicationInstance application = new ApplicationInstance(
- TENANT_ID,
- APPLICATION_INSTANCE_ID,
+ new TenantId("tenant"),
+ new ApplicationInstanceId("application-name:foo:bar:default"),
serviceClusterSet);
applications.put(application.reference(), application);
diff --git a/service-monitor/src/main/java/com/yahoo/vespa/service/duper/InfraApplication.java b/service-monitor/src/main/java/com/yahoo/vespa/service/duper/InfraApplication.java
index c53d47ee6a3..1bdf1ff67d9 100644
--- a/service-monitor/src/main/java/com/yahoo/vespa/service/duper/InfraApplication.java
+++ b/service-monitor/src/main/java/com/yahoo/vespa/service/duper/InfraApplication.java
@@ -35,7 +35,7 @@ import java.util.stream.Collectors;
*/
public abstract class InfraApplication implements InfraApplicationApi {
- static final TenantName TENANT_NAME = TenantName.from("hosted-vespa");
+ private static final TenantName TENANT_NAME = TenantName.from("hosted-vespa");
private final ApplicationId applicationId;
private final Capacity capacity;
diff --git a/service-monitor/src/main/java/com/yahoo/vespa/service/duper/ProxyApplication.java b/service-monitor/src/main/java/com/yahoo/vespa/service/duper/ProxyApplication.java
deleted file mode 100644
index 7bc4facbfa8..00000000000
--- a/service-monitor/src/main/java/com/yahoo/vespa/service/duper/ProxyApplication.java
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.service.duper;
-
-import com.yahoo.config.provision.ApplicationId;
-
-/**
- * The proxy application is an ordinary non-infrastructure application. Still, it may be useful
- * to refer to e.g. the ApplicationId of the proxy application, hence this class.
- *
- * @author hakonhall
- */
-public class ProxyApplication {
- private static final ApplicationId APPLICATION_ID = new ApplicationId.Builder()
- .tenant(InfraApplication.TENANT_NAME)
- .applicationName("routing")
- .build();
-
- public ApplicationId getApplicationId() {
- return APPLICATION_ID;
- }
-}