diff options
| author | Dante Niewenhuis <d.niewenhuis@hotmail.com> | 2024-08-27 13:48:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-27 13:48:46 +0200 |
| commit | 3363df4c72a064e590ca98f8e01832cfa4e15a3f (patch) | |
| tree | 9a938700fe08ce344ff5d0d475d0b64d7233d1fc /opendc-compute/opendc-compute-api/src/main | |
| parent | c21708013f2746807f5bdb3fc47c2b47ed15b7c8 (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-api/src/main')
7 files changed, 46 insertions, 46 deletions
diff --git a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ComputeClient.kt b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ComputeClient.kt index 7863f20b..9e24a3fd 100644 --- a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ComputeClient.kt +++ b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ComputeClient.kt @@ -84,38 +84,38 @@ public interface ComputeClient : AutoCloseable { ): Image /** - * Obtain the list of [Server]s accessible by the requesting user. + * Obtain the list of [Task]s accessible by the requesting user. */ - public fun queryServers(): List<Server> + public fun queryTasks(): List<Task> /** - * Obtain a [Server] by its unique identifier. + * Obtain a [Task] by its unique identifier. * - * @param id The identifier of the server. + * @param id The identifier of the task. */ - public fun findServer(id: UUID): Server? + public fun findTask(id: UUID): Task? /** - * Create a new [Server] instance at this compute service. + * Create a new [Task] instance at this compute service. * - * @param name The name of the server to deploy. + * @param name The name of the task to deploy. * @param image The image to be deployed. * @param flavor The flavor of the machine instance to run this [image] on. - * @param labels The identifying labels of the server. - * @param meta The non-identifying meta-data of the server. - * @param start A flag to indicate that the server should be started immediately. + * @param labels The identifying labels of the task. + * @param meta The non-identifying meta-data of the task. + * @param start A flag to indicate that the task should be started immediately. */ - public fun newServer( + public fun newTask( name: String, image: Image, flavor: Flavor, labels: Map<String, String> = emptyMap(), meta: Map<String, Any> = emptyMap(), start: Boolean = true, - ): Server + ): Task - public fun rescheduleServer( - server: Server, + public fun rescheduleTask( + task: Task, workload: SimWorkload, ) diff --git a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Flavor.kt b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Flavor.kt index 201a9aed..99042c24 100644 --- a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Flavor.kt +++ b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Flavor.kt @@ -23,8 +23,8 @@ package org.opendc.compute.api /** - * Flavors define the compute and memory capacity of [Server] instance. To put it simply, a flavor is an available - * hardware configuration for a server. It defines the size of a virtual server that can be launched. + * Flavors define the compute and memory capacity of [Task] instance. To put it simply, a flavor is an available + * hardware configuration for a task. It defines the size of a virtual task that can be launched. */ public interface Flavor : Resource { /** @@ -33,7 +33,7 @@ public interface Flavor : Resource { public val coreCount: Int /** - * The amount of RAM available to the server (in MB). + * The amount of RAM available to the task (in MB). */ public val memorySize: Long } diff --git a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Image.kt b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Image.kt index c4a04b96..ce7f7f40 100644 --- a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Image.kt +++ b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Image.kt @@ -23,6 +23,6 @@ package org.opendc.compute.api /** - * An image containing a bootable operating system that can directly be executed by physical or virtual server. + * An image containing a bootable operating system that can directly be executed by physical or virtual task. */ public interface Image : Resource diff --git a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/InsufficientServerCapacityException.kt b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/InsufficientTaskCapacityException.kt index 497d5266..ef6e4761 100644 --- a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/InsufficientServerCapacityException.kt +++ b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/InsufficientTaskCapacityException.kt @@ -26,6 +26,6 @@ package org.opendc.compute.api * This exception is thrown to indicate that the compute service does not have enough capacity at the moment to * fulfill a launch request. */ -public class InsufficientServerCapacityException( +public class InsufficientTaskCapacityException( override val cause: Throwable? = null, ) : Exception("There was insufficient capacity available to satisfy the launch request") diff --git a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Server.kt b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Task.kt index b4cc5129..c9b0aeb3 100644 --- a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Server.kt +++ b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Task.kt @@ -25,50 +25,50 @@ package org.opendc.compute.api import java.time.Instant /** - * A stateful object representing a server instance that is running on some physical or virtual machine. + * A stateful object representing a task instance that is running on some physical or virtual machine. */ -public interface Server : Resource { +public interface Task : Resource { /** - * The flavor of the server. + * The flavor of the task. */ public val flavor: Flavor /** - * The image of the server. + * The image of the task. */ public val image: Image /** - * The last known state of the server. + * The last known state of the task. */ - public val state: ServerState + public val state: TaskState /** - * The most recent moment in time when the server was launched. + * The most recent moment in time when the task was launched. */ public val launchedAt: Instant? /** - * Request the server to be started. + * Request the task to be started. */ public fun start() /** - * Request the server to be stopped. + * Request the task to be stopped. */ public fun stop() /** - * Register the specified [ServerWatcher] to watch the state of the server. + * Register the specified [TaskWatcher] to watch the state of the task. * - * @param watcher The watcher to register for the server. + * @param watcher The watcher to register for the task. */ - public fun watch(watcher: ServerWatcher) + public fun watch(watcher: TaskWatcher) /** - * De-register the specified [ServerWatcher] from the server to stop it from receiving events. + * De-register the specified [TaskWatcher] from the task to stop it from receiving events. * - * @param watcher The watcher to de-register from the server. + * @param watcher The watcher to de-register from the task. */ - public fun unwatch(watcher: ServerWatcher) + public fun unwatch(watcher: TaskWatcher) } diff --git a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ServerState.kt b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/TaskState.kt index a4d7d7d7..a093ff47 100644 --- a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ServerState.kt +++ b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/TaskState.kt @@ -23,9 +23,9 @@ package org.opendc.compute.api /** - * An enumeration describing the possible states of a server. + * An enumeration describing the possible states of a task. */ -public enum class ServerState { +public enum class TaskState { /** * Resources are being allocated for the instance. The instance is not running yet. */ @@ -37,17 +37,17 @@ public enum class ServerState { TERMINATED, /** - * The server instance is booting up or running. + * The task instance is booting up or running. */ RUNNING, /** - * The server is in an error state. + * The task is in an error state. */ ERROR, /** - * The server has been deleted and cannot be started later on. + * The task has been deleted and cannot be started later on. */ DELETED, } diff --git a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ServerWatcher.kt b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/TaskWatcher.kt index 3229e101..423d7dec 100644 --- a/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ServerWatcher.kt +++ b/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/TaskWatcher.kt @@ -23,17 +23,17 @@ package org.opendc.compute.api /** - * An interface used to watch the state of [Server] instances. + * An interface used to watch the state of [Task] instances. */ -public interface ServerWatcher { +public interface TaskWatcher { /** - * This method is invoked when the state of a [Server] changes. + * This method is invoked when the state of a [Task] changes. * - * @param server The server whose state has changed. - * @param newState The new state of the server. + * @param task The task whose state has changed. + * @param newState The new state of the task. */ public fun onStateChanged( - server: Server, - newState: ServerState, + task: Task, + newState: TaskState, ) {} } |
