diff options
author | Valerij Fredriksen <valerijf@verizonmedia.com> | 2019-06-04 11:22:42 +0200 |
---|---|---|
committer | Valerij Fredriksen <valerijf@verizonmedia.com> | 2019-06-04 11:22:42 +0200 |
commit | dd359e0143899abbcfeef5922985c936ff24ed73 (patch) | |
tree | 950f9a46a6a9f8406da0a7c1a4106979976ec46c /orchestrator | |
parent | 8587e088b0f1fda759fb1a394f15f9f0aa415e06 (diff) |
Special handle the tenant-host application where needed
Diffstat (limited to 'orchestrator')
3 files changed, 15 insertions, 1 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java index 61fe871ccc8..71865753cd8 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java @@ -32,9 +32,11 @@ import static com.yahoo.collections.CollectionUtil.first; public class VespaModelUtil { private static final Logger log = Logger.getLogger(VespaModelUtil.class.getName()); + public static final ApplicationId TENANT_HOST_APPLICATION_ID = + ApplicationId.from("hosted-vespa", "tenant-host", "default"); + public static final ApplicationId ZONE_APPLICATION_ID = ApplicationId.from("hosted-vespa", "routing", "default"); - public static final ClusterId ADMIN_CLUSTER_ID = new ClusterId("admin"); public static final ClusterId NODE_ADMIN_CLUSTER_ID = new ClusterId("node-admin"); diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicy.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicy.java index 2451ebe6fd9..e31e015e2c8 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicy.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicy.java @@ -80,6 +80,10 @@ public class HostedVespaClusterPolicy implements ClusterPolicy { return ConcurrentSuspensionLimitForCluster.ALL_NODES; } + if (clusterApi.getApplication().applicationId().equals(VespaModelUtil.TENANT_HOST_APPLICATION_ID)) { + return ConcurrentSuspensionLimitForCluster.TWENTY_PERCENT; + } + if (clusterApi.getApplication().applicationId().equals(VespaModelUtil.ZONE_APPLICATION_ID) && clusterApi.clusterId().equals(VespaModelUtil.NODE_ADMIN_CLUSTER_ID)) { return ConcurrentSuspensionLimitForCluster.TWENTY_PERCENT; diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicyTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicyTest.java index c316f79c3d2..4cf39671271 100644 --- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicyTest.java +++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicyTest.java @@ -62,6 +62,14 @@ public class HostedVespaClusterPolicyTest { } @Test + public void testTenantHostSuspensionLimit() { + when(applicationApi.applicationId()).thenReturn(VespaModelUtil.TENANT_HOST_APPLICATION_ID); + when(clusterApi.isStorageCluster()).thenReturn(false); + assertEquals(ConcurrentSuspensionLimitForCluster.TWENTY_PERCENT, + policy.getConcurrentSuspensionLimit(clusterApi)); + } + + @Test public void testDefaultSuspensionLimit() { when(applicationApi.applicationId()).thenReturn(ApplicationId.fromSerializedForm("a:b:c")); when(clusterApi.clusterId()).thenReturn(new ClusterId("some-cluster-id")); |