summaryrefslogtreecommitdiff
path: root/opendc-experiments/opendc-experiments-workflow/src/main
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-06 13:13:10 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-06 14:46:56 +0200
commit47357afd16f928260db34d4dd3e686fb9ee7c5ff (patch)
tree950ba678869ec868c26ab3b95b57e4cabadb23c7 /opendc-experiments/opendc-experiments-workflow/src/main
parent402a8f55342c4565431c2a2e7287a70592f3fe33 (diff)
build: Switch to Spotless for formatting
This change updates the build configuration to use Spotless for code formating of both Kotlin and Java.
Diffstat (limited to 'opendc-experiments/opendc-experiments-workflow/src/main')
-rw-r--r--opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/TraceHelpers.kt8
-rw-r--r--opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowSchedulerSpec.kt2
-rw-r--r--opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowServiceProvisioningStep.kt2
-rw-r--r--opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowSteps.kt1
4 files changed, 8 insertions, 5 deletions
diff --git a/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/TraceHelpers.kt b/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/TraceHelpers.kt
index d1009d44..2ae69949 100644
--- a/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/TraceHelpers.kt
+++ b/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/TraceHelpers.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("TraceHelpers")
+
package org.opendc.experiments.workflow
import kotlinx.coroutines.coroutineScope
@@ -65,10 +66,11 @@ public fun Trace.toJobs(): List<Job> {
val workflow = jobs.computeIfAbsent(workflowId) { id -> Job(UUID(0L, id), "<unnamed>", HashSet(), HashMap()) }
val id = reader.getString(TASK_ID)!!.toLong()
- val grantedCpus = if (reader.resolve(TASK_ALLOC_NCPUS) != 0)
+ val grantedCpus = if (reader.resolve(TASK_ALLOC_NCPUS) != 0) {
reader.getInt(TASK_ALLOC_NCPUS)
- else
+ } else {
reader.getInt(TASK_REQ_NCPUS)
+ }
val submitTime = reader.getInstant(TASK_SUBMIT_TIME)!!
val runtime = reader.getDuration(TASK_RUNTIME)!!
val flops: Long = 4000 * runtime.seconds * grantedCpus
@@ -81,7 +83,7 @@ public fun Trace.toJobs(): List<Job> {
"workload" to workload,
WORKFLOW_TASK_CORES to grantedCpus,
WORKFLOW_TASK_DEADLINE to runtime.toMillis()
- ),
+ )
)
tasks[id] = task
diff --git a/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowSchedulerSpec.kt b/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowSchedulerSpec.kt
index cb8056a7..8bd087e7 100644
--- a/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowSchedulerSpec.kt
+++ b/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowSchedulerSpec.kt
@@ -36,5 +36,5 @@ public data class WorkflowSchedulerSpec(
val jobAdmissionPolicy: JobAdmissionPolicy,
val jobOrderPolicy: JobOrderPolicy,
val taskEligibilityPolicy: TaskEligibilityPolicy,
- val taskOrderPolicy: TaskOrderPolicy,
+ val taskOrderPolicy: TaskOrderPolicy
)
diff --git a/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowServiceProvisioningStep.kt b/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowServiceProvisioningStep.kt
index a2d6a172..5cee9abf 100644
--- a/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowServiceProvisioningStep.kt
+++ b/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowServiceProvisioningStep.kt
@@ -54,7 +54,7 @@ public class WorkflowServiceProvisioningStep internal constructor(
jobAdmissionPolicy = scheduler.jobAdmissionPolicy,
jobOrderPolicy = scheduler.jobOrderPolicy,
taskEligibilityPolicy = scheduler.taskEligibilityPolicy,
- taskOrderPolicy = scheduler.taskOrderPolicy,
+ taskOrderPolicy = scheduler.taskOrderPolicy
)
ctx.registry.register(serviceDomain, WorkflowService::class.java, service)
diff --git a/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowSteps.kt b/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowSteps.kt
index 7aae3a9f..87c743f0 100644
--- a/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowSteps.kt
+++ b/opendc-experiments/opendc-experiments-workflow/src/main/kotlin/org/opendc/experiments/workflow/WorkflowSteps.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("WorkflowSteps")
+
package org.opendc.experiments.workflow
import org.opendc.experiments.provisioner.ProvisioningStep