summaryrefslogtreecommitdiff
path: root/opendc-compute/opendc-compute-service/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-compute/opendc-compute-service/src/main/java/org')
-rw-r--r--opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ComputeService.java8
-rw-r--r--opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ServiceFlavor.java10
-rw-r--r--opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/HostModel.java2
3 files changed, 10 insertions, 10 deletions
diff --git a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ComputeService.java b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ComputeService.java
index eda9a79f..167b13c7 100644
--- a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ComputeService.java
+++ b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ComputeService.java
@@ -171,7 +171,7 @@ public final class ComputeService implements AutoCloseable {
HostView hv = hostToView.get(host);
final ServiceFlavor flavor = serviceServer.getFlavor();
if (hv != null) {
- hv.provisionedCores -= flavor.getCpuCount();
+ hv.provisionedCores -= flavor.getCoreCount();
hv.instanceCount--;
hv.availableMemory += flavor.getMemorySize();
} else {
@@ -237,7 +237,7 @@ public final class ComputeService implements AutoCloseable {
HostView hv = new HostView(host);
HostModel model = host.getModel();
- maxCores = Math.max(maxCores, model.cpuCount());
+ maxCores = Math.max(maxCores, model.coreCount());
maxMemory = Math.max(maxMemory, model.memoryCapacity());
hostToView.put(host, hv);
@@ -370,7 +370,7 @@ public final class ComputeService implements AutoCloseable {
LOGGER.trace(
"Server {} selected for scheduling but no capacity available for it at the moment", server);
- if (flavor.getMemorySize() > maxMemory || flavor.getCpuCount() > maxCores) {
+ if (flavor.getMemorySize() > maxMemory || flavor.getCoreCount() > maxCores) {
// Remove the incoming image
queue.poll();
serversPending--;
@@ -403,7 +403,7 @@ public final class ComputeService implements AutoCloseable {
attemptsSuccess++;
hv.instanceCount++;
- hv.provisionedCores += flavor.getCpuCount();
+ hv.provisionedCores += flavor.getCoreCount();
hv.availableMemory -= flavor.getMemorySize();
activeServers.put(server, host);
diff --git a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ServiceFlavor.java b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ServiceFlavor.java
index dba87e2c..0f434a6a 100644
--- a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ServiceFlavor.java
+++ b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ServiceFlavor.java
@@ -36,7 +36,7 @@ public final class ServiceFlavor implements Flavor {
private final ComputeService service;
private final UUID uid;
private final String name;
- private final int cpuCount;
+ private final int coreCount;
private final long memorySize;
private final Map<String, String> labels;
private final Map<String, ?> meta;
@@ -45,22 +45,22 @@ public final class ServiceFlavor implements Flavor {
ComputeService service,
UUID uid,
String name,
- int cpuCount,
+ int coreCount,
long memorySize,
Map<String, String> labels,
Map<String, ?> meta) {
this.service = service;
this.uid = uid;
this.name = name;
- this.cpuCount = cpuCount;
+ this.coreCount = coreCount;
this.memorySize = memorySize;
this.labels = labels;
this.meta = meta;
}
@Override
- public int getCpuCount() {
- return cpuCount;
+ public int getCoreCount() {
+ return coreCount;
}
@Override
diff --git a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/HostModel.java b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/HostModel.java
index 9caa6da7..2d45817b 100644
--- a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/HostModel.java
+++ b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/HostModel.java
@@ -29,4 +29,4 @@ package org.opendc.compute.service.driver;
* @param cpuCount The number of logical processing cores available for this host.
* @param memoryCapacity The amount of memory available for this host in MB.
*/
-public record HostModel(double cpuCapacity, int cpuCount, long memoryCapacity) {}
+public record HostModel(double cpuCapacity, int cpuCount, int coreCount, long memoryCapacity) {}