summaryrefslogtreecommitdiffstats
path: root/docker-api
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2019-05-26 15:26:49 +0200
committerJon Bratseth <bratseth@verizonmedia.com>2019-05-26 15:26:49 +0200
commit0553c69e0bd7a9a43e74e131abe640363fc54dcc (patch)
tree7609113afb870aa53bea72ae3c93ba76648cb2f7 /docker-api
parentcbc253ca0257576f6b7a2fc23c19a37dd28f3890 (diff)
Dedicate min vcpu in dev + improved javadoc
Diffstat (limited to 'docker-api')
-rw-r--r--docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/ContainerResources.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/ContainerResources.java b/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/ContainerResources.java
index 1b0b6380481..c3c4ca19555 100644
--- a/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/ContainerResources.java
+++ b/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/ContainerResources.java
@@ -44,16 +44,17 @@ public class ContainerResources {
/**
* Create container resources from required fields.
*
- * @param cpus the amount of vcpu that should be exclusively available to this container. This is a hard limit:
- * More than this amlunt will never be available. To allow an unlimited amount use 0.
- * @param cpuCores the amount of vcpu that should ideally be allocated to this container if there are no other
- * constraints on resources. To allow an unlimited amount use 0.
- * @param memoryGb the exact amount of memory that must be available to this container.
+ * @param maxVcpu the amount of vcpu that allocation policies should allocate exclusively to this container.
+ * This is a hard upper limit. To allow an unlimited amount use 0.
+ * @param minVcpu the minimal amount of vcpu dedicated to this container.
+ * To avoid dedicating any cpu at all, use 0.
+ * @param memoryGb the amount of memory that allocation policies should allocate to this container.
+ * This is a hard upper limit. To allow the container to allocate an unlimited amount use 0.
* @return the container resources encapsulating the parameters
*/
- public static ContainerResources from(double cpus, double cpuCores, double memoryGb) {
- return new ContainerResources(cpus,
- (int) Math.round(10 * cpuCores),
+ public static ContainerResources from(double maxVcpu, double minVcpu, double memoryGb) {
+ return new ContainerResources(maxVcpu,
+ (int) Math.round(10 * minVcpu),
(long) ((1L << 30) * memoryGb));
}