summaryrefslogtreecommitdiff
path: root/opendc-compute/opendc-compute-service/src/main/java/org
diff options
context:
space:
mode:
authorDante Niewenhuis <d.niewenhuis@hotmail.com>2024-08-27 13:48:46 +0200
committerGitHub <noreply@github.com>2024-08-27 13:48:46 +0200
commit3363df4c72a064e590ca98f8e01832cfa4e15a3f (patch)
tree9a938700fe08ce344ff5d0d475d0b64d7233d1fc /opendc-compute/opendc-compute-service/src/main/java/org
parentc21708013f2746807f5bdb3fc47c2b47ed15b7c8 (diff)
Renamed input files and internally server is changed to task (#246)
* Updated SimTrace to use a single ArrayDeque instead of three separate lists for deadline, cpuUsage, and coreCount * Renamed input files to tasks.parquet and fragments.parquet. Renamed server to task. OpenDC nows exports tasks.parquet instead of server.parquet
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.java178
-rw-r--r--opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ServiceTask.java (renamed from opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ServiceServer.java)58
-rw-r--r--opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/Host.java52
-rw-r--r--opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/HostListener.java8
-rw-r--r--opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/telemetry/HostSystemStats.java2
-rw-r--r--opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/telemetry/SchedulerStats.java12
6 files changed, 153 insertions, 157 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 a7e9f509..a64f6a4e 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
@@ -44,8 +44,8 @@ import org.opendc.common.util.Pacer;
import org.opendc.compute.api.ComputeClient;
import org.opendc.compute.api.Flavor;
import org.opendc.compute.api.Image;
-import org.opendc.compute.api.Server;
-import org.opendc.compute.api.ServerState;
+import org.opendc.compute.api.Task;
+import org.opendc.compute.api.TaskState;
import org.opendc.compute.service.driver.Host;
import org.opendc.compute.service.driver.HostListener;
import org.opendc.compute.service.driver.HostModel;
@@ -68,7 +68,7 @@ public final class ComputeService implements AutoCloseable {
private final InstantSource clock;
/**
- * The {@link ComputeScheduler} responsible for placing the servers onto hosts.
+ * The {@link ComputeScheduler} responsible for placing the tasks onto hosts.
*/
private final ComputeScheduler scheduler;
@@ -98,14 +98,14 @@ public final class ComputeService implements AutoCloseable {
private final Set<HostView> availableHosts = new HashSet<>();
/**
- * The servers that should be launched by the service.
+ * The tasks that should be launched by the service.
*/
- private final Deque<SchedulingRequest> queue = new ArrayDeque<>();
+ private final Deque<SchedulingRequest> taskQueue = new ArrayDeque<>();
/**
- * The active servers in the system.
+ * The active tasks in the system.
*/
- private final Map<Server, Host> activeServers = new HashMap<>();
+ private final Map<Task, Host> activeTasks = new HashMap<>();
/**
* The registered flavors for this compute service.
@@ -122,14 +122,14 @@ public final class ComputeService implements AutoCloseable {
private final List<ServiceImage> images = new ArrayList<>();
/**
- * The registered servers for this compute service.
+ * The registered tasks for this compute service.
*/
- private final Map<UUID, ServiceServer> serverById = new HashMap<>();
+ private final Map<UUID, ServiceTask> taskById = new HashMap<>();
- private final List<ServiceServer> servers = new ArrayList<>();
+ private final List<ServiceTask> tasks = new ArrayList<>();
/**
- * A [HostListener] used to track the active servers.
+ * A [HostListener] used to track the active tasks.
*/
private final HostListener hostListener = new HostListener() {
@Override
@@ -151,28 +151,26 @@ public final class ComputeService implements AutoCloseable {
}
@Override
- public void onStateChanged(@NotNull Host host, @NotNull Server server, @NotNull ServerState newState) {
- final ServiceServer serviceServer = (ServiceServer) server;
+ public void onStateChanged(@NotNull Host host, @NotNull Task task, @NotNull TaskState newState) {
+ final ServiceTask serviceTask = (ServiceTask) task;
- if (serviceServer.getHost() != host) {
- // This can happen when a server is rescheduled and started on another machine, while being deleted from
+ if (serviceTask.getHost() != host) {
+ // This can happen when a task is rescheduled and started on another machine, while being deleted from
// the old machine.
return;
}
- serviceServer.setState(newState);
+ serviceTask.setState(newState);
- if (newState == ServerState.TERMINATED
- || newState == ServerState.DELETED
- || newState == ServerState.ERROR) {
- LOGGER.info("Server {} {} {} finished", server.getUid(), server.getName(), server.getFlavor());
+ if (newState == TaskState.TERMINATED || newState == TaskState.DELETED || newState == TaskState.ERROR) {
+ LOGGER.info("task {} {} {} finished", task.getUid(), task.getName(), task.getFlavor());
- if (activeServers.remove(server) != null) {
- serversActive--;
+ if (activeTasks.remove(task) != null) {
+ tasksActive--;
}
HostView hv = hostToView.get(host);
- final ServiceFlavor flavor = serviceServer.getFlavor();
+ final ServiceFlavor flavor = serviceTask.getFlavor();
if (hv != null) {
hv.provisionedCores -= flavor.getCoreCount();
hv.instanceCount--;
@@ -192,8 +190,8 @@ public final class ComputeService implements AutoCloseable {
private long attemptsSuccess = 0L;
private long attemptsFailure = 0L;
private long attemptsError = 0L;
- private int serversPending = 0;
- private int serversActive = 0;
+ private int tasksPending = 0;
+ private int tasksActive = 0;
/**
* Construct a {@link ComputeService} instance.
@@ -222,10 +220,10 @@ public final class ComputeService implements AutoCloseable {
}
/**
- * Return the {@link Server}s hosted by this service.
+ * Return the {@link Task}s hosted by this service.
*/
- public List<Server> getServers() {
- return Collections.unmodifiableList(servers);
+ public List<Task> getTasks() {
+ return Collections.unmodifiableList(tasks);
}
/**
@@ -265,15 +263,14 @@ public final class ComputeService implements AutoCloseable {
}
/**
- * Lookup the {@link Host} that currently hosts the specified {@link Server}.
+ * Lookup the {@link Host} that currently hosts the specified {@link Task}.
*/
- public Host lookupHost(Server server) {
- if (server instanceof ServiceServer) {
- return ((ServiceServer) server).getHost();
+ public Host lookupHost(Task task) {
+ if (task instanceof ServiceTask) {
+ return ((ServiceTask) task).getHost();
}
- ServiceServer internal =
- Objects.requireNonNull(serverById.get(server.getUid()), "Invalid server passed to lookupHost");
+ ServiceTask internal = Objects.requireNonNull(taskById.get(task.getUid()), "Invalid task passed to lookupHost");
return internal.getHost();
}
@@ -294,9 +291,9 @@ public final class ComputeService implements AutoCloseable {
attemptsSuccess,
attemptsFailure,
attemptsError,
- servers.size(),
- serversPending,
- serversActive);
+ tasks.size(),
+ tasksPending,
+ tasksActive);
}
@Override
@@ -310,17 +307,17 @@ public final class ComputeService implements AutoCloseable {
}
/**
- * Enqueue the specified [server] to be scheduled onto a host.
+ * Enqueue the specified [task] to be scheduled onto a host.
*/
- SchedulingRequest schedule(ServiceServer server) {
- LOGGER.debug("Enqueueing server {} to be assigned to host", server.getUid());
+ SchedulingRequest schedule(ServiceTask task) {
+ LOGGER.debug("Enqueueing task {} to be assigned to host", task.getUid());
long now = clock.millis();
- SchedulingRequest request = new SchedulingRequest(server, now);
+ SchedulingRequest request = new SchedulingRequest(task, now);
- server.launchedAt = Instant.ofEpochMilli(now);
- queue.add(request);
- serversPending++;
+ task.launchedAt = Instant.ofEpochMilli(now);
+ taskQueue.add(request);
+ tasksPending++;
requestSchedulingCycle();
return request;
}
@@ -335,9 +332,9 @@ public final class ComputeService implements AutoCloseable {
images.remove(image);
}
- void delete(ServiceServer server) {
- serverById.remove(server.getUid());
- servers.remove(server);
+ void delete(ServiceTask task) {
+ taskById.remove(task.getUid());
+ tasks.remove(task);
}
/**
@@ -345,7 +342,7 @@ public final class ComputeService implements AutoCloseable {
*/
private void requestSchedulingCycle() {
// Bail out in case the queue is empty.
- if (queue.isEmpty()) {
+ if (taskQueue.isEmpty()) {
return;
}
@@ -358,35 +355,34 @@ public final class ComputeService implements AutoCloseable {
private void doSchedule() {
// reorder tasks
- while (!queue.isEmpty()) {
- SchedulingRequest request = queue.peek();
+ while (!taskQueue.isEmpty()) {
+ SchedulingRequest request = taskQueue.peek();
if (request.isCancelled) {
- queue.poll();
- serversPending--;
+ taskQueue.poll();
+ tasksPending--;
continue;
}
- final ServiceServer server = request.server;
+ final ServiceTask task = request.task;
// Check if all dependencies are met
// otherwise continue
- final ServiceFlavor flavor = server.getFlavor();
- final HostView hv = scheduler.select(request.server);
+ final ServiceFlavor flavor = task.getFlavor();
+ final HostView hv = scheduler.select(request.task);
- if (hv == null || !hv.getHost().canFit(server)) {
- LOGGER.trace(
- "Server {} selected for scheduling but no capacity available for it at the moment", server);
+ if (hv == null || !hv.getHost().canFit(task)) {
+ LOGGER.trace("Task {} selected for scheduling but no capacity available for it at the moment", task);
if (flavor.getMemorySize() > maxMemory || flavor.getCoreCount() > maxCores) {
// Remove the incoming image
- queue.poll();
- serversPending--;
+ taskQueue.poll();
+ tasksPending--;
attemptsFailure++;
- LOGGER.warn("Failed to spawn {}: does not fit", server);
+ LOGGER.warn("Failed to spawn {}: does not fit", task);
- server.setState(ServerState.TERMINATED);
+ task.setState(TaskState.TERMINATED);
continue;
} else {
break;
@@ -396,25 +392,25 @@ public final class ComputeService implements AutoCloseable {
Host host = hv.getHost();
// Remove request from queue
- queue.poll();
- serversPending--;
+ taskQueue.poll();
+ tasksPending--;
- LOGGER.info("Assigned server {} to host {}", server, host);
+ LOGGER.info("Assigned task {} to host {}", task, host);
try {
- server.host = host;
+ task.host = host;
- host.spawn(server);
- host.start(server);
+ host.spawn(task);
+ host.start(task);
- serversActive++;
+ tasksActive++;
attemptsSuccess++;
hv.instanceCount++;
hv.provisionedCores += flavor.getCoreCount();
hv.availableMemory -= flavor.getMemorySize();
- activeServers.put(server, host);
+ activeTasks.put(task, host);
} catch (Exception cause) {
LOGGER.error("Failed to deploy VM", cause);
attemptsError++;
@@ -537,7 +533,7 @@ public final class ComputeService implements AutoCloseable {
@NotNull
@Override
- public Server newServer(
+ public Task newTask(
@NotNull String name,
@NotNull Image image,
@NotNull Flavor flavor,
@@ -554,31 +550,31 @@ public final class ComputeService implements AutoCloseable {
final ServiceImage internalImage =
Objects.requireNonNull(service.imageById.get(image.getUid()), "Unknown image");
- ServiceServer server = new ServiceServer(service, uid, name, internalFlavor, internalImage, labels, meta);
+ ServiceTask task = new ServiceTask(service, uid, name, internalFlavor, internalImage, labels, meta);
- service.serverById.put(uid, server);
- service.servers.add(server);
+ service.taskById.put(uid, task);
+ service.tasks.add(task);
if (start) {
- server.start();
+ task.start();
}
- return server;
+ return task;
}
@Nullable
@Override
- public Server findServer(@NotNull UUID id) {
+ public Task findTask(@NotNull UUID id) {
checkOpen();
- return service.serverById.get(id);
+ return service.taskById.get(id);
}
@NotNull
@Override
- public List<Server> queryServers() {
+ public List<Task> queryTasks() {
checkOpen();
- return new ArrayList<>(service.servers);
+ return new ArrayList<>(service.tasks);
}
@Override
@@ -593,30 +589,30 @@ public final class ComputeService implements AutoCloseable {
@Nullable
@Override
- public void rescheduleServer(@NotNull Server server, @NotNull SimWorkload workload) {
- ServiceServer internalServer = (ServiceServer) findServer(server.getUid());
- Host from = service.lookupHost(internalServer);
+ public void rescheduleTask(@NotNull Task task, @NotNull SimWorkload workload) {
+ ServiceTask internalTask = (ServiceTask) findTask(task.getUid());
+ Host from = service.lookupHost(internalTask);
- from.delete(internalServer);
+ from.delete(internalTask);
- internalServer.host = null;
+ internalTask.host = null;
- internalServer.setWorkload(workload);
- internalServer.start();
+ internalTask.setWorkload(workload);
+ internalTask.start();
}
}
/**
- * A request to schedule a {@link ServiceServer} onto one of the {@link Host}s.
+ * A request to schedule a {@link ServiceTask} onto one of the {@link Host}s.
*/
static class SchedulingRequest {
- final ServiceServer server;
+ final ServiceTask task;
final long submitTime;
boolean isCancelled;
- SchedulingRequest(ServiceServer server, long submitTime) {
- this.server = server;
+ SchedulingRequest(ServiceTask task, long submitTime) {
+ this.task = task;
this.submitTime = submitTime;
}
}
diff --git a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ServiceServer.java b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ServiceTask.java
index e363faf2..e981921a 100644
--- a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ServiceServer.java
+++ b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/ServiceTask.java
@@ -32,18 +32,18 @@ import java.util.Objects;
import java.util.UUID;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.opendc.compute.api.Server;
-import org.opendc.compute.api.ServerState;
-import org.opendc.compute.api.ServerWatcher;
+import org.opendc.compute.api.Task;
+import org.opendc.compute.api.TaskState;
+import org.opendc.compute.api.TaskWatcher;
import org.opendc.compute.service.driver.Host;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Implementation of {@link Server} provided by {@link ComputeService}.
+ * Implementation of {@link Task} provided by {@link ComputeService}.
*/
-public final class ServiceServer implements Server {
- private static final Logger LOGGER = LoggerFactory.getLogger(ServiceServer.class);
+public final class ServiceTask implements Task {
+ private static final Logger LOGGER = LoggerFactory.getLogger(ServiceTask.class);
private final ComputeService service;
private final UUID uid;
@@ -54,13 +54,13 @@ public final class ServiceServer implements Server {
private final Map<String, String> labels;
private Map<String, ?> meta;
- private final List<ServerWatcher> watchers = new ArrayList<>();
- private ServerState state = ServerState.TERMINATED;
+ private final List<TaskWatcher> watchers = new ArrayList<>();
+ private TaskState state = TaskState.TERMINATED;
Instant launchedAt = null;
Host host = null;
private ComputeService.SchedulingRequest request = null;
- ServiceServer(
+ ServiceTask(
ComputeService service,
UUID uid,
String name,
@@ -122,7 +122,7 @@ public final class ServiceServer implements Server {
@NotNull
@Override
- public ServerState getState() {
+ public TaskState getState() {
return state;
}
@@ -133,7 +133,7 @@ public final class ServiceServer implements Server {
}
/**
- * Return the {@link Host} on which the server is running or <code>null</code> if it is not running on a host.
+ * Return the {@link Host} on which the task is running or <code>null</code> if it is not running on a host.
*/
public Host getHost() {
return host;
@@ -143,16 +143,16 @@ public final class ServiceServer implements Server {
public void start() {
switch (state) {
case PROVISIONING:
- LOGGER.debug("User tried to start server but request is already pending: doing nothing");
+ LOGGER.debug("User tried to start task but request is already pending: doing nothing");
case RUNNING:
- LOGGER.debug("User tried to start server but server is already running");
+ LOGGER.debug("User tried to start task but task is already running");
break;
case DELETED:
- LOGGER.warn("User tried to start deleted server");
- throw new IllegalStateException("Server is deleted");
+ LOGGER.warn("User tried to start deleted task");
+ throw new IllegalStateException("Task is deleted");
default:
- LOGGER.info("User requested to start server {}", uid);
- setState(ServerState.PROVISIONING);
+ LOGGER.info("User requested to start task {}", uid);
+ setState(TaskState.PROVISIONING);
assert request == null : "Scheduling request already active";
request = service.schedule(this);
break;
@@ -164,13 +164,13 @@ public final class ServiceServer implements Server {
switch (state) {
case PROVISIONING:
cancelProvisioningRequest();
- setState(ServerState.TERMINATED);
+ setState(TaskState.TERMINATED);
break;
case RUNNING:
case ERROR:
final Host host = this.host;
if (host == null) {
- throw new IllegalStateException("Server not running");
+ throw new IllegalStateException("Task not running");
}
host.stop(this);
break;
@@ -178,12 +178,12 @@ public final class ServiceServer implements Server {
}
@Override
- public void watch(@NotNull ServerWatcher watcher) {
+ public void watch(@NotNull TaskWatcher watcher) {
watchers.add(watcher);
}
@Override
- public void unwatch(@NotNull ServerWatcher watcher) {
+ public void unwatch(@NotNull TaskWatcher watcher) {
watchers.remove(watcher);
}
@@ -199,17 +199,17 @@ public final class ServiceServer implements Server {
case TERMINATED:
cancelProvisioningRequest();
service.delete(this);
- setState(ServerState.DELETED);
+ setState(TaskState.DELETED);
break;
case RUNNING:
case ERROR:
final Host host = this.host;
if (host == null) {
- throw new IllegalStateException("Server not running");
+ throw new IllegalStateException("Task not running");
}
host.delete(this);
service.delete(this);
- setState(ServerState.DELETED);
+ setState(TaskState.DELETED);
break;
}
}
@@ -218,8 +218,8 @@ public final class ServiceServer implements Server {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
- ServiceServer server = (ServiceServer) o;
- return service.equals(server.service) && uid.equals(server.uid);
+ ServiceTask task = (ServiceTask) o;
+ return service.equals(task.service) && uid.equals(task.uid);
}
@Override
@@ -229,12 +229,12 @@ public final class ServiceServer implements Server {
@Override
public String toString() {
- return "Server[uid=" + uid + ",name=" + name + ",state=" + state + "]";
+ return "Task[uid=" + uid + ",name=" + name + ",state=" + state + "]";
}
- void setState(ServerState state) {
+ void setState(TaskState state) {
if (this.state != state) {
- for (ServerWatcher watcher : watchers) {
+ for (TaskWatcher watcher : watchers) {
watcher.onStateChanged(this, state);
}
}
diff --git a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/Host.java b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/Host.java
index 760d7f1a..546f774b 100644
--- a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/Host.java
+++ b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/Host.java
@@ -25,14 +25,14 @@ package org.opendc.compute.service.driver;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
-import org.opendc.compute.api.Server;
+import org.opendc.compute.api.Task;
import org.opendc.compute.service.driver.telemetry.GuestCpuStats;
import org.opendc.compute.service.driver.telemetry.GuestSystemStats;
import org.opendc.compute.service.driver.telemetry.HostCpuStats;
import org.opendc.compute.service.driver.telemetry.HostSystemStats;
/**
- * Base interface for representing compute resources that host virtualized {@link Server} instances.
+ * Base interface for representing compute resources that host virtualized {@link Task} instances.
*/
public interface Host {
/**
@@ -61,43 +61,43 @@ public interface Host {
Map<String, ?> getMeta();
/**
- * Return the {@link Server} instances known to the host.
+ * Return the {@link Task} instances known to the host.
*/
- Set<Server> getInstances();
+ Set<Task> getInstances();
/**
- * Determine whether the specified <code>server</code> can still fit on this host.
+ * Determine whether the specified <code>task</code> can still fit on this host.
*/
- boolean canFit(Server server);
+ boolean canFit(Task task);
/**
- * Register the specified <code>server</code> on the host.
+ * Register the specified <code>task</code> on the host.
*/
- void spawn(Server server);
+ void spawn(Task task);
/**
- * Determine whether the specified <code>server</code> exists on the host.
+ * Determine whether the specified <code>task</code> exists on the host.
*/
- boolean contains(Server server);
+ boolean contains(Task task);
/**
- * Start the server if it is currently not running on this host.
+ * Start the task if it is currently not running on this host.
*
- * @throws IllegalArgumentException if the server is not present on the host.
+ * @throws IllegalArgumentException if the task is not present on the host.
*/
- void start(Server server);
+ void start(Task task);
/**
- * Stop the server if it is currently running on this host.
+ * Stop the task if it is currently running on this host.
*
- * @throws IllegalArgumentException if the server is not present on the host.
+ * @throws IllegalArgumentException if the task is not present on the host.
*/
- void stop(Server server);
+ void stop(Task task);
/**
- * Delete the specified <code>server</code> on this host and cleanup all resources associated with it.
+ * Delete the specified <code>task</code> on this host and cleanup all resources associated with it.
*/
- void delete(Server server);
+ void delete(Task task);
/**
* Add a [HostListener] to this host.
@@ -115,12 +115,12 @@ public interface Host {
HostSystemStats getSystemStats();
/**
- * Query the system statistics of a {@link Server} that is located on this host.
+ * Query the system statistics of a {@link Task} that is located on this host.
*
- * @param server The {@link Server} to obtain the system statistics of.
- * @throws IllegalArgumentException if the server is not present on the host.
+ * @param task The {@link Task} to obtain the system statistics of.
+ * @throws IllegalArgumentException if the task is not present on the host.
*/
- GuestSystemStats getSystemStats(Server server);
+ GuestSystemStats getSystemStats(Task task);
/**
* Query the CPU statistics of the host.
@@ -128,10 +128,10 @@ public interface Host {
HostCpuStats getCpuStats();
/**
- * Query the CPU statistics of a {@link Server} that is located on this host.
+ * Query the CPU statistics of a {@link Task} that is located on this host.
*
- * @param server The {@link Server} to obtain the CPU statistics of.
- * @throws IllegalArgumentException if the server is not present on the host.
+ * @param task The {@link Task} to obtain the CPU statistics of.
+ * @throws IllegalArgumentException if the task is not present on the host.
*/
- GuestCpuStats getCpuStats(Server server);
+ GuestCpuStats getCpuStats(Task task);
}
diff --git a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/HostListener.java b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/HostListener.java
index feefca40..079c6cff 100644
--- a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/HostListener.java
+++ b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/HostListener.java
@@ -22,17 +22,17 @@
package org.opendc.compute.service.driver;
-import org.opendc.compute.api.Server;
-import org.opendc.compute.api.ServerState;
+import org.opendc.compute.api.Task;
+import org.opendc.compute.api.TaskState;
/**
* Listener interface for events originating from a {@link Host}.
*/
public interface HostListener {
/**
- * This method is invoked when the state of <code>server</code> on <code>host</code> changes.
+ * This method is invoked when the state of <code>task</code> on <code>host</code> changes.
*/
- default void onStateChanged(Host host, Server server, ServerState newState) {}
+ default void onStateChanged(Host host, Task task, TaskState newState) {}
/**
* This method is invoked when the state of a {@link Host} has changed.
diff --git a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/telemetry/HostSystemStats.java b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/telemetry/HostSystemStats.java
index d9dba274..c0713f3c 100644
--- a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/telemetry/HostSystemStats.java
+++ b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/driver/telemetry/HostSystemStats.java
@@ -30,7 +30,7 @@ import java.time.Instant;
*
* @param uptime The cumulative uptime of the host since last boot (in ms).
* @param downtime The cumulative downtime of the host since last boot (in ms).
- * @param bootTime The time at which the server started.
+ * @param bootTime The time at which the task started.
* @param powerDraw Instantaneous power draw of the system (in W).
* @param energyUsage The cumulative energy usage of the system (in J).
* @param guestsTerminated The number of guests that are in a terminated state.
diff --git a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/telemetry/SchedulerStats.java b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/telemetry/SchedulerStats.java
index 2157169b..fc044d8c 100644
--- a/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/telemetry/SchedulerStats.java
+++ b/opendc-compute/opendc-compute-service/src/main/java/org/opendc/compute/service/telemetry/SchedulerStats.java
@@ -30,9 +30,9 @@ package org.opendc.compute.service.telemetry;
* @param attemptsSuccess Scheduling attempts that resulted into an allocation onto a host.
* @param attemptsFailure The number of failed scheduling attempt due to insufficient capacity at the moment.
* @param attemptsError The number of scheduling attempts that failed due to system error.
- * @param serversTotal The number of servers registered with the service.
- * @param serversPending The number of servers that are pending to be scheduled.
- * @param serversActive The number of servers that are currently managed by the service and running.
+ * @param tasksTotal The number of tasks registered with the service.
+ * @param tasksPending The number of tasks that are pending to be scheduled.
+ * @param tasksActive The number of tasks that are currently managed by the service and running.
*/
public record SchedulerStats(
int hostsAvailable,
@@ -40,6 +40,6 @@ public record SchedulerStats(
long attemptsSuccess,
long attemptsFailure,
long attemptsError,
- int serversTotal,
- int serversPending,
- int serversActive) {}
+ int tasksTotal,
+ int tasksPending,
+ int tasksActive) {}