diff options
author | Jon Bratseth <bratseth@gmail.com> | 2020-05-21 18:58:23 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2020-05-21 18:58:23 +0200 |
commit | f1b06c72b6e6d1dbe8c6596b0fe8ec8c6f13a9f2 (patch) | |
tree | 901ffe970a6e56139776118fb5e8ed2295944e12 /config-model | |
parent | b7dbfcbdd6722945019fc5ccc55729db4516328a (diff) |
Access flavor resources through resources()
Diffstat (limited to 'config-model')
3 files changed, 5 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/NodeFlavorTuning.java b/config-model/src/main/java/com/yahoo/vespa/model/container/NodeFlavorTuning.java index f9b50d0e641..247c675680b 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/NodeFlavorTuning.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/NodeFlavorTuning.java @@ -36,13 +36,13 @@ public class NodeFlavorTuning implements @Override public void getConfig(QrStartConfig.Builder builder) { - builder.jvm.availableProcessors(Math.max(2, (int)Math.ceil(flavor.getMinCpuCores()))); + builder.jvm.availableProcessors(Math.max(2, (int)Math.ceil(flavor.resources().vcpu()))); } @Override public void getConfig(ThreadpoolConfig.Builder builder) { // Controls max number of concurrent requests per container - int workerThreads = Math.max(2, (int)Math.ceil(flavor.getMinCpuCores() * threadPoolSizeFactor)); + int workerThreads = Math.max(2, (int)Math.ceil(flavor.resources().vcpu() * threadPoolSizeFactor)); builder.maxthreads(workerThreads); // This controls your burst handling capability. diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/StorageNode.java b/config-model/src/main/java/com/yahoo/vespa/model/content/StorageNode.java index c8220071373..8c3dce4d968 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/StorageNode.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/StorageNode.java @@ -88,7 +88,7 @@ public class StorageNode extends ContentNode implements StorServerConfig.Produce public void getConfig(StorFilestorConfig.Builder builder) { if (getHostResource() != null && getHostResource().getFlavor().isPresent()) { Flavor nodeFlavor = getHostResource().getFlavor().get(); - builder.num_threads(Math.max(4, (int)nodeFlavor.getMinCpuCores())); + builder.num_threads(Math.max(4, (int)nodeFlavor.resources().vcpu())); } cluster.getConfig(builder); } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/NodeFlavorTuning.java b/config-model/src/main/java/com/yahoo/vespa/model/search/NodeFlavorTuning.java index 9cea509b13b..2f0d2bcf41e 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/search/NodeFlavorTuning.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/search/NodeFlavorTuning.java @@ -64,7 +64,7 @@ public class NodeFlavorTuning implements ProtonConfig.Producer { private void setHwInfo(ProtonConfig.Builder builder) { builder.hwinfo.disk.shared(nodeFlavor.getType().equals(Flavor.Type.DOCKER_CONTAINER)); - builder.hwinfo.cpu.cores((int)nodeFlavor.getMinCpuCores()); + builder.hwinfo.cpu.cores((int)nodeFlavor.resources().vcpu()); builder.hwinfo.memory.size((long)nodeFlavor.resources().memoryGb() * GB); builder.hwinfo.disk.size((long)nodeFlavor.resources().diskGb() * GB); } @@ -113,7 +113,7 @@ public class NodeFlavorTuning implements ProtonConfig.Producer { } private void tuneRequestThreads(ProtonConfig.Builder builder) { - int numCores = (int)Math.ceil(nodeFlavor.getMinCpuCores()); + int numCores = (int)Math.ceil(nodeFlavor.resources().vcpu()); builder.numsearcherthreads(numCores*threadsPerSearch); builder.numsummarythreads(numCores); builder.numthreadspersearch(threadsPerSearch); |