diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-09-14 16:02:02 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-09-14 16:02:02 +0200 |
commit | 0a64098e1950d5c2884f7ebeb9c43ed8ae9731ef (patch) | |
tree | 4d60eb59054fbfaac0a93b41c845a611c61d33ad /config-model/src/main/java/com/yahoo/vespa/model/clients | |
parent | 7987a90002395bcb4c98cb2991c79832f3e0c5e6 (diff) |
Deduplicate logic for finding cluster vcpu
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/clients')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java b/config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java index 2150b2b677a..ecf05d97fa7 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/clients/ContainerDocumentApi.java @@ -13,8 +13,6 @@ import com.yahoo.vespa.model.container.component.UserBindingPattern; import java.util.Collection; import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; /** * @author Einar M R Rosenvinge @@ -111,17 +109,6 @@ public class ContainerDocumentApi { if (vcpu == 0) return FALLBACK_CORE_POOL_SIZE; return Math.max(1, (int)Math.ceil(vcpu * options.feedThreadPoolSizeFactor * 0.5)); } - - private static double vcpu(ContainerCluster<?> cluster) { - List<Double> vcpus = cluster.getContainers().stream() - .filter(c -> c.getHostResource() != null && c.getHostResource().realResources() != null) - .map(c -> c.getHostResource().realResources().vcpu()) - .distinct() - .collect(Collectors.toList()); - // We can only use host resource for calculation if all container nodes in the cluster are homogeneous (in terms of vcpu) - if (vcpus.size() != 1 || vcpus.get(0) == 0) return 0; - return vcpus.get(0); - } } } |