diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-03-09 17:18:02 +0100 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-03-09 17:24:06 +0100 |
| commit | 6a555542c4a1ba94b96c0cf17b51ceb975c83e21 (patch) | |
| tree | 80862162f5bfdcbcd33d2925cedbf81ffcc0607a /simulator/opendc-workflows/src | |
| parent | 412a0d554edf135eaf26db50ea59009abf88c15e (diff) | |
core: Remove OpenDC core module
This change removes the opendc-core module. This module was an artifact
of the old codebase and remained mostly unused. This change removes all
usages of the module and if necessary introduces replacement classes.
Diffstat (limited to 'simulator/opendc-workflows/src')
4 files changed, 14 insertions, 25 deletions
diff --git a/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/service/WorkflowService.kt b/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/service/WorkflowService.kt index b24f80da..c43c72f5 100644 --- a/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/service/WorkflowService.kt +++ b/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/service/WorkflowService.kt @@ -23,7 +23,6 @@ package org.opendc.workflows.service import kotlinx.coroutines.flow.Flow -import org.opendc.core.services.AbstractServiceKey import org.opendc.workflows.workload.Job import java.util.* @@ -42,9 +41,4 @@ public interface WorkflowService { * Submit the specified [Job] to the workflow service for scheduling. */ public suspend fun submit(job: Job) - - /** - * The service key for the workflow scheduler. - */ - public companion object Key : AbstractServiceKey<WorkflowService>(UUID.randomUUID(), "workflows") } diff --git a/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/workload/Job.kt b/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/workload/Job.kt index f1cfdf65..53116cb6 100644 --- a/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/workload/Job.kt +++ b/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/workload/Job.kt @@ -22,8 +22,6 @@ package org.opendc.workflows.workload -import org.opendc.core.User -import org.opendc.core.workload.Workload import java.util.* /** @@ -31,17 +29,15 @@ import java.util.* * * @property uid A unique identified of this workflow. * @property name The name of this workflow. - * @property owner The owner of the workflow. * @property tasks The tasks that are part of this workflow. * @property metadata Additional metadata for the job. */ public data class Job( - override val uid: UUID, - override val name: String, - override val owner: User, - public val tasks: Set<Task>, - public val metadata: Map<String, Any> = emptyMap() -) : Workload { + val uid: UUID, + val name: String, + val tasks: Set<Task>, + val metadata: Map<String, Any> = emptyMap() +) { override fun equals(other: Any?): Boolean = other is Job && uid == other.uid override fun hashCode(): Int = uid.hashCode() diff --git a/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/workload/Task.kt b/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/workload/Task.kt index 4c6d2842..9ed3a9a5 100644 --- a/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/workload/Task.kt +++ b/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/workload/Task.kt @@ -25,7 +25,6 @@ package org.opendc.workflows.workload import org.opendc.compute.api.Image -import org.opendc.core.Identity import java.util.* /** @@ -38,12 +37,12 @@ import java.util.* * @property metadata Additional metadata for this task. */ public data class Task( - override val uid: UUID, - override val name: String, - public val image: Image, - public val dependencies: Set<Task>, - public val metadata: Map<String, Any> = emptyMap() -) : Identity { + val uid: UUID, + val name: String, + val image: Image, + val dependencies: Set<Task>, + val metadata: Map<String, Any> = emptyMap() +) { override fun equals(other: Any?): Boolean = other is Task && uid == other.uid override fun hashCode(): Int = uid.hashCode() diff --git a/simulator/opendc-workflows/src/test/kotlin/org/opendc/workflows/service/StageWorkflowSchedulerIntegrationTest.kt b/simulator/opendc-workflows/src/test/kotlin/org/opendc/workflows/service/StageWorkflowSchedulerIntegrationTest.kt index 52bf3db5..eb79162c 100644 --- a/simulator/opendc-workflows/src/test/kotlin/org/opendc/workflows/service/StageWorkflowSchedulerIntegrationTest.kt +++ b/simulator/opendc-workflows/src/test/kotlin/org/opendc/workflows/service/StageWorkflowSchedulerIntegrationTest.kt @@ -119,10 +119,10 @@ internal class StageWorkflowSchedulerIntegrationTest { val reader = GwfTraceReader(object {}.javaClass.getResourceAsStream("/trace.gwf")) while (reader.hasNext()) { - val (time, job) = reader.next() + val entry = reader.next() jobsSubmitted++ - delay(max(0, time - clock.millis())) - scheduler.submit(job) + delay(max(0, entry.start - clock.millis())) + scheduler.submit(entry.workload) } } |
