summaryrefslogtreecommitdiffstats
path: root/orchestrator
diff options
context:
space:
mode:
authorHÃ¥kon Hallingstad <hakon@verizonmedia.com>2019-03-22 15:33:20 +0100
committergjoranv <gv@verizonmedia.com>2019-03-22 17:59:32 +0100
commit523b8bd41e92370859783e2043ba319404dc2dcb (patch)
tree83bce3a47065f8f96d517769d79208091f122641 /orchestrator
parent58afd0dc6a98ef26994fb526b7499a0e71defe28 (diff)
Orchestrator Support for metrics proxy
Diffstat (limited to 'orchestrator')
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java2
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaClusterPolicy.java4
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ServiceClusterSuspendPolicy.java35
3 files changed, 5 insertions, 36 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 4dd8133d2e9..61fe871ccc8 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
@@ -43,6 +43,7 @@ public class VespaModelUtil {
public static final ServiceType DISTRIBUTOR_SERVICE_TYPE = new ServiceType("distributor");
public static final ServiceType SEARCHNODE_SERVICE_TYPE = new ServiceType("searchnode");
public static final ServiceType STORAGENODE_SERVICE_TYPE = new ServiceType("storagenode");
+ public static final ServiceType METRICS_PROXY_SERVICE_TYPE = new ServiceType("metricsproxy-container");
private static final Comparator<ServiceInstance> CLUSTER_CONTROLLER_INDEX_COMPARATOR =
Comparator.comparing(serviceInstance -> VespaModelUtil.getClusterControllerIndex(serviceInstance.configId()));
@@ -235,5 +236,4 @@ public class VespaModelUtil {
return Integer.valueOf(matcher.group(1));
}
-
}
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 f45aa8c02ac..2451ebe6fd9 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
@@ -68,6 +68,10 @@ public class HostedVespaClusterPolicy implements ClusterPolicy {
return ConcurrentSuspensionLimitForCluster.ONE_NODE;
}
+ if (VespaModelUtil.METRICS_PROXY_SERVICE_TYPE.equals(clusterApi.serviceType())) {
+ return ConcurrentSuspensionLimitForCluster.ALL_NODES;
+ }
+
if (VespaModelUtil.ADMIN_CLUSTER_ID.equals(clusterApi.clusterId())) {
if (VespaModelUtil.SLOBROK_SERVICE_TYPE.equals(clusterApi.serviceType())) {
return ConcurrentSuspensionLimitForCluster.ONE_NODE;
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ServiceClusterSuspendPolicy.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ServiceClusterSuspendPolicy.java
deleted file mode 100644
index 3f782da91e4..00000000000
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ServiceClusterSuspendPolicy.java
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2017 Yahoo Holdings. 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.ServiceCluster;
-import com.yahoo.vespa.orchestrator.model.VespaModelUtil;
-
-/**
- * @author hakonhall
- * @author bakksjo
- */
-public final class ServiceClusterSuspendPolicy {
-
- private static final int SUSPENSION_ALLOW_MINIMAL = 0;
- private static final int SUSPENSION_ALLOW_TEN_PERCENT = 10;
- private static final int SUSPENSION_ALLOW_ALL = 100;
-
- private ServiceClusterSuspendPolicy() {} // Disallow instantiation.
-
- public static int getSuspendPercentageAllowed(ServiceCluster serviceCluster) {
- if (VespaModelUtil.ADMIN_CLUSTER_ID.equals(serviceCluster.clusterId())) {
- if (VespaModelUtil.SLOBROK_SERVICE_TYPE.equals(serviceCluster.serviceType())) {
- return SUSPENSION_ALLOW_MINIMAL;
- }
-
- return SUSPENSION_ALLOW_ALL;
- }
-
- if (VespaModelUtil.isStorage(serviceCluster)) {
- return SUSPENSION_ALLOW_MINIMAL;
- }
-
- return SUSPENSION_ALLOW_TEN_PERCENT;
- }
-
-}