diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-10-06 12:51:27 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-10-06 12:51:27 +0200 |
| commit | 402a8f55342c4565431c2a2e7287a70592f3fe33 (patch) | |
| tree | f4bb4a046278c1f4b70e815e9ddae976476f0d3a /opendc-workflow | |
| parent | 00a28ee84606754d186c39e9aa39d2ad2c277c91 (diff) | |
style: Eliminate use of wildcard imports
This change updates the repository to remove the use of wildcard imports
everywhere. Wildcard imports are not allowed by default by Ktlint as
well as Google's Java style guide.
Diffstat (limited to 'opendc-workflow')
7 files changed, 23 insertions, 13 deletions
diff --git a/opendc-workflow/opendc-workflow-api/src/main/kotlin/org/opendc/workflow/api/Job.kt b/opendc-workflow/opendc-workflow-api/src/main/kotlin/org/opendc/workflow/api/Job.kt index 5e8b0b9e..b59ad6da 100644 --- a/opendc-workflow/opendc-workflow-api/src/main/kotlin/org/opendc/workflow/api/Job.kt +++ b/opendc-workflow/opendc-workflow-api/src/main/kotlin/org/opendc/workflow/api/Job.kt @@ -22,7 +22,7 @@ package org.opendc.workflow.api -import java.util.* +import java.util.UUID /** * A workload that represents a directed acyclic graph (DAG) of tasks with control and data dependencies between tasks. diff --git a/opendc-workflow/opendc-workflow-api/src/main/kotlin/org/opendc/workflow/api/Task.kt b/opendc-workflow/opendc-workflow-api/src/main/kotlin/org/opendc/workflow/api/Task.kt index d91f9879..f805c210 100644 --- a/opendc-workflow/opendc-workflow-api/src/main/kotlin/org/opendc/workflow/api/Task.kt +++ b/opendc-workflow/opendc-workflow-api/src/main/kotlin/org/opendc/workflow/api/Task.kt @@ -22,14 +22,13 @@ package org.opendc.workflow.api -import java.util.* +import java.util.UUID /** * A stage of a [Job]. * * @property uid A unique identified of this task. * @property name The name of this task. - * @property image The application image to run as part of this workflow task. * @property dependencies The dependencies of this task in order for it to execute. * @property metadata Additional metadata for this task. */ diff --git a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/internal/WorkflowServiceImpl.kt b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/internal/WorkflowServiceImpl.kt index 899810a2..b1780896 100644 --- a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/internal/WorkflowServiceImpl.kt +++ b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/internal/WorkflowServiceImpl.kt @@ -22,12 +22,19 @@ package org.opendc.workflow.service.internal -import kotlinx.coroutines.* +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.cancel +import kotlinx.coroutines.launch +import kotlinx.coroutines.suspendCancellableCoroutine import org.opendc.common.util.Pacer -import org.opendc.compute.api.* +import org.opendc.compute.api.ComputeClient +import org.opendc.compute.api.Image +import org.opendc.compute.api.Server +import org.opendc.compute.api.ServerState +import org.opendc.compute.api.ServerWatcher import org.opendc.workflow.api.Job import org.opendc.workflow.api.WORKFLOW_TASK_CORES -import org.opendc.workflow.service.* +import org.opendc.workflow.service.WorkflowService import org.opendc.workflow.service.scheduler.job.JobAdmissionPolicy import org.opendc.workflow.service.scheduler.job.JobOrderPolicy import org.opendc.workflow.service.scheduler.task.TaskEligibilityPolicy @@ -35,7 +42,8 @@ import org.opendc.workflow.service.scheduler.task.TaskOrderPolicy import org.opendc.workflow.service.scheduler.telemetry.SchedulerStats import java.time.Clock import java.time.Duration -import java.util.* +import java.util.PriorityQueue +import java.util.Queue import kotlin.coroutines.CoroutineContext import kotlin.coroutines.resume @@ -56,7 +64,7 @@ public class WorkflowServiceImpl( /** * The [CoroutineScope] of the service bounded by the lifecycle of the service. */ - private val scope = CoroutineScope(context + Job()) + private val scope = CoroutineScope(context + kotlinx.coroutines.Job()) /** * The incoming jobs ready to be processed by the scheduler. diff --git a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/job/RandomJobOrderPolicy.kt b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/job/RandomJobOrderPolicy.kt index 1b359125..4f8dc05b 100644 --- a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/job/RandomJobOrderPolicy.kt +++ b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/job/RandomJobOrderPolicy.kt @@ -26,7 +26,7 @@ import org.opendc.workflow.api.Job import org.opendc.workflow.service.internal.JobState import org.opendc.workflow.service.internal.WorkflowSchedulerListener import org.opendc.workflow.service.internal.WorkflowServiceImpl -import java.util.* +import java.util.Random import kotlin.collections.HashMap /** diff --git a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/DurationTaskOrderPolicy.kt b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/DurationTaskOrderPolicy.kt index d9fde53a..a2ca2086 100644 --- a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/DurationTaskOrderPolicy.kt +++ b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/DurationTaskOrderPolicy.kt @@ -26,7 +26,7 @@ import org.opendc.workflow.api.WORKFLOW_TASK_DEADLINE import org.opendc.workflow.service.internal.TaskState import org.opendc.workflow.service.internal.WorkflowSchedulerListener import org.opendc.workflow.service.internal.WorkflowServiceImpl -import java.util.* +import java.util.UUID import kotlin.collections.HashMap import kotlin.collections.getValue import kotlin.collections.set diff --git a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/RandomTaskEligibilityPolicy.kt b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/RandomTaskEligibilityPolicy.kt index a01439c2..e675d836 100644 --- a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/RandomTaskEligibilityPolicy.kt +++ b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/RandomTaskEligibilityPolicy.kt @@ -24,7 +24,7 @@ package org.opendc.workflow.service.scheduler.task import org.opendc.workflow.service.internal.TaskState import org.opendc.workflow.service.internal.WorkflowServiceImpl -import java.util.* +import java.util.Random /** * A [TaskEligibilityPolicy] that randomly accepts tasks in the system with some [probability]. diff --git a/opendc-workflow/opendc-workflow-service/src/test/kotlin/org/opendc/workflow/service/WorkflowServiceTest.kt b/opendc-workflow/opendc-workflow-service/src/test/kotlin/org/opendc/workflow/service/WorkflowServiceTest.kt index e37f489d..096a7ebd 100644 --- a/opendc-workflow/opendc-workflow-service/src/test/kotlin/org/opendc/workflow/service/WorkflowServiceTest.kt +++ b/opendc-workflow/opendc-workflow-service/src/test/kotlin/org/opendc/workflow/service/WorkflowServiceTest.kt @@ -37,7 +37,10 @@ import org.opendc.experiments.compute.setupHosts import org.opendc.experiments.compute.topology.HostSpec import org.opendc.experiments.provisioner.Provisioner import org.opendc.experiments.provisioner.ProvisioningContext -import org.opendc.experiments.workflow.* +import org.opendc.experiments.workflow.WorkflowSchedulerSpec +import org.opendc.experiments.workflow.replay +import org.opendc.experiments.workflow.setupWorkflowService +import org.opendc.experiments.workflow.toJobs import org.opendc.simulator.compute.model.MachineModel import org.opendc.simulator.compute.model.MemoryUnit import org.opendc.simulator.compute.model.ProcessingNode @@ -53,7 +56,7 @@ import org.opendc.workflow.service.scheduler.task.NullTaskEligibilityPolicy import org.opendc.workflow.service.scheduler.task.SubmissionTimeTaskOrderPolicy import java.nio.file.Paths import java.time.Duration -import java.util.* +import java.util.UUID /** * Integration test suite for the [WorkflowService]. |
