summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildSrc/build.gradle.kts2
-rw-r--r--buildSrc/src/main/kotlin/java-conventions.gradle.kts1
-rw-r--r--buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts8
-rw-r--r--buildSrc/src/main/kotlin/license.kt22
-rw-r--r--buildSrc/src/main/kotlin/quarkus-conventions.gradle.kts10
-rw-r--r--buildSrc/src/main/kotlin/spotless-conventions.gradle.kts59
-rw-r--r--gradle/libs.versions.toml4
-rw-r--r--opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt1
-rw-r--r--opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ServerState.kt2
-rw-r--r--opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/ComputeService.kt2
-rw-r--r--opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/HostState.kt2
-rw-r--r--opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/telemetry/HostSystemStats.kt2
-rw-r--r--opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/weights/HostWeigher.kt2
-rw-r--r--opendc-compute/opendc-compute-service/src/test/kotlin/org/opendc/compute/service/scheduler/FilterSchedulerTest.kt32
-rw-r--r--opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt2
-rw-r--r--opendc-experiments/opendc-experiments-base/src/test/kotlin/org/opendc/experiments/ServiceRegistryTest.kt2
-rw-r--r--opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/CapelinCli.kt3
-rw-r--r--opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/CapelinRunner.kt5
-rw-r--r--opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/topology/TopologyFactories.kt1
-rw-r--r--opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt12
-rw-r--r--opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeSchedulers.kt1
-rw-r--r--opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeSteps.kt1
-rw-r--r--opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeWorkloadLoader.kt2
-rw-r--r--opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeWorkloads.kt1
-rw-r--r--opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/FailureModels.kt1
-rw-r--r--opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/TraceHelpers.kt1
-rw-r--r--opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/export/parquet/ParquetHostDataWriter.kt2
-rw-r--r--opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/export/parquet/ParquetServiceDataWriter.kt2
-rw-r--r--opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/FaaSServiceProvisioningStep.kt5
-rw-r--r--opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/FaaSSteps.kt1
-rw-r--r--opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/TraceHelpers.kt1
-rw-r--r--opendc-experiments/opendc-experiments-faas/src/test/kotlin/org/opendc/experiments/faas/FaaSExperiment.kt2
-rw-r--r--opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt3
-rw-r--r--opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/layer/conv/Conv2D.kt2
-rw-r--r--opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/layer/core/ActivationLayer.kt2
-rw-r--r--opendc-experiments/opendc-experiments-tf20/src/test/kotlin/org/opendc/experiments/tf20/TensorFlowTest.kt28
-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
-rw-r--r--opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt2
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt4
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/SimBareMetalMachine.kt2
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/device/SimPsu.kt2
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimHypervisor.kt1
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/interference/VmInterferenceModel.kt5
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/AsymptoticPowerModel.kt7
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/InterpolationPowerModel.kt5
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/MsePowerModel.kt2
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/ZeroIdlePowerDecorator.kt5
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTrace.kt2
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/device/SimPsuTest.kt2
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisorTest.kt6
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimSpaceSharedHypervisorTest.kt2
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/power/PStatePowerDriverTest.kt8
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/power/PowerModelTest.kt4
-rw-r--r--opendc-simulator/opendc-simulator-core/src/main/java/org/opendc/simulator/SimulationScheduler.java5
-rw-r--r--opendc-simulator/opendc-simulator-core/src/main/java/org/opendc/simulator/TaskQueue.java10
-rw-r--r--opendc-simulator/opendc-simulator-core/src/test/kotlin/org/opendc/simulator/TaskQueueTest.kt16
-rw-r--r--opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/FlowForwarder.kt5
-rw-r--r--opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/internal/FlowConsumerContextImpl.kt20
-rw-r--r--opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexer.kt8
-rw-r--r--opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/mux/ForwardingFlowMultiplexerTest.kt2
-rw-r--r--opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexerTest.kt4
-rw-r--r--opendc-simulator/opendc-simulator-power/src/main/kotlin/org/opendc/simulator/power/SimPdu.kt2
-rw-r--r--opendc-simulator/opendc-simulator-power/src/main/kotlin/org/opendc/simulator/power/SimUps.kt2
-rw-r--r--opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/InterferenceGroupColumns.kt1
-rw-r--r--opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceColumns.kt1
-rw-r--r--opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceStateColumns.kt1
-rw-r--r--opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/Tables.kt1
-rw-r--r--opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/TaskColumns.kt1
-rw-r--r--opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/util/TableColumnConversion.kt1
-rw-r--r--opendc-trace/opendc-trace-azure/src/main/kotlin/org/opendc/trace/azure/AzureTraceFormat.kt4
-rw-r--r--opendc-trace/opendc-trace-azure/src/test/kotlin/org/opendc/trace/azure/AzureTraceFormatTest.kt2
-rw-r--r--opendc-trace/opendc-trace-bitbrains/src/main/kotlin/org/opendc/trace/bitbrains/BitbrainsExTraceFormat.kt2
-rw-r--r--opendc-trace/opendc-trace-bitbrains/src/main/kotlin/org/opendc/trace/bitbrains/BitbrainsTraceFormat.kt4
-rw-r--r--opendc-trace/opendc-trace-calcite/src/main/kotlin/org/opendc/trace/calcite/TraceTableModify.kt2
-rw-r--r--opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt8
-rw-r--r--opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt2
-rw-r--r--opendc-trace/opendc-trace-gwf/src/main/kotlin/org/opendc/trace/gwf/GwfTraceFormat.kt2
-rw-r--r--opendc-trace/opendc-trace-gwf/src/test/kotlin/org/opendc/trace/gwf/GwfTraceFormatTest.kt4
-rw-r--r--opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/OdcVmTraceFormat.kt11
-rw-r--r--opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceReadSupport.kt6
-rw-r--r--opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceStateReadSupport.kt2
-rw-r--r--opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceWriteSupport.kt2
-rw-r--r--opendc-trace/opendc-trace-opendc/src/test/kotlin/org/opendc/trace/opendc/OdcVmTraceFormatTest.kt6
-rw-r--r--opendc-trace/opendc-trace-parquet/src/main/kotlin/org/opendc/trace/util/parquet/LocalParquetReader.kt10
-rw-r--r--opendc-trace/opendc-trace-swf/src/test/kotlin/org/opendc/trace/swf/SwfTraceFormatTest.kt2
-rw-r--r--opendc-trace/opendc-trace-testkit/src/main/kotlin/org/opendc/trace/testkit/TableReaderTestKit.kt2
-rw-r--r--opendc-trace/opendc-trace-testkit/src/main/kotlin/org/opendc/trace/testkit/TableWriterTestKit.kt2
-rw-r--r--opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/ConvertCommand.kt2
-rw-r--r--opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/QueryCommand.kt2
-rw-r--r--opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/TraceTools.kt1
-rw-r--r--opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt4
-rw-r--r--opendc-trace/opendc-trace-wtf/src/main/kotlin/org/opendc/trace/wtf/parquet/TaskReadSupport.kt2
-rw-r--r--opendc-trace/opendc-trace-wtf/src/test/kotlin/org/opendc/trace/wtf/WtfTraceFormatTest.kt4
-rw-r--r--opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/Room.kt2
-rw-r--r--opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/RoomTile.kt2
-rw-r--r--opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/Trace.kt2
-rw-r--r--opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Portfolio.kt2
-rw-r--r--opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Topology.kt2
-rw-r--r--opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Portfolio.kt2
-rw-r--r--opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/ProjectRole.kt2
-rw-r--r--opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Scenario.kt2
-rw-r--r--opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Topology.kt4
-rw-r--r--opendc-web/opendc-web-runner-quarkus-deployment/src/main/java/org/opendc/web/runner/deployment/OpenDCRunnerProcessor.java39
-rw-r--r--opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java23
-rw-r--r--opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRuntimeConfig.java1
-rw-r--r--opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt2
-rw-r--r--opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt7
-rw-r--r--opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/internal/WebComputeMonitor.kt6
-rw-r--r--opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Portfolio.kt2
-rw-r--r--opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Project.kt2
-rw-r--r--opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Scenario.kt2
-rw-r--r--opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Trace.kt4
-rw-r--r--opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/rest/user/PortfolioResource.kt2
-rw-r--r--opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/rest/user/PortfolioScenarioResource.kt2
-rw-r--r--opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/service/ScenarioService.kt2
-rw-r--r--opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonBinarySqlTypeDescriptor.kt22
-rw-r--r--opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonBytesSqlTypeDescriptor.kt10
-rw-r--r--opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonStringSqlTypeDescriptor.kt22
-rw-r--r--opendc-web/opendc-web-server/src/test/kotlin/org/opendc/web/server/rest/runner/JobResourceTest.kt2
-rw-r--r--opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/AuthConfiguration.java1
-rw-r--r--opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiConfig.java1
-rw-r--r--opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiProcessor.java115
-rw-r--r--opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiRoutingBuildItem.java3
-rw-r--r--opendc-web/opendc-web-ui-quarkus/src/main/java/org/opendc/web/ui/runtime/OpenDCUiRecorder.java43
-rw-r--r--opendc-web/opendc-web-ui/build.gradle.kts4
-rw-r--r--opendc-workflow/opendc-workflow-api/src/main/kotlin/org/opendc/workflow/api/Metadata.kt4
-rw-r--r--opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/job/LimitJobAdmissionPolicy.kt5
-rw-r--r--opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/BalancingTaskEligibilityPolicy.kt5
-rw-r--r--opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/LimitPerJobTaskEligibilityPolicy.kt5
-rw-r--r--opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/LimitTaskEligibilityPolicy.kt5
-rw-r--r--opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/RandomTaskEligibilityPolicy.kt4
-rw-r--r--opendc-workflow/opendc-workflow-service/src/test/kotlin/org/opendc/workflow/service/WorkflowServiceTest.kt2
135 files changed, 496 insertions, 340 deletions
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts
index 42cbf842..7bd67f72 100644
--- a/buildSrc/build.gradle.kts
+++ b/buildSrc/build.gradle.kts
@@ -34,7 +34,7 @@ dependencies {
implementation(libs.kotlin.gradle)
implementation(libs.kotlin.allopen)
implementation(libs.kotlin.noarg)
- implementation(libs.ktlint.gradle)
+ implementation(libs.spotless.gradle)
implementation(libs.jmh.gradle)
implementation(libs.dokka.gradle)
diff --git a/buildSrc/src/main/kotlin/java-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-conventions.gradle.kts
index d4cc667a..a639a9e1 100644
--- a/buildSrc/src/main/kotlin/java-conventions.gradle.kts
+++ b/buildSrc/src/main/kotlin/java-conventions.gradle.kts
@@ -22,6 +22,7 @@
plugins {
`java-library`
+ id("spotless-conventions")
}
/* Project configuration */
diff --git a/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts b/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts
index 8fb46f5d..5ccc06a4 100644
--- a/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts
+++ b/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts
@@ -25,7 +25,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("java-conventions")
kotlin("jvm")
- id("org.jlleitschuh.gradle.ktlint")
+ id("spotless-conventions")
}
/* Project configuration */
@@ -34,9 +34,3 @@ tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
kotlinOptions.freeCompilerArgs += "-Xjvm-default=all"
}
-
-configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
- // Higher versions currently have issues with formatting where wildcard imports are automatically removed,
- // even when in use.
- version.set("0.42.1")
-}
diff --git a/buildSrc/src/main/kotlin/license.kt b/buildSrc/src/main/kotlin/license.kt
new file mode 100644
index 00000000..4e90fd4e
--- /dev/null
+++ b/buildSrc/src/main/kotlin/license.kt
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) $YEAR AtLarge Research
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
diff --git a/buildSrc/src/main/kotlin/quarkus-conventions.gradle.kts b/buildSrc/src/main/kotlin/quarkus-conventions.gradle.kts
index 75c4a454..f1adb182 100644
--- a/buildSrc/src/main/kotlin/quarkus-conventions.gradle.kts
+++ b/buildSrc/src/main/kotlin/quarkus-conventions.gradle.kts
@@ -76,13 +76,3 @@ configurations.create("coverageDataElementsForQuarkus") {
}
}
}
-
-/* Fix for Quarkus/ktlint-gradle incompatibilities */
-tasks.named("runKtlintCheckOverMainSourceSet") {
- mustRunAfter(tasks.quarkusGenerateCode)
- mustRunAfter(tasks.quarkusGenerateCodeDev)
-}
-
-tasks.named("runKtlintCheckOverTestSourceSet") {
- mustRunAfter(tasks.quarkusGenerateCodeTests)
-}
diff --git a/buildSrc/src/main/kotlin/spotless-conventions.gradle.kts b/buildSrc/src/main/kotlin/spotless-conventions.gradle.kts
new file mode 100644
index 00000000..11131cc8
--- /dev/null
+++ b/buildSrc/src/main/kotlin/spotless-conventions.gradle.kts
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2022 AtLarge Research
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+plugins {
+ id("com.diffplug.spotless")
+}
+
+spotless {
+ pluginManager.withPlugin("java") {
+ java {
+ importOrder()
+ removeUnusedImports()
+
+ palantirJavaFormat()
+
+ trimTrailingWhitespace()
+ endWithNewline()
+
+ licenseHeaderFile(rootProject.file("buildSrc/src/main/kotlin/license.kt"))
+ }
+ }
+
+ pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
+ kotlin {
+ ktlint()
+ .setUseExperimental(false)
+ trimTrailingWhitespace()
+ endWithNewline()
+
+ licenseHeaderFile(rootProject.file("buildSrc/src/main/kotlin/license.kt"))
+ }
+ }
+
+ kotlinGradle {
+ ktlint()
+
+ trimTrailingWhitespace()
+ endWithNewline()
+ }
+}
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index c53c16c6..ac1ce5e9 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -14,7 +14,6 @@ junit-jupiter = "5.9.1"
kotlin = "1.7.20"
kotlin-logging = "3.0.0"
kotlinx-coroutines = "1.6.4"
-ktlint-gradle = "11.0.0"
log4j = "2.19.0"
microprofile-openapi = "3.0"
microprofile-config = "3.0.1"
@@ -25,6 +24,7 @@ quarkus = "2.13.1.Final"
quarkus-junit5-mockk = "1.1.1"
sentry = "6.4.3"
slf4j = "2.0.3"
+spotless = "6.11.0"
[libraries]
# Kotlin
@@ -104,5 +104,5 @@ microprofile-config = { module = "org.eclipse.microprofile.config:microprofile-c
dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
gradle-node = { module = "com.github.node-gradle:gradle-node-plugin", version.ref = "gradle-node" }
jandex-gradle = { module = "org.kordamp.gradle:jandex-gradle-plugin", version.ref = "jandex-gradle" }
-ktlint-gradle = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlint-gradle" }
jmh-gradle = { module = "me.champeau.jmh:jmh-gradle-plugin", version.ref = "jmh-gradle" }
+spotless-gradle = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless" }
diff --git a/opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt b/opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt
index f3d2b23d..22a26111 100644
--- a/opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt
+++ b/opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt
@@ -100,7 +100,6 @@ internal class TimerSchedulerTest {
scheduler.startSingleTimer(0, 1000) { fail() }
scheduler.startSingleTimer(0, 200) {
-
assertEquals(200, clock.millis())
}
}
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/ServerState.kt
index a4d7d7d7..2b5aebb1 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/ServerState.kt
@@ -49,5 +49,5 @@ public enum class ServerState {
/**
* The server has been deleted and cannot be started later on.
*/
- DELETED,
+ DELETED
}
diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/ComputeService.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/ComputeService.kt
index 28ef7c40..85222c10 100644
--- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/ComputeService.kt
+++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/ComputeService.kt
@@ -89,7 +89,7 @@ public interface ComputeService : AutoCloseable {
context: CoroutineContext,
clock: Clock,
scheduler: ComputeScheduler,
- schedulingQuantum: Duration = Duration.ofMinutes(5),
+ schedulingQuantum: Duration = Duration.ofMinutes(5)
): ComputeService {
return ComputeServiceImpl(context, clock, scheduler, schedulingQuantum)
}
diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/HostState.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/HostState.kt
index ca6c625c..544b6530 100644
--- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/HostState.kt
+++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/HostState.kt
@@ -39,5 +39,5 @@ public enum class HostState {
/**
* The host is in an error state and unable to host any guests.
*/
- ERROR,
+ ERROR
}
diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/telemetry/HostSystemStats.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/telemetry/HostSystemStats.kt
index 9d34a5ce..56bd017d 100644
--- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/telemetry/HostSystemStats.kt
+++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/telemetry/HostSystemStats.kt
@@ -47,5 +47,5 @@ public data class HostSystemStats(
val guestsTerminated: Int,
val guestsRunning: Int,
val guestsError: Int,
- val guestsInvalid: Int,
+ val guestsInvalid: Int
)
diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/weights/HostWeigher.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/weights/HostWeigher.kt
index aca8c4e6..aa8a9d53 100644
--- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/weights/HostWeigher.kt
+++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/weights/HostWeigher.kt
@@ -70,6 +70,6 @@ public interface HostWeigher {
public val weights: DoubleArray,
public val min: Double,
public val max: Double,
- public val multiplier: Double,
+ public val multiplier: Double
)
}
diff --git a/opendc-compute/opendc-compute-service/src/test/kotlin/org/opendc/compute/service/scheduler/FilterSchedulerTest.kt b/opendc-compute/opendc-compute-service/src/test/kotlin/org/opendc/compute/service/scheduler/FilterSchedulerTest.kt
index 8ecf7f87..4608bf37 100644
--- a/opendc-compute/opendc-compute-service/src/test/kotlin/org/opendc/compute/service/scheduler/FilterSchedulerTest.kt
+++ b/opendc-compute/opendc-compute-service/src/test/kotlin/org/opendc/compute/service/scheduler/FilterSchedulerTest.kt
@@ -74,7 +74,7 @@ internal class FilterSchedulerTest {
fun testNoHosts() {
val scheduler = FilterScheduler(
filters = emptyList(),
- weighers = emptyList(),
+ weighers = emptyList()
)
val server = mockk<Server>()
@@ -88,7 +88,7 @@ internal class FilterSchedulerTest {
fun testNoFiltersAndSchedulers() {
val scheduler = FilterScheduler(
filters = emptyList(),
- weighers = emptyList(),
+ weighers = emptyList()
)
val hostA = mockk<HostView>()
@@ -144,7 +144,7 @@ internal class FilterSchedulerTest {
fun testHostIsDown() {
val scheduler = FilterScheduler(
filters = listOf(ComputeFilter()),
- weighers = emptyList(),
+ weighers = emptyList()
)
val host = mockk<HostView>()
@@ -163,7 +163,7 @@ internal class FilterSchedulerTest {
fun testHostIsUp() {
val scheduler = FilterScheduler(
filters = listOf(ComputeFilter()),
- weighers = emptyList(),
+ weighers = emptyList()
)
val host = mockk<HostView>()
@@ -182,7 +182,7 @@ internal class FilterSchedulerTest {
fun testRamFilter() {
val scheduler = FilterScheduler(
filters = listOf(RamFilter(1.0)),
- weighers = emptyList(),
+ weighers = emptyList()
)
val hostA = mockk<HostView>()
@@ -209,7 +209,7 @@ internal class FilterSchedulerTest {
fun testRamFilterOvercommit() {
val scheduler = FilterScheduler(
filters = listOf(RamFilter(1.5)),
- weighers = emptyList(),
+ weighers = emptyList()
)
val host = mockk<HostView>()
@@ -230,7 +230,7 @@ internal class FilterSchedulerTest {
fun testVCpuFilter() {
val scheduler = FilterScheduler(
filters = listOf(VCpuFilter(1.0)),
- weighers = emptyList(),
+ weighers = emptyList()
)
val hostA = mockk<HostView>()
@@ -257,7 +257,7 @@ internal class FilterSchedulerTest {
fun testVCpuFilterOvercommit() {
val scheduler = FilterScheduler(
filters = listOf(VCpuFilter(16.0)),
- weighers = emptyList(),
+ weighers = emptyList()
)
val host = mockk<HostView>()
@@ -278,7 +278,7 @@ internal class FilterSchedulerTest {
fun testVCpuCapacityFilter() {
val scheduler = FilterScheduler(
filters = listOf(VCpuCapacityFilter()),
- weighers = emptyList(),
+ weighers = emptyList()
)
val hostA = mockk<HostView>()
@@ -306,7 +306,7 @@ internal class FilterSchedulerTest {
fun testInstanceCountFilter() {
val scheduler = FilterScheduler(
filters = listOf(InstanceCountFilter(limit = 2)),
- weighers = emptyList(),
+ weighers = emptyList()
)
val hostA = mockk<HostView>()
@@ -333,7 +333,7 @@ internal class FilterSchedulerTest {
fun testAffinityFilter() {
val scheduler = FilterScheduler(
filters = listOf(SameHostFilter()),
- weighers = emptyList(),
+ weighers = emptyList()
)
val serverA = mockk<Server>()
@@ -372,7 +372,7 @@ internal class FilterSchedulerTest {
fun testAntiAffinityFilter() {
val scheduler = FilterScheduler(
filters = listOf(DifferentHostFilter()),
- weighers = emptyList(),
+ weighers = emptyList()
)
val serverA = mockk<Server>()
@@ -411,7 +411,7 @@ internal class FilterSchedulerTest {
fun testRamWeigher() {
val scheduler = FilterScheduler(
filters = emptyList(),
- weighers = listOf(RamWeigher(1.5)),
+ weighers = listOf(RamWeigher(1.5))
)
val hostA = mockk<HostView>()
@@ -438,7 +438,7 @@ internal class FilterSchedulerTest {
fun testCoreRamWeigher() {
val scheduler = FilterScheduler(
filters = emptyList(),
- weighers = listOf(CoreRamWeigher(1.5)),
+ weighers = listOf(CoreRamWeigher(1.5))
)
val hostA = mockk<HostView>()
@@ -465,7 +465,7 @@ internal class FilterSchedulerTest {
fun testVCpuWeigher() {
val scheduler = FilterScheduler(
filters = emptyList(),
- weighers = listOf(VCpuWeigher(16.0)),
+ weighers = listOf(VCpuWeigher(16.0))
)
val hostA = mockk<HostView>()
@@ -492,7 +492,7 @@ internal class FilterSchedulerTest {
fun testInstanceCountWeigher() {
val scheduler = FilterScheduler(
filters = emptyList(),
- weighers = listOf(InstanceCountWeigher(multiplier = -1.0)),
+ weighers = listOf(InstanceCountWeigher(multiplier = -1.0))
)
val hostA = mockk<HostView>()
diff --git a/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt b/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt
index 7092d57e..6be1f3c0 100644
--- a/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt
+++ b/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt
@@ -225,7 +225,7 @@ internal class SimHostTest {
{ assertEquals(900001, sysStats.uptime.toMillis(), "Uptime does not match") },
{ assertEquals(300000, sysStats.downtime.toMillis(), "Downtime does not match") },
{ assertEquals(900001, guestSysStats.uptime.toMillis(), "Guest uptime does not match") },
- { assertEquals(300000, guestSysStats.downtime.toMillis(), "Guest downtime does not match") },
+ { assertEquals(300000, guestSysStats.downtime.toMillis(), "Guest downtime does not match") }
)
}
diff --git a/opendc-experiments/opendc-experiments-base/src/test/kotlin/org/opendc/experiments/ServiceRegistryTest.kt b/opendc-experiments/opendc-experiments-base/src/test/kotlin/org/opendc/experiments/ServiceRegistryTest.kt
index 67dbaba9..f649b810 100644
--- a/opendc-experiments/opendc-experiments-base/src/test/kotlin/org/opendc/experiments/ServiceRegistryTest.kt
+++ b/opendc-experiments/opendc-experiments-base/src/test/kotlin/org/opendc/experiments/ServiceRegistryTest.kt
@@ -94,7 +94,7 @@ class ServiceRegistryTest {
assertAll(
{ assertNull(registry.resolve("opendc.org", String::class.java)) },
- { assertNull(registry.resolve("opendc.org", Int::class.java)) },
+ { assertNull(registry.resolve("opendc.org", Int::class.java)) }
)
}
diff --git a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/CapelinCli.kt b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/CapelinCli.kt
index 35a51de5..402d1f3b 100644
--- a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/CapelinCli.kt
+++ b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/CapelinCli.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("CapelinCli")
+
package org.opendc.experiments.capelin
import com.github.ajalt.clikt.core.CliktCommand
@@ -113,7 +114,7 @@ internal class CapelinCommand : CliktCommand(name = "capelin") {
"hor-ver" to { HorVerPortfolio() },
"more-hpc" to { MoreHpcPortfolio() },
"more-velocity" to { MoreVelocityPortfolio() },
- "op-phen" to { OperationalPhenomenaPortfolio() },
+ "op-phen" to { OperationalPhenomenaPortfolio() }
)
/**
diff --git a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/CapelinRunner.kt b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/CapelinRunner.kt
index 44079cc2..2c3573dc 100644
--- a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/CapelinRunner.kt
+++ b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/CapelinRunner.kt
@@ -90,10 +90,11 @@ public class CapelinRunner(
val vms = scenario.workload.source.resolve(workloadLoader, Random(seed))
val operationalPhenomena = scenario.operationalPhenomena
val failureModel =
- if (operationalPhenomena.failureFrequency > 0)
+ if (operationalPhenomena.failureFrequency > 0) {
grid5000(Duration.ofSeconds((operationalPhenomena.failureFrequency * 60).roundToLong()))
- else
+ } else {
null
+ }
service.replay(clock, vms, seed, failureModel = failureModel, interference = operationalPhenomena.hasInterference)
}
diff --git a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/topology/TopologyFactories.kt b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/topology/TopologyFactories.kt
index c78925a1..08d4a7e0 100644
--- a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/topology/TopologyFactories.kt
+++ b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/topology/TopologyFactories.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("TopologyFactories")
+
package org.opendc.experiments.capelin.topology
import org.opendc.experiments.compute.topology.HostSpec
diff --git a/opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt b/opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt
index b39f68fd..70363b6c 100644
--- a/opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt
+++ b/opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt
@@ -98,7 +98,7 @@ class CapelinIntegrationTest {
provisioner.runSteps(
setupComputeService(serviceDomain = "compute.opendc.org", { computeScheduler }),
registerComputeMonitor(serviceDomain = "compute.opendc.org", monitor),
- setupHosts(serviceDomain = "compute.opendc.org", topology),
+ setupHosts(serviceDomain = "compute.opendc.org", topology)
)
val service = provisioner.registry.resolve("compute.opendc.org", ComputeService::class.java)!!
@@ -124,7 +124,7 @@ class CapelinIntegrationTest {
{ assertEquals(66977508, monitor.activeTime) { "Incorrect active time" } },
{ assertEquals(3160381, monitor.stealTime) { "Incorrect steal time" } },
{ assertEquals(0, monitor.lostTime) { "Incorrect lost time" } },
- { assertEquals(5.840939264814157E9, monitor.energyUsage, 0.01) { "Incorrect power draw" } },
+ { assertEquals(5.840939264814157E9, monitor.energyUsage, 0.01) { "Incorrect power draw" } }
)
}
@@ -142,7 +142,7 @@ class CapelinIntegrationTest {
provisioner.runSteps(
setupComputeService(serviceDomain = "compute.opendc.org", { computeScheduler }),
registerComputeMonitor(serviceDomain = "compute.opendc.org", monitor),
- setupHosts(serviceDomain = "compute.opendc.org", topology),
+ setupHosts(serviceDomain = "compute.opendc.org", topology)
)
val service = provisioner.registry.resolve("compute.opendc.org", ComputeService::class.java)!!
@@ -181,7 +181,7 @@ class CapelinIntegrationTest {
provisioner.runSteps(
setupComputeService(serviceDomain = "compute.opendc.org", { computeScheduler }),
registerComputeMonitor(serviceDomain = "compute.opendc.org", monitor),
- setupHosts(serviceDomain = "compute.opendc.org", topology),
+ setupHosts(serviceDomain = "compute.opendc.org", topology)
)
val service = provisioner.registry.resolve("compute.opendc.org", ComputeService::class.java)!!
@@ -220,7 +220,7 @@ class CapelinIntegrationTest {
provisioner.runSteps(
setupComputeService(serviceDomain = "compute.opendc.org", { computeScheduler }),
registerComputeMonitor(serviceDomain = "compute.opendc.org", monitor),
- setupHosts(serviceDomain = "compute.opendc.org", topology),
+ setupHosts(serviceDomain = "compute.opendc.org", topology)
)
val service = provisioner.registry.resolve("compute.opendc.org", ComputeService::class.java)!!
@@ -233,7 +233,7 @@ class CapelinIntegrationTest {
{ assertEquals(8539158, monitor.activeTime) { "Active time incorrect" } },
{ assertEquals(0, monitor.stealTime) { "Steal time incorrect" } },
{ assertEquals(0, monitor.lostTime) { "Lost time incorrect" } },
- { assertEquals(2328039558, monitor.uptime) { "Uptime incorrect" } },
+ { assertEquals(2328039558, monitor.uptime) { "Uptime incorrect" } }
)
}
diff --git a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeSchedulers.kt b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeSchedulers.kt
index 9ed2e564..bbc70489 100644
--- a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeSchedulers.kt
+++ b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeSchedulers.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("ComputeSchedulers")
+
package org.opendc.experiments.compute
import org.opendc.compute.service.scheduler.ComputeScheduler
diff --git a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeSteps.kt b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeSteps.kt
index 3ae4b0df..690156e2 100644
--- a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeSteps.kt
+++ b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeSteps.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("ComputeSteps")
+
package org.opendc.experiments.compute
import org.opendc.compute.service.ComputeService
diff --git a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeWorkloadLoader.kt b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeWorkloadLoader.kt
index daf6b505..9aa544cb 100644
--- a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeWorkloadLoader.kt
+++ b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeWorkloadLoader.kt
@@ -116,7 +116,6 @@ public class ComputeWorkloadLoader(private val baseDir: File) {
return try {
while (reader.nextRow()) {
-
val id = reader.getString(idCol)!!
if (!fragments.containsKey(id)) {
continue
@@ -195,7 +194,6 @@ public class ComputeWorkloadLoader(private val baseDir: File) {
val ref = cache.compute(name) { key, oldVal ->
val inst = oldVal?.get()
if (inst == null) {
-
val path = baseDir.resolve(key)
logger.info { "Loading trace $key at $path" }
diff --git a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeWorkloads.kt b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeWorkloads.kt
index 732f761e..4b3a6089 100644
--- a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeWorkloads.kt
+++ b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/ComputeWorkloads.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("ComputeWorkloads")
+
package org.opendc.experiments.compute
import org.opendc.experiments.compute.internal.CompositeComputeWorkload
diff --git a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/FailureModels.kt b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/FailureModels.kt
index 7480e116..ff747066 100644
--- a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/FailureModels.kt
+++ b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/FailureModels.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("FailureModels")
+
package org.opendc.experiments.compute
import org.apache.commons.math3.distribution.LogNormalDistribution
diff --git a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/TraceHelpers.kt b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/TraceHelpers.kt
index 9562baf5..e98636fa 100644
--- a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/TraceHelpers.kt
+++ b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/TraceHelpers.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("TraceHelpers")
+
package org.opendc.experiments.compute
import kotlinx.coroutines.coroutineScope
diff --git a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/export/parquet/ParquetHostDataWriter.kt b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/export/parquet/ParquetHostDataWriter.kt
index df0163d2..979aebeb 100644
--- a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/export/parquet/ParquetHostDataWriter.kt
+++ b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/export/parquet/ParquetHostDataWriter.kt
@@ -206,7 +206,7 @@ public class ParquetHostDataWriter(path: File, bufferSize: Int) :
.named("guests_error"),
Types
.required(PrimitiveType.PrimitiveTypeName.INT32)
- .named("guests_invalid"),
+ .named("guests_invalid")
)
.named("host")
}
diff --git a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/export/parquet/ParquetServiceDataWriter.kt b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/export/parquet/ParquetServiceDataWriter.kt
index 6f1d5ad5..39bc2d11 100644
--- a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/export/parquet/ParquetServiceDataWriter.kt
+++ b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/export/parquet/ParquetServiceDataWriter.kt
@@ -124,7 +124,7 @@ public class ParquetServiceDataWriter(path: File, bufferSize: Int) :
.named("attempts_failure"),
Types
.required(PrimitiveType.PrimitiveTypeName.INT32)
- .named("attempts_error"),
+ .named("attempts_error")
)
.named("service")
}
diff --git a/opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/FaaSServiceProvisioningStep.kt b/opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/FaaSServiceProvisioningStep.kt
index 301ea8c3..3b4200c8 100644
--- a/opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/FaaSServiceProvisioningStep.kt
+++ b/opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/FaaSServiceProvisioningStep.kt
@@ -51,10 +51,11 @@ public class FaaSServiceProvisioningStep internal constructor(
private val coldStartModel: ColdStartModel?
) : ProvisioningStep {
override fun apply(ctx: ProvisioningContext): AutoCloseable {
- val delayInjector = if (coldStartModel != null)
+ val delayInjector = if (coldStartModel != null) {
StochasticDelayInjector(coldStartModel, Random(ctx.seeder.nextLong()))
- else
+ } else {
ZeroDelayInjector
+ }
val deployer = SimFunctionDeployer(ctx.coroutineContext, ctx.clock, machineModel, delayInjector)
val service = FaaSService(
ctx.coroutineContext,
diff --git a/opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/FaaSSteps.kt b/opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/FaaSSteps.kt
index 40e5627b..53cd9c3e 100644
--- a/opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/FaaSSteps.kt
+++ b/opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/FaaSSteps.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("FaaSSteps")
+
package org.opendc.experiments.faas
import org.opendc.experiments.provisioner.ProvisioningContext
diff --git a/opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/TraceHelpers.kt b/opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/TraceHelpers.kt
index cf278606..c4001e2e 100644
--- a/opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/TraceHelpers.kt
+++ b/opendc-experiments/opendc-experiments-faas/src/main/kotlin/org/opendc/experiments/faas/TraceHelpers.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("TraceHelpers")
+
package org.opendc.experiments.faas
import kotlinx.coroutines.coroutineScope
diff --git a/opendc-experiments/opendc-experiments-faas/src/test/kotlin/org/opendc/experiments/faas/FaaSExperiment.kt b/opendc-experiments/opendc-experiments-faas/src/test/kotlin/org/opendc/experiments/faas/FaaSExperiment.kt
index 6f212825..2342c3f6 100644
--- a/opendc-experiments/opendc-experiments-faas/src/test/kotlin/org/opendc/experiments/faas/FaaSExperiment.kt
+++ b/opendc-experiments/opendc-experiments-faas/src/test/kotlin/org/opendc/experiments/faas/FaaSExperiment.kt
@@ -70,7 +70,7 @@ class FaaSExperiment {
assertAll(
{ assertEquals(14, stats.totalInvocations) },
{ assertEquals(2, stats.timelyInvocations) },
- { assertEquals(12, stats.delayedInvocations) },
+ { assertEquals(12, stats.delayedInvocations) }
)
}
}
diff --git a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt
index 9b50758b..c71c4520 100644
--- a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt
+++ b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt
@@ -71,7 +71,8 @@ public class SimTFDevice(
* The [SimMachine] representing the device.
*/
private val machine = SimBareMetalMachine(
- FlowEngine(scope.coroutineContext, clock), MachineModel(listOf(pu), listOf(memory)),
+ FlowEngine(scope.coroutineContext, clock),
+ MachineModel(listOf(pu), listOf(memory)),
SimplePowerDriver(powerModel)
)
diff --git a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/layer/conv/Conv2D.kt b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/layer/conv/Conv2D.kt
index bf4725b7..74124bbd 100644
--- a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/layer/conv/Conv2D.kt
+++ b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/layer/conv/Conv2D.kt
@@ -39,7 +39,7 @@ public class Conv2D(
public val strides: LongArray = LongArray(4), // [1, stride_h, stride_w, 1]
public val activation: Activation = Activation.Relu,
public val padding: ConvPadding = ConvPadding.VALID,
- name: String = "",
+ name: String = ""
) : Layer(name) {
private var padHeight: Double = 0.0
diff --git a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/layer/core/ActivationLayer.kt b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/layer/core/ActivationLayer.kt
index fd25cea6..60b0f754 100644
--- a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/layer/core/ActivationLayer.kt
+++ b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/keras/layer/core/ActivationLayer.kt
@@ -31,7 +31,7 @@ import org.opendc.experiments.tf20.keras.shape.TensorShape
*/
public class ActivationLayer(
public val activation: Activation = Activation.Relu,
- name: String = "",
+ name: String = ""
) : Layer(name) {
override fun build(inputShape: TensorShape) {
diff --git a/opendc-experiments/opendc-experiments-tf20/src/test/kotlin/org/opendc/experiments/tf20/TensorFlowTest.kt b/opendc-experiments/opendc-experiments-tf20/src/test/kotlin/org/opendc/experiments/tf20/TensorFlowTest.kt
index f5d35fa4..c4698058 100644
--- a/opendc-experiments/opendc-experiments-tf20/src/test/kotlin/org/opendc/experiments/tf20/TensorFlowTest.kt
+++ b/opendc-experiments/opendc-experiments-tf20/src/test/kotlin/org/opendc/experiments/tf20/TensorFlowTest.kt
@@ -46,7 +46,12 @@ class TensorFlowTest {
val def = MLEnvironmentReader().readEnvironment(envInput).first()
val device = SimTFDevice(
- def.uid, def.meta["gpu"] as Boolean, coroutineContext, clock, def.model.cpus[0], def.model.memory[0],
+ def.uid,
+ def.meta["gpu"] as Boolean,
+ coroutineContext,
+ clock,
+ def.model.cpus[0],
+ def.model.memory[0],
LinearPowerModel(250.0, 60.0)
)
val strategy = OneDeviceStrategy(device)
@@ -76,7 +81,12 @@ class TensorFlowTest {
val def = MLEnvironmentReader().readEnvironment(envInput).first()
val device = SimTFDevice(
- def.uid, def.meta["gpu"] as Boolean, coroutineContext, clock, def.model.cpus[0], def.model.memory[0],
+ def.uid,
+ def.meta["gpu"] as Boolean,
+ coroutineContext,
+ clock,
+ def.model.cpus[0],
+ def.model.memory[0],
LinearPowerModel(250.0, 60.0)
)
val strategy = OneDeviceStrategy(device)
@@ -106,12 +116,22 @@ class TensorFlowTest {
val def = MLEnvironmentReader().readEnvironment(envInput).first()
val deviceA = SimTFDevice(
- def.uid, def.meta["gpu"] as Boolean, coroutineContext, clock, def.model.cpus[0], def.model.memory[0],
+ def.uid,
+ def.meta["gpu"] as Boolean,
+ coroutineContext,
+ clock,
+ def.model.cpus[0],
+ def.model.memory[0],
LinearPowerModel(250.0, 60.0)
)
val deviceB = SimTFDevice(
- UUID.randomUUID(), def.meta["gpu"] as Boolean, coroutineContext, clock, def.model.cpus[0], def.model.memory[0],
+ UUID.randomUUID(),
+ def.meta["gpu"] as Boolean,
+ coroutineContext,
+ clock,
+ def.model.cpus[0],
+ def.model.memory[0],
LinearPowerModel(250.0, 60.0)
)
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
diff --git a/opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt b/opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt
index 6513296d..9970d93a 100644
--- a/opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt
+++ b/opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt
@@ -101,7 +101,7 @@ internal class SimFaaSServiceTest {
{ assertEquals(1, funcStats.delayedInvocations) },
{ assertEquals(0, funcStats.failedInvocations) },
{ assertEquals(100.0, funcStats.waitTime.mean) },
- { assertEquals(1285.0, funcStats.activeTime.mean) },
+ { assertEquals(1285.0, funcStats.activeTime.mean) }
)
}
}
diff --git a/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt b/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt
index 651c3b63..220b97cc 100644
--- a/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt
@@ -79,7 +79,9 @@ class SimMachineBenchmarks {
return runSimulation {
val engine = FlowEngine(coroutineContext, clock)
val machine = SimBareMetalMachine(
- engine, machineModel, SimplePowerDriver(ConstantPowerModel(0.0))
+ engine,
+ machineModel,
+ SimplePowerDriver(ConstantPowerModel(0.0))
)
return@runSimulation machine.runWorkload(SimTraceWorkload(trace))
}
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/SimBareMetalMachine.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/SimBareMetalMachine.kt
index ee56c8c8..4c824440 100644
--- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/SimBareMetalMachine.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/SimBareMetalMachine.kt
@@ -46,7 +46,7 @@ public class SimBareMetalMachine(
engine: FlowEngine,
model: MachineModel,
powerDriver: PowerDriver,
- public val psu: SimPsu = SimPsu(500.0, mapOf(1.0 to 1.0)),
+ public val psu: SimPsu = SimPsu(500.0, mapOf(1.0 to 1.0))
) : SimAbstractMachine(engine, model) {
/**
* The current power usage of the machine (without PSU loss) in W.
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/device/SimPsu.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/device/SimPsu.kt
index 243790b9..3d3703ae 100644
--- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/device/SimPsu.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/device/SimPsu.kt
@@ -36,7 +36,7 @@ import java.util.TreeMap
*/
public class SimPsu(
private val ratedOutputPower: Double,
- energyEfficiency: Map<Double, Double>,
+ energyEfficiency: Map<Double, Double>
) : SimPowerInlet() {
/**
* The power draw of the machine at this instant.
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimHypervisor.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimHypervisor.kt
index 20d946a4..e1486d71 100644
--- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimHypervisor.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimHypervisor.kt
@@ -211,6 +211,7 @@ public class SimHypervisor(
*/
override val counters: SimHypervisorCounters
get() = _counters
+
@JvmField val _counters = VmCountersImpl(cpus, null)
/**
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/interference/VmInterferenceModel.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/interference/VmInterferenceModel.kt
index 36fad4c3..238bffc0 100644
--- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/interference/VmInterferenceModel.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/interference/VmInterferenceModel.kt
@@ -129,10 +129,11 @@ public class VmInterferenceModel private constructor(
}
cmp = scores[l].compareTo(scores[r]) // Higher penalty first (this means lower performance score first)
- if (cmp != 0)
+ if (cmp != 0) {
cmp
- else
+ } else {
l.compareTo(r)
+ }
}
)
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/AsymptoticPowerModel.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/AsymptoticPowerModel.kt
index 62b85e12..46c397fe 100644
--- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/AsymptoticPowerModel.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/AsymptoticPowerModel.kt
@@ -39,15 +39,16 @@ public class AsymptoticPowerModel(
private val maxPower: Double,
private val idlePower: Double,
private val asymUtil: Double,
- private val isDvfsEnabled: Boolean,
+ private val isDvfsEnabled: Boolean
) : PowerModel {
private val factor: Double = (maxPower - idlePower) / 100
public override fun computePower(utilization: Double): Double =
- if (isDvfsEnabled)
+ if (isDvfsEnabled) {
idlePower + (factor * 100) / 2 * (1 + utilization.pow(3) - E.pow(-utilization.pow(3) / asymUtil))
- else
+ } else {
idlePower + (factor * 100) / 2 * (1 + utilization - E.pow(-utilization / asymUtil))
+ }
override fun toString(): String = "AsymptoticPowerModel[max=$maxPower,idle=$idlePower,asymptotic=$asymUtil]"
}
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/InterpolationPowerModel.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/InterpolationPowerModel.kt
index 2694700c..b17b87a9 100644
--- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/InterpolationPowerModel.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/InterpolationPowerModel.kt
@@ -44,10 +44,11 @@ public class InterpolationPowerModel(private val powerValues: List<Double>) : Po
val powerCil: Double = getAveragePowerValue(utilizationCil)
val delta = (powerCil - powerFlr) / 10
- return if (utilization % 0.1 == 0.0)
+ return if (utilization % 0.1 == 0.0) {
getAveragePowerValue((clampedUtilization * 10).toInt())
- else
+ } else {
powerFlr + delta * (clampedUtilization - utilizationFlr.toDouble() / 10) * 100
+ }
}
override fun toString(): String = "InterpolationPowerModel[entries=${powerValues.size}]"
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/MsePowerModel.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/MsePowerModel.kt
index 612ce2fc..e9e72da8 100644
--- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/MsePowerModel.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/MsePowerModel.kt
@@ -37,7 +37,7 @@ import kotlin.math.pow
public class MsePowerModel(
private val maxPower: Double,
private val idlePower: Double,
- private val calibrationParam: Double,
+ private val calibrationParam: Double
) : PowerModel {
private val factor: Double = (maxPower - idlePower) / 100
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/ZeroIdlePowerDecorator.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/ZeroIdlePowerDecorator.kt
index 886227e1..05ab4631 100644
--- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/ZeroIdlePowerDecorator.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/ZeroIdlePowerDecorator.kt
@@ -29,10 +29,11 @@ package org.opendc.simulator.compute.power
*/
public class ZeroIdlePowerDecorator(private val delegate: PowerModel) : PowerModel {
override fun computePower(utilization: Double): Double {
- return if (utilization == 0.0)
+ return if (utilization == 0.0) {
0.0
- else
+ } else {
delegate.computePower(utilization)
+ }
}
override fun toString(): String = "ZeroIdlePowerDecorator[delegate=$delegate]"
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTrace.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTrace.kt
index e66227b5..db6a4629 100644
--- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTrace.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTrace.kt
@@ -39,7 +39,7 @@ public class SimTrace(
private val usageCol: DoubleArray,
private val deadlineCol: LongArray,
private val coresCol: IntArray,
- private val size: Int,
+ private val size: Int
) {
init {
require(size >= 0) { "Invalid trace size" }
diff --git a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/device/SimPsuTest.kt b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/device/SimPsuTest.kt
index 5481cad2..0a6cb29f 100644
--- a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/device/SimPsuTest.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/device/SimPsuTest.kt
@@ -75,7 +75,7 @@ internal class SimPsuTest {
val energyEfficiency = sortedMapOf(
0.3 to 0.9,
0.7 to 0.92,
- 1.0 to 0.94,
+ 1.0 to 0.94
)
val engine = FlowEngine(coroutineContext, clock)
diff --git a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisorTest.kt b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisorTest.kt
index 9ff492cc..6b498119 100644
--- a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisorTest.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisorTest.kt
@@ -76,7 +76,7 @@ internal class SimFairShareHypervisorTest {
SimTraceFragment(duration * 1000, duration * 1000, 3500.0, 1),
SimTraceFragment(duration * 2000, duration * 1000, 0.0, 1),
SimTraceFragment(duration * 3000, duration * 1000, 183.0, 1)
- ),
+ )
)
val engine = FlowEngine(coroutineContext, clock)
@@ -116,7 +116,7 @@ internal class SimFairShareHypervisorTest {
SimTraceFragment(duration * 1000, duration * 1000, 3500.0, 1),
SimTraceFragment(duration * 2000, duration * 1000, 0.0, 1),
SimTraceFragment(duration * 3000, duration * 1000, 183.0, 1)
- ),
+ )
)
val workloadB =
SimTraceWorkload(
@@ -206,7 +206,7 @@ internal class SimFairShareHypervisorTest {
SimTraceFragment(duration * 1000, duration * 1000, 28.0, 1),
SimTraceFragment(duration * 2000, duration * 1000, 3500.0, 1),
SimTraceFragment(duration * 3000, duration * 1000, 183.0, 1)
- ),
+ )
)
val workloadB =
SimTraceWorkload(
diff --git a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimSpaceSharedHypervisorTest.kt b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimSpaceSharedHypervisorTest.kt
index 7a8da325..57fe3766 100644
--- a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimSpaceSharedHypervisorTest.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimSpaceSharedHypervisorTest.kt
@@ -78,7 +78,7 @@ internal class SimSpaceSharedHypervisorTest {
SimTraceFragment(duration * 1000, duration * 1000, 3500.0, 1),
SimTraceFragment(duration * 2000, duration * 1000, 0.0, 1),
SimTraceFragment(duration * 3000, duration * 1000, 183.0, 1)
- ),
+ )
)
val engine = FlowEngine(coroutineContext, clock)
diff --git a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/power/PStatePowerDriverTest.kt b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/power/PStatePowerDriverTest.kt
index f557c8d3..3c0a55a6 100644
--- a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/power/PStatePowerDriverTest.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/power/PStatePowerDriverTest.kt
@@ -41,7 +41,7 @@ internal class PStatePowerDriverTest {
sortedMapOf(
2800.0 to ConstantPowerModel(200.0),
3300.0 to ConstantPowerModel(300.0),
- 3600.0 to ConstantPowerModel(350.0),
+ 3600.0 to ConstantPowerModel(350.0)
)
)
@@ -61,7 +61,7 @@ internal class PStatePowerDriverTest {
sortedMapOf(
2800.0 to ConstantPowerModel(200.0),
3300.0 to ConstantPowerModel(300.0),
- 3600.0 to ConstantPowerModel(350.0),
+ 3600.0 to ConstantPowerModel(350.0)
)
)
@@ -86,7 +86,7 @@ internal class PStatePowerDriverTest {
sortedMapOf(
2800.0 to ConstantPowerModel(200.0),
3300.0 to ConstantPowerModel(300.0),
- 3600.0 to ConstantPowerModel(350.0),
+ 3600.0 to ConstantPowerModel(350.0)
)
)
@@ -106,7 +106,7 @@ internal class PStatePowerDriverTest {
sortedMapOf(
2800.0 to LinearPowerModel(200.0, 100.0),
3300.0 to LinearPowerModel(250.0, 150.0),
- 4000.0 to LinearPowerModel(300.0, 200.0),
+ 4000.0 to LinearPowerModel(300.0, 200.0)
)
)
diff --git a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/power/PowerModelTest.kt b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/power/PowerModelTest.kt
index 7852534a..67532d5b 100644
--- a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/power/PowerModelTest.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/power/PowerModelTest.kt
@@ -72,7 +72,7 @@ internal class PowerModelTest {
{ assertEquals(189.0, powerModel.computePower(0.8)) },
{ assertEquals(189.0 + 0.7 * 10 * (205 - 189) / 10, powerModel.computePower(0.87)) },
{ assertEquals(205.0, powerModel.computePower(0.9)) },
- { assertEquals(222.0, powerModel.computePower(1.0)) },
+ { assertEquals(222.0, powerModel.computePower(1.0)) }
)
}
@@ -87,7 +87,7 @@ internal class PowerModelTest {
Arguments.of(SqrtPowerModel(350.0, 200.0), 342.302),
Arguments.of(MsePowerModel(350.0, 200.0, 1.4), 340.571),
Arguments.of(AsymptoticPowerModel(350.0, 200.0, 0.3, false), 338.765),
- Arguments.of(AsymptoticPowerModel(350.0, 200.0, 0.3, true), 323.072),
+ Arguments.of(AsymptoticPowerModel(350.0, 200.0, 0.3, true), 323.072)
)
}
}
diff --git a/opendc-simulator/opendc-simulator-core/src/main/java/org/opendc/simulator/SimulationScheduler.java b/opendc-simulator/opendc-simulator-core/src/main/java/org/opendc/simulator/SimulationScheduler.java
index a70c1cda..305bdf5e 100644
--- a/opendc-simulator/opendc-simulator-core/src/main/java/org/opendc/simulator/SimulationScheduler.java
+++ b/opendc-simulator/opendc-simulator-core/src/main/java/org/opendc/simulator/SimulationScheduler.java
@@ -67,7 +67,7 @@ public final class SimulationScheduler implements Executor {
* @param initialTimeMs The initial virtual time of the scheduler in milliseconds since epoch.
*/
public SimulationScheduler(long initialTimeMs) {
- this.currentTime = initialTimeMs;
+ this.currentTime = initialTimeMs;
}
/**
@@ -104,7 +104,8 @@ public final class SimulationScheduler implements Executor {
*/
public int schedule(long delayMs, Runnable task) {
if (delayMs < 0) {
- throw new IllegalArgumentException("Attempted scheduling an event earlier in time (delay " + delayMs + " ms)");
+ throw new IllegalArgumentException(
+ "Attempted scheduling an event earlier in time (delay " + delayMs + " ms)");
}
long target = currentTime + delayMs;
diff --git a/opendc-simulator/opendc-simulator-core/src/main/java/org/opendc/simulator/TaskQueue.java b/opendc-simulator/opendc-simulator-core/src/main/java/org/opendc/simulator/TaskQueue.java
index 7d867b5d..f677e74e 100644
--- a/opendc-simulator/opendc-simulator-core/src/main/java/org/opendc/simulator/TaskQueue.java
+++ b/opendc-simulator/opendc-simulator-core/src/main/java/org/opendc/simulator/TaskQueue.java
@@ -193,7 +193,8 @@ final class TaskQueue {
/**
* Sift up an entry in the heap.
*/
- private static void siftUp(long[] deadlines, int[] ids, Runnable[] tasks, int k, long deadline, int id, Runnable task) {
+ private static void siftUp(
+ long[] deadlines, int[] ids, Runnable[] tasks, int k, long deadline, int id, Runnable task) {
while (k > 0) {
int parent = (k - 1) >>> 1;
long parentDeadline = deadlines[parent];
@@ -218,11 +219,12 @@ final class TaskQueue {
/**
* Sift down an entry in the heap.
*/
- private static void siftDown(long[] deadlines, int[] ids, Runnable[] tasks, int k, int n, long deadline, int id, Runnable task) {
- int half = n >>> 1; // loop while a non-leaf
+ private static void siftDown(
+ long[] deadlines, int[] ids, Runnable[] tasks, int k, int n, long deadline, int id, Runnable task) {
+ int half = n >>> 1; // loop while a non-leaf
while (k < half) {
- int child = (k << 1) + 1; // assume left child is least
+ int child = (k << 1) + 1; // assume left child is least
long childDeadline = deadlines[child];
int childId = ids[child];
diff --git a/opendc-simulator/opendc-simulator-core/src/test/kotlin/org/opendc/simulator/TaskQueueTest.kt b/opendc-simulator/opendc-simulator-core/src/test/kotlin/org/opendc/simulator/TaskQueueTest.kt
index f1559ce3..56dd83aa 100644
--- a/opendc-simulator/opendc-simulator-core/src/test/kotlin/org/opendc/simulator/TaskQueueTest.kt
+++ b/opendc-simulator/opendc-simulator-core/src/test/kotlin/org/opendc/simulator/TaskQueueTest.kt
@@ -47,7 +47,7 @@ class TaskQueueTest {
fun testPollEmpty() {
assertAll(
{ assertEquals(Long.MAX_VALUE, queue.peekDeadline()) },
- { assertNull(queue.poll()) },
+ { assertNull(queue.poll()) }
)
}
@@ -63,7 +63,7 @@ class TaskQueueTest {
assertAll(
{ assertEquals(100, queue.peekDeadline()) },
{ assertEquals(entry, queue.poll()) },
- { assertNull(queue.poll()) },
+ { assertNull(queue.poll()) }
)
}
@@ -86,7 +86,7 @@ class TaskQueueTest {
{ assertEquals(entryB, queue.poll()) },
{ assertEquals(entryC, queue.poll()) },
{ assertEquals(entryA, queue.poll()) },
- { assertNull(queue.poll()) },
+ { assertNull(queue.poll()) }
)
}
@@ -109,7 +109,7 @@ class TaskQueueTest {
{ assertEquals(entryA, queue.poll()) },
{ assertEquals(entryB, queue.poll()) },
{ assertEquals(entryC, queue.poll()) },
- { assertNull(queue.poll()) },
+ { assertNull(queue.poll()) }
)
}
@@ -136,7 +136,7 @@ class TaskQueueTest {
{ assertEquals(entryD, queue.poll()) },
{ assertEquals(entryC, queue.poll()) },
{ assertEquals(entryA, queue.poll()) },
- { assertNull(queue.poll()) },
+ { assertNull(queue.poll()) }
)
}
@@ -160,7 +160,7 @@ class TaskQueueTest {
{ assertEquals(20, queue.peekDeadline()) },
{ assertEquals(entryB, queue.poll()) },
{ assertEquals(entryC, queue.poll()) },
- { assertNull(queue.poll()) },
+ { assertNull(queue.poll()) }
)
}
@@ -184,7 +184,7 @@ class TaskQueueTest {
{ assertEquals(58, queue.peekDeadline()) },
{ assertEquals(entryC, queue.poll()) },
{ assertEquals(entryA, queue.poll()) },
- { assertNull(queue.poll()) },
+ { assertNull(queue.poll()) }
)
}
@@ -208,7 +208,7 @@ class TaskQueueTest {
{ assertEquals(20, queue.peekDeadline()) },
{ assertEquals(entryB, queue.poll()) },
{ assertEquals(entryA, queue.poll()) },
- { assertNull(queue.poll()) },
+ { assertNull(queue.poll()) }
)
}
diff --git a/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/FlowForwarder.kt b/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/FlowForwarder.kt
index 6fa2971a..5202c252 100644
--- a/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/FlowForwarder.kt
+++ b/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/FlowForwarder.kt
@@ -226,10 +226,11 @@ public class FlowForwarder(
* Reset the delegate.
*/
private fun reset() {
- if (isCoupled)
+ if (isCoupled) {
_innerCtx?.close()
- else
+ } else {
_innerCtx?.push(0.0)
+ }
delegate = null
hasDelegateStarted = false
diff --git a/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/internal/FlowConsumerContextImpl.kt b/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/internal/FlowConsumerContextImpl.kt
index 393a2635..fba3af5f 100644
--- a/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/internal/FlowConsumerContextImpl.kt
+++ b/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/internal/FlowConsumerContextImpl.kt
@@ -87,19 +87,21 @@ internal class FlowConsumerContextImpl(
get() = _flags and ConnConvergeSource == ConnConvergeSource
set(value) {
_flags =
- if (value)
+ if (value) {
_flags or ConnConvergeSource
- else
+ } else {
_flags and ConnConvergeSource.inv()
+ }
}
override var shouldConsumerConverge: Boolean
get() = _flags and ConnConvergeConsumer == ConnConvergeConsumer
set(value) {
_flags =
- if (value)
+ if (value) {
_flags or ConnConvergeConsumer
- else
+ } else {
_flags and ConnConvergeConsumer.inv()
+ }
}
/**
@@ -109,10 +111,11 @@ internal class FlowConsumerContextImpl(
get() = _flags and ConnDisableTimers != ConnDisableTimers
set(value) {
_flags =
- if (!value)
+ if (!value) {
_flags or ConnDisableTimers
- else
+ } else {
_flags and ConnDisableTimers.inv()
+ }
}
/**
@@ -241,10 +244,11 @@ internal class FlowConsumerContextImpl(
// IMPORTANT: Re-fetch the flags after the callback might have changed those
flags = _flags
- if (duration != Long.MAX_VALUE)
+ if (duration != Long.MAX_VALUE) {
now + duration
- else
+ } else {
duration
+ }
} else {
deadline
}
diff --git a/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexer.kt b/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexer.kt
index a52a5b0e..d9c6f893 100644
--- a/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexer.kt
+++ b/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexer.kt
@@ -255,7 +255,6 @@ public class MaxMinFlowMultiplexer(
* This method is invoked when one of the inputs converges.
*/
fun convergeInput(input: Input, now: Long) {
-
val lastConverge = _lastConverge
val lastConvergeInput = _lastConvergeInput
val parent = parent
@@ -518,7 +517,7 @@ public class MaxMinFlowMultiplexer(
private val engine: FlowEngine,
private val scheduler: Scheduler,
@JvmField val isCoupled: Boolean,
- initialCapacity: Double,
+ initialCapacity: Double
) : FlowConsumer, FlowConsumerLogic, Comparable<Input> {
/**
* A flag to indicate that the consumer is active.
@@ -787,10 +786,11 @@ public class MaxMinFlowMultiplexer(
return if (_isActivationOutput) {
// If this output is the activation output, synchronously run the scheduler and return the new deadline
val deadline = scheduler.runScheduler(now)
- if (deadline == Long.MAX_VALUE)
+ if (deadline == Long.MAX_VALUE) {
deadline
- else
+ } else {
deadline - now
+ }
} else {
// Output is not the activation output, so trigger activation output and do not install timer for this
// output (by returning `Long.MAX_VALUE`)
diff --git a/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/mux/ForwardingFlowMultiplexerTest.kt b/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/mux/ForwardingFlowMultiplexerTest.kt
index 1a71580b..2409e174 100644
--- a/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/mux/ForwardingFlowMultiplexerTest.kt
+++ b/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/mux/ForwardingFlowMultiplexerTest.kt
@@ -59,7 +59,7 @@ internal class ForwardingFlowMultiplexerTest {
TraceFlowSource.Fragment(duration * 1000, 3500.0),
TraceFlowSource.Fragment(duration * 1000, 0.0),
TraceFlowSource.Fragment(duration * 1000, 183.0)
- ),
+ )
)
val switch = ForwardingFlowMultiplexer(engine)
diff --git a/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexerTest.kt b/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexerTest.kt
index 34198f17..a6bf8ad8 100644
--- a/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexerTest.kt
+++ b/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/mux/MaxMinFlowMultiplexerTest.kt
@@ -73,7 +73,7 @@ internal class MaxMinFlowMultiplexerTest {
TraceFlowSource.Fragment(duration * 1000, 3500.0),
TraceFlowSource.Fragment(duration * 1000, 0.0),
TraceFlowSource.Fragment(duration * 1000, 183.0)
- ),
+ )
)
val switch = MaxMinFlowMultiplexer(scheduler)
@@ -111,7 +111,7 @@ internal class MaxMinFlowMultiplexerTest {
TraceFlowSource.Fragment(duration * 1000, 3500.0),
TraceFlowSource.Fragment(duration * 1000, 0.0),
TraceFlowSource.Fragment(duration * 1000, 183.0)
- ),
+ )
)
val workloadB =
TraceFlowSource(
diff --git a/opendc-simulator/opendc-simulator-power/src/main/kotlin/org/opendc/simulator/power/SimPdu.kt b/opendc-simulator/opendc-simulator-power/src/main/kotlin/org/opendc/simulator/power/SimPdu.kt
index 69ac97ab..c4076310 100644
--- a/opendc-simulator/opendc-simulator-power/src/main/kotlin/org/opendc/simulator/power/SimPdu.kt
+++ b/opendc-simulator/opendc-simulator-power/src/main/kotlin/org/opendc/simulator/power/SimPdu.kt
@@ -39,7 +39,7 @@ import org.opendc.simulator.flow.mux.MaxMinFlowMultiplexer
public class SimPdu(
engine: FlowEngine,
private val idlePower: Double = 0.0,
- private val lossCoefficient: Double = 0.0,
+ private val lossCoefficient: Double = 0.0
) : SimPowerInlet() {
/**
* The [FlowMultiplexer] that distributes the electricity over the PDU outlets.
diff --git a/opendc-simulator/opendc-simulator-power/src/main/kotlin/org/opendc/simulator/power/SimUps.kt b/opendc-simulator/opendc-simulator-power/src/main/kotlin/org/opendc/simulator/power/SimUps.kt
index 00b2926e..0431d3cf 100644
--- a/opendc-simulator/opendc-simulator-power/src/main/kotlin/org/opendc/simulator/power/SimUps.kt
+++ b/opendc-simulator/opendc-simulator-power/src/main/kotlin/org/opendc/simulator/power/SimUps.kt
@@ -40,7 +40,7 @@ import org.opendc.simulator.flow.mux.MaxMinFlowMultiplexer
public class SimUps(
private val engine: FlowEngine,
private val idlePower: Double = 0.0,
- private val lossCoefficient: Double = 0.0,
+ private val lossCoefficient: Double = 0.0
) : SimPowerOutlet() {
/**
* The resource aggregator used to combine the input sources.
diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/InterferenceGroupColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/InterferenceGroupColumns.kt
index 2a80687c..fbbfdea9 100644
--- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/InterferenceGroupColumns.kt
+++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/InterferenceGroupColumns.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("InterferenceGroupColumns")
+
package org.opendc.trace.conv
/**
diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceColumns.kt
index 9b7b8195..89f8dbc4 100644
--- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceColumns.kt
+++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceColumns.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("ResourceColumns")
+
package org.opendc.trace.conv
/**
diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceStateColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceStateColumns.kt
index e9dd7673..5187d501 100644
--- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceStateColumns.kt
+++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceStateColumns.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("ResourceStateColumns")
+
package org.opendc.trace.conv
/**
diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/Tables.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/Tables.kt
index 669ebe58..495628da 100644
--- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/Tables.kt
+++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/Tables.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("Tables")
+
package org.opendc.trace.conv
/**
diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/TaskColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/TaskColumns.kt
index da5c343f..6ca87a60 100644
--- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/TaskColumns.kt
+++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/TaskColumns.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("TaskColumns")
+
package org.opendc.trace.conv
/**
diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/util/TableColumnConversion.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/util/TableColumnConversion.kt
index 8ef080b5..26739e34 100644
--- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/util/TableColumnConversion.kt
+++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/util/TableColumnConversion.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("TableColumnConversions")
+
package org.opendc.trace.util
import org.opendc.trace.TableColumnType
diff --git a/opendc-trace/opendc-trace-azure/src/main/kotlin/org/opendc/trace/azure/AzureTraceFormat.kt b/opendc-trace/opendc-trace-azure/src/main/kotlin/org/opendc/trace/azure/AzureTraceFormat.kt
index 8c87109d..3f64c640 100644
--- a/opendc-trace/opendc-trace-azure/src/main/kotlin/org/opendc/trace/azure/AzureTraceFormat.kt
+++ b/opendc-trace/opendc-trace-azure/src/main/kotlin/org/opendc/trace/azure/AzureTraceFormat.kt
@@ -77,14 +77,14 @@ public class AzureTraceFormat : TraceFormat {
TableColumn(RESOURCE_START_TIME, TableColumnType.Instant),
TableColumn(RESOURCE_STOP_TIME, TableColumnType.Instant),
TableColumn(RESOURCE_CPU_COUNT, TableColumnType.Int),
- TableColumn(RESOURCE_MEM_CAPACITY, TableColumnType.Double),
+ TableColumn(RESOURCE_MEM_CAPACITY, TableColumnType.Double)
)
)
TABLE_RESOURCE_STATES -> TableDetails(
listOf(
TableColumn(RESOURCE_ID, TableColumnType.String),
TableColumn(RESOURCE_STATE_TIMESTAMP, TableColumnType.Instant),
- TableColumn(RESOURCE_STATE_CPU_USAGE_PCT, TableColumnType.Double),
+ TableColumn(RESOURCE_STATE_CPU_USAGE_PCT, TableColumnType.Double)
)
)
else -> throw IllegalArgumentException("Table $table not supported")
diff --git a/opendc-trace/opendc-trace-azure/src/test/kotlin/org/opendc/trace/azure/AzureTraceFormatTest.kt b/opendc-trace/opendc-trace-azure/src/test/kotlin/org/opendc/trace/azure/AzureTraceFormatTest.kt
index a7a18cd5..00cdc174 100644
--- a/opendc-trace/opendc-trace-azure/src/test/kotlin/org/opendc/trace/azure/AzureTraceFormatTest.kt
+++ b/opendc-trace/opendc-trace-azure/src/test/kotlin/org/opendc/trace/azure/AzureTraceFormatTest.kt
@@ -78,7 +78,7 @@ class AzureTraceFormatTest {
{ assertTrue(reader.nextRow()) },
{ assertEquals("x/XsOfHO4ocsV99i4NluqKDuxctW2MMVmwqOPAlg4wp8mqbBOe3wxBlQo0+Qx+uf", reader.getString(RESOURCE_ID)) },
{ assertEquals(1, reader.getInt(RESOURCE_CPU_COUNT)) },
- { assertEquals(1750000.0, reader.getDouble(RESOURCE_MEM_CAPACITY)) },
+ { assertEquals(1750000.0, reader.getDouble(RESOURCE_MEM_CAPACITY)) }
)
reader.close()
diff --git a/opendc-trace/opendc-trace-bitbrains/src/main/kotlin/org/opendc/trace/bitbrains/BitbrainsExTraceFormat.kt b/opendc-trace/opendc-trace-bitbrains/src/main/kotlin/org/opendc/trace/bitbrains/BitbrainsExTraceFormat.kt
index 8abf811c..d364694c 100644
--- a/opendc-trace/opendc-trace-bitbrains/src/main/kotlin/org/opendc/trace/bitbrains/BitbrainsExTraceFormat.kt
+++ b/opendc-trace/opendc-trace-bitbrains/src/main/kotlin/org/opendc/trace/bitbrains/BitbrainsExTraceFormat.kt
@@ -79,7 +79,7 @@ public class BitbrainsExTraceFormat : TraceFormat {
TableColumn(RESOURCE_STATE_CPU_READY_PCT, TableColumnType.Double),
TableColumn(RESOURCE_MEM_CAPACITY, TableColumnType.Double),
TableColumn(RESOURCE_STATE_DISK_READ, TableColumnType.Double),
- TableColumn(RESOURCE_STATE_DISK_WRITE, TableColumnType.Double),
+ TableColumn(RESOURCE_STATE_DISK_WRITE, TableColumnType.Double)
)
)
else -> throw IllegalArgumentException("Table $table not supported")
diff --git a/opendc-trace/opendc-trace-bitbrains/src/main/kotlin/org/opendc/trace/bitbrains/BitbrainsTraceFormat.kt b/opendc-trace/opendc-trace-bitbrains/src/main/kotlin/org/opendc/trace/bitbrains/BitbrainsTraceFormat.kt
index 57fc90e5..b0809735 100644
--- a/opendc-trace/opendc-trace-bitbrains/src/main/kotlin/org/opendc/trace/bitbrains/BitbrainsTraceFormat.kt
+++ b/opendc-trace/opendc-trace-bitbrains/src/main/kotlin/org/opendc/trace/bitbrains/BitbrainsTraceFormat.kt
@@ -93,8 +93,8 @@ public class BitbrainsTraceFormat : TraceFormat {
TableColumn(RESOURCE_STATE_DISK_READ, TableColumnType.Double),
TableColumn(RESOURCE_STATE_DISK_WRITE, TableColumnType.Double),
TableColumn(RESOURCE_STATE_NET_RX, TableColumnType.Double),
- TableColumn(RESOURCE_STATE_NET_TX, TableColumnType.Double),
- ),
+ TableColumn(RESOURCE_STATE_NET_TX, TableColumnType.Double)
+ )
)
else -> throw IllegalArgumentException("Table $table not supported")
}
diff --git a/opendc-trace/opendc-trace-calcite/src/main/kotlin/org/opendc/trace/calcite/TraceTableModify.kt b/opendc-trace/opendc-trace-calcite/src/main/kotlin/org/opendc/trace/calcite/TraceTableModify.kt
index 902a5db4..cc23854f 100644
--- a/opendc-trace/opendc-trace-calcite/src/main/kotlin/org/opendc/trace/calcite/TraceTableModify.kt
+++ b/opendc-trace/opendc-trace-calcite/src/main/kotlin/org/opendc/trace/calcite/TraceTableModify.kt
@@ -126,7 +126,7 @@ internal class TraceTableModify(
Long::class.java,
expression,
INSERT_METHOD,
- convertedChildExpr,
+ convertedChildExpr
)
)
)
diff --git a/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt b/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt
index 77346e74..64bb31c9 100644
--- a/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt
+++ b/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt
@@ -86,7 +86,7 @@ class CalciteTest {
{ assertEquals(300000, rs.getLong("duration")) },
{ assertEquals(0.0, rs.getDouble("cpu_usage")) },
{ assertTrue(rs.next()) },
- { assertEquals("1019", rs.getString("id")) },
+ { assertEquals("1019", rs.getString("id")) }
)
}
}
@@ -98,7 +98,7 @@ class CalciteTest {
{ assertTrue(rs.next()) },
{ assertArrayEquals(arrayOf("1019", "1023", "1052"), rs.getArray("members").array as Array<*>) },
{ assertEquals(0.0, rs.getDouble("target")) },
- { assertEquals(0.8830158730158756, rs.getDouble("score")) },
+ { assertEquals(0.8830158730158756, rs.getDouble("score")) }
)
}
}
@@ -109,7 +109,7 @@ class CalciteTest {
assertAll(
{ assertTrue(rs.next()) },
{ assertEquals(249.59993808, rs.getDouble("max_cpu_usage")) },
- { assertEquals(5.387240309118493, rs.getDouble("avg_cpu_usage")) },
+ { assertEquals(5.387240309118493, rs.getDouble("avg_cpu_usage")) }
)
}
}
@@ -214,7 +214,7 @@ class CalciteTest {
runQuery(trace, "SELECT id FROM trace.resources") { rs ->
assertAll(
{ assertTrue(rs.next()) },
- { assertArrayEquals(byteArrayOf(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2), rs.getBytes("id")) },
+ { assertArrayEquals(byteArrayOf(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2), rs.getBytes("id")) }
)
}
}
diff --git a/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt b/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt
index eb4bc769..735cedce 100644
--- a/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt
+++ b/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt
@@ -48,7 +48,7 @@ class TraceSchemaFactoryTest {
{ assertEquals("1019", rs.getString("id")) },
{ assertEquals(1, rs.getInt("cpu_count")) },
{ assertEquals(Timestamp.valueOf("2013-08-12 13:40:46.0"), rs.getTimestamp("start_time")) },
- { assertEquals(181352.0, rs.getDouble("mem_capacity")) },
+ { assertEquals(181352.0, rs.getDouble("mem_capacity")) }
)
} finally {
rs.close()
diff --git a/opendc-trace/opendc-trace-gwf/src/main/kotlin/org/opendc/trace/gwf/GwfTraceFormat.kt b/opendc-trace/opendc-trace-gwf/src/main/kotlin/org/opendc/trace/gwf/GwfTraceFormat.kt
index c7fbd4b5..d2ded0ee 100644
--- a/opendc-trace/opendc-trace-gwf/src/main/kotlin/org/opendc/trace/gwf/GwfTraceFormat.kt
+++ b/opendc-trace/opendc-trace-gwf/src/main/kotlin/org/opendc/trace/gwf/GwfTraceFormat.kt
@@ -72,7 +72,7 @@ public class GwfTraceFormat : TraceFormat {
TableColumn(TASK_RUNTIME, TableColumnType.Duration),
TableColumn(TASK_REQ_NCPUS, TableColumnType.Int),
TableColumn(TASK_ALLOC_NCPUS, TableColumnType.Int),
- TableColumn(TASK_PARENTS, TableColumnType.Set(TableColumnType.String)),
+ TableColumn(TASK_PARENTS, TableColumnType.Set(TableColumnType.String))
)
)
else -> throw IllegalArgumentException("Table $table not supported")
diff --git a/opendc-trace/opendc-trace-gwf/src/test/kotlin/org/opendc/trace/gwf/GwfTraceFormatTest.kt b/opendc-trace/opendc-trace-gwf/src/test/kotlin/org/opendc/trace/gwf/GwfTraceFormatTest.kt
index 9c97547a..c75e86df 100644
--- a/opendc-trace/opendc-trace-gwf/src/test/kotlin/org/opendc/trace/gwf/GwfTraceFormatTest.kt
+++ b/opendc-trace/opendc-trace-gwf/src/test/kotlin/org/opendc/trace/gwf/GwfTraceFormatTest.kt
@@ -82,7 +82,7 @@ internal class GwfTraceFormatTest {
{ assertEquals("1", reader.getString(TASK_ID)) },
{ assertEquals(Instant.ofEpochSecond(16), reader.getInstant(TASK_SUBMIT_TIME)) },
{ assertEquals(Duration.ofSeconds(11), reader.getDuration(TASK_RUNTIME)) },
- { assertEquals(emptySet<String>(), reader.getSet(TASK_PARENTS, String::class.java)) },
+ { assertEquals(emptySet<String>(), reader.getSet(TASK_PARENTS, String::class.java)) }
)
}
@@ -101,7 +101,7 @@ internal class GwfTraceFormatTest {
{ assertEquals("7", reader.getString(TASK_ID)) },
{ assertEquals(Instant.ofEpochSecond(87), reader.getInstant(TASK_SUBMIT_TIME)) },
{ assertEquals(Duration.ofSeconds(11), reader.getDuration(TASK_RUNTIME)) },
- { assertEquals(setOf("4", "5", "6"), reader.getSet(TASK_PARENTS, String::class.java)) },
+ { assertEquals(setOf("4", "5", "6"), reader.getSet(TASK_PARENTS, String::class.java)) }
)
}
diff --git a/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/OdcVmTraceFormat.kt b/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/OdcVmTraceFormat.kt
index 07a26fb5..c4790538 100644
--- a/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/OdcVmTraceFormat.kt
+++ b/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/OdcVmTraceFormat.kt
@@ -95,7 +95,7 @@ public class OdcVmTraceFormat : TraceFormat {
TableColumn(RESOURCE_STOP_TIME, TableColumnType.Instant),
TableColumn(RESOURCE_CPU_COUNT, TableColumnType.Int),
TableColumn(RESOURCE_CPU_CAPACITY, TableColumnType.Double),
- TableColumn(RESOURCE_MEM_CAPACITY, TableColumnType.Double),
+ TableColumn(RESOURCE_MEM_CAPACITY, TableColumnType.Double)
)
)
TABLE_RESOURCE_STATES -> TableDetails(
@@ -104,14 +104,14 @@ public class OdcVmTraceFormat : TraceFormat {
TableColumn(RESOURCE_STATE_TIMESTAMP, TableColumnType.Instant),
TableColumn(RESOURCE_STATE_DURATION, TableColumnType.Duration),
TableColumn(RESOURCE_CPU_COUNT, TableColumnType.Int),
- TableColumn(RESOURCE_STATE_CPU_USAGE, TableColumnType.Double),
+ TableColumn(RESOURCE_STATE_CPU_USAGE, TableColumnType.Double)
)
)
TABLE_INTERFERENCE_GROUPS -> TableDetails(
listOf(
TableColumn(INTERFERENCE_GROUP_MEMBERS, TableColumnType.Set(TableColumnType.String)),
TableColumn(INTERFERENCE_GROUP_TARGET, TableColumnType.Double),
- TableColumn(INTERFERENCE_GROUP_SCORE, TableColumnType.Double),
+ TableColumn(INTERFERENCE_GROUP_SCORE, TableColumnType.Double)
)
)
else -> throw IllegalArgumentException("Table $table not supported")
@@ -130,10 +130,11 @@ public class OdcVmTraceFormat : TraceFormat {
}
TABLE_INTERFERENCE_GROUPS -> {
val modelPath = path.resolve("interference-model.json")
- val parser = if (modelPath.exists())
+ val parser = if (modelPath.exists()) {
jsonFactory.createParser(modelPath.toFile())
- else
+ } else {
jsonFactory.createParser("[]") // If model does not exist, return empty model
+ }
OdcVmInterferenceJsonTableReader(parser)
}
diff --git a/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceReadSupport.kt b/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceReadSupport.kt
index aafa23a4..52911d5f 100644
--- a/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceReadSupport.kt
+++ b/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceReadSupport.kt
@@ -55,7 +55,7 @@ internal class ResourceReadSupport(private val projection: List<String>?) : Read
"cpu_count" to RESOURCE_CPU_COUNT,
"cpu_capacity" to RESOURCE_CPU_CAPACITY,
"requiredMemory" to RESOURCE_MEM_CAPACITY,
- "mem_capacity" to RESOURCE_MEM_CAPACITY,
+ "mem_capacity" to RESOURCE_MEM_CAPACITY
)
override fun init(context: InitContext): ReadContext {
@@ -111,7 +111,7 @@ internal class ResourceReadSupport(private val projection: List<String>?) : Read
.named("maxCores"),
Types
.required(PrimitiveType.PrimitiveTypeName.INT64)
- .named("requiredMemory"),
+ .named("requiredMemory")
)
.named("resource")
@@ -141,7 +141,7 @@ internal class ResourceReadSupport(private val projection: List<String>?) : Read
.named("cpu_capacity"),
Types
.required(PrimitiveType.PrimitiveTypeName.INT64)
- .named("mem_capacity"),
+ .named("mem_capacity")
)
.named("resource")
diff --git a/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceStateReadSupport.kt b/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceStateReadSupport.kt
index 282501f3..56366cd8 100644
--- a/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceStateReadSupport.kt
+++ b/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceStateReadSupport.kt
@@ -52,7 +52,7 @@ internal class ResourceStateReadSupport(private val projection: List<String>?) :
"cores" to RESOURCE_CPU_COUNT,
"cpu_count" to RESOURCE_CPU_COUNT,
"cpuUsage" to RESOURCE_STATE_CPU_USAGE,
- "cpu_usage" to RESOURCE_STATE_CPU_USAGE,
+ "cpu_usage" to RESOURCE_STATE_CPU_USAGE
)
override fun init(context: InitContext): ReadContext {
diff --git a/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceWriteSupport.kt b/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceWriteSupport.kt
index 790ff4e8..cd428754 100644
--- a/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceWriteSupport.kt
+++ b/opendc-trace/opendc-trace-opendc/src/main/kotlin/org/opendc/trace/opendc/parquet/ResourceWriteSupport.kt
@@ -110,7 +110,7 @@ internal class ResourceWriteSupport : WriteSupport<Resource>() {
.named("cpu_capacity"),
Types
.required(PrimitiveType.PrimitiveTypeName.INT64)
- .named("mem_capacity"),
+ .named("mem_capacity")
)
.named("resource")
}
diff --git a/opendc-trace/opendc-trace-opendc/src/test/kotlin/org/opendc/trace/opendc/OdcVmTraceFormatTest.kt b/opendc-trace/opendc-trace-opendc/src/test/kotlin/org/opendc/trace/opendc/OdcVmTraceFormatTest.kt
index ad87b085..d3c3b35b 100644
--- a/opendc-trace/opendc-trace-opendc/src/test/kotlin/org/opendc/trace/opendc/OdcVmTraceFormatTest.kt
+++ b/opendc-trace/opendc-trace-opendc/src/test/kotlin/org/opendc/trace/opendc/OdcVmTraceFormatTest.kt
@@ -131,7 +131,7 @@ internal class OdcVmTraceFormatTest {
{ assertEquals(1, reader.getInt(RESOURCE_CPU_COUNT)) },
{ assertEquals(1024.0, reader.getDouble(RESOURCE_CPU_CAPACITY)) },
{ assertEquals(1024.0, reader.getDouble(RESOURCE_MEM_CAPACITY)) },
- { assertFalse(reader.nextRow()) },
+ { assertFalse(reader.nextRow()) }
)
reader.close()
@@ -178,7 +178,7 @@ internal class OdcVmTraceFormatTest {
{ assertEquals(Instant.EPOCH, reader.getInstant(RESOURCE_STATE_TIMESTAMP)) },
{ assertEquals(1, reader.getInt(RESOURCE_CPU_COUNT)) },
{ assertEquals(23.0, reader.getDouble(RESOURCE_STATE_CPU_USAGE)) },
- { assertFalse(reader.nextRow()) },
+ { assertFalse(reader.nextRow()) }
)
reader.close()
@@ -247,7 +247,7 @@ internal class OdcVmTraceFormatTest {
{ assertEquals(setOf("a", "b", "d"), reader.getSet(INTERFERENCE_GROUP_MEMBERS, String::class.java)) },
{ assertEquals(0.5, reader.getDouble(INTERFERENCE_GROUP_TARGET)) },
{ assertEquals(0.9, reader.getDouble(INTERFERENCE_GROUP_SCORE)) },
- { assertFalse(reader.nextRow()) },
+ { assertFalse(reader.nextRow()) }
)
reader.close()
diff --git a/opendc-trace/opendc-trace-parquet/src/main/kotlin/org/opendc/trace/util/parquet/LocalParquetReader.kt b/opendc-trace/opendc-trace-parquet/src/main/kotlin/org/opendc/trace/util/parquet/LocalParquetReader.kt
index eef83956..031bad60 100644
--- a/opendc-trace/opendc-trace-parquet/src/main/kotlin/org/opendc/trace/util/parquet/LocalParquetReader.kt
+++ b/opendc-trace/opendc-trace-parquet/src/main/kotlin/org/opendc/trace/util/parquet/LocalParquetReader.kt
@@ -46,14 +46,15 @@ public class LocalParquetReader<out T>(
/**
* The input files to process.
*/
- private val filesIterator = if (path.isDirectory())
+ private val filesIterator = if (path.isDirectory()) {
Files.list(path)
.filter { !it.isDirectory() }
.sorted()
.map { LocalInputFile(it) }
.iterator()
- else
+ } else {
listOf(LocalInputFile(path)).iterator()
+ }
/**
* The Parquet reader to use.
@@ -76,10 +77,11 @@ public class LocalParquetReader<out T>(
} else {
initReader()
- if (reader == null)
+ if (reader == null) {
null
- else
+ } else {
read()
+ }
}
} catch (e: InterruptedException) {
throw IOException(e)
diff --git a/opendc-trace/opendc-trace-swf/src/test/kotlin/org/opendc/trace/swf/SwfTraceFormatTest.kt b/opendc-trace/opendc-trace-swf/src/test/kotlin/org/opendc/trace/swf/SwfTraceFormatTest.kt
index 436f2572..71d6dee3 100644
--- a/opendc-trace/opendc-trace-swf/src/test/kotlin/org/opendc/trace/swf/SwfTraceFormatTest.kt
+++ b/opendc-trace/opendc-trace-swf/src/test/kotlin/org/opendc/trace/swf/SwfTraceFormatTest.kt
@@ -77,7 +77,7 @@ internal class SwfTraceFormatTest {
{ assertEquals(306, reader.getInt(TASK_ALLOC_NCPUS)) },
{ assertTrue(reader.nextRow()) },
{ assertEquals("2", reader.getString(TASK_ID)) },
- { assertEquals(17, reader.getInt(TASK_ALLOC_NCPUS)) },
+ { assertEquals(17, reader.getInt(TASK_ALLOC_NCPUS)) }
)
reader.close()
diff --git a/opendc-trace/opendc-trace-testkit/src/main/kotlin/org/opendc/trace/testkit/TableReaderTestKit.kt b/opendc-trace/opendc-trace-testkit/src/main/kotlin/org/opendc/trace/testkit/TableReaderTestKit.kt
index dc0f3198..4624cba0 100644
--- a/opendc-trace/opendc-trace-testkit/src/main/kotlin/org/opendc/trace/testkit/TableReaderTestKit.kt
+++ b/opendc-trace/opendc-trace-testkit/src/main/kotlin/org/opendc/trace/testkit/TableReaderTestKit.kt
@@ -89,7 +89,7 @@ public abstract class TableReaderTestKit {
{ assertThrows<IllegalArgumentException> { reader.getDuration(-1) } },
{ assertThrows<IllegalArgumentException> { reader.getList(-1, Any::class.java) } },
{ assertThrows<IllegalArgumentException> { reader.getSet(-1, Any::class.java) } },
- { assertThrows<IllegalArgumentException> { reader.getMap(-1, Any::class.java, Any::class.java) } },
+ { assertThrows<IllegalArgumentException> { reader.getMap(-1, Any::class.java, Any::class.java) } }
)
}
diff --git a/opendc-trace/opendc-trace-testkit/src/main/kotlin/org/opendc/trace/testkit/TableWriterTestKit.kt b/opendc-trace/opendc-trace-testkit/src/main/kotlin/org/opendc/trace/testkit/TableWriterTestKit.kt
index 34bcbaf3..3cd05f50 100644
--- a/opendc-trace/opendc-trace-testkit/src/main/kotlin/org/opendc/trace/testkit/TableWriterTestKit.kt
+++ b/opendc-trace/opendc-trace-testkit/src/main/kotlin/org/opendc/trace/testkit/TableWriterTestKit.kt
@@ -88,7 +88,7 @@ public abstract class TableWriterTestKit {
{ assertThrows<IllegalArgumentException> { writer.setDuration(-1, Duration.ofMinutes(5)) } },
{ assertThrows<IllegalArgumentException> { writer.setList(-1, listOf("test")) } },
{ assertThrows<IllegalArgumentException> { writer.setSet(-1, setOf("test")) } },
- { assertThrows<IllegalArgumentException> { writer.setMap(-1, mapOf("test" to "test")) } },
+ { assertThrows<IllegalArgumentException> { writer.setMap(-1, mapOf("test" to "test")) } }
)
}
diff --git a/opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/ConvertCommand.kt b/opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/ConvertCommand.kt
index 13e05a0b..bf0e2e3b 100644
--- a/opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/ConvertCommand.kt
+++ b/opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/ConvertCommand.kt
@@ -105,7 +105,7 @@ internal class ConvertCommand : CliktCommand(name = "convert", help = "Convert b
*/
private val converter by option("-c", "--converter", help = "converter strategy to use").groupChoice(
"default" to DefaultTraceConverter(),
- "azure" to AzureTraceConverter(),
+ "azure" to AzureTraceConverter()
).defaultByName("default")
override fun run() {
diff --git a/opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/QueryCommand.kt b/opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/QueryCommand.kt
index b79a9f13..98b4cdf5 100644
--- a/opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/QueryCommand.kt
+++ b/opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/QueryCommand.kt
@@ -121,7 +121,7 @@ internal class QueryCommand : CliktCommand(name = "query", help = "Query workloa
val options = mapOf(
Printer.COLUMNS to List(meta.columnCount) { meta.getColumnName(it + 1) },
- Printer.BORDER to "|",
+ Printer.BORDER to "|"
)
val data = mutableListOf<Map<String, Any>>()
diff --git a/opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/TraceTools.kt b/opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/TraceTools.kt
index b480484b..8f3dc60d 100644
--- a/opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/TraceTools.kt
+++ b/opendc-trace/opendc-trace-tools/src/main/kotlin/org/opendc/trace/tools/TraceTools.kt
@@ -21,6 +21,7 @@
*/
@file:JvmName("TraceTools")
+
package org.opendc.trace.tools
import com.github.ajalt.clikt.core.CliktCommand
diff --git a/opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt b/opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt
index 80a9d80e..75f4b413 100644
--- a/opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt
+++ b/opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt
@@ -81,7 +81,7 @@ class WfFormatTraceFormatTest {
{ assertEquals("makebwaindex_mammoth_mt_krause.fasta", reader.getString(TASK_ID)) },
{ assertEquals("eager-nextflow-chameleon", reader.getString(TASK_WORKFLOW_ID)) },
{ assertEquals(172000, reader.getDuration(TASK_RUNTIME)?.toMillis()) },
- { assertEquals(emptySet<String>(), reader.getSet(TASK_PARENTS, String::class.java)) },
+ { assertEquals(emptySet<String>(), reader.getSet(TASK_PARENTS, String::class.java)) }
)
assertAll(
@@ -89,7 +89,7 @@ class WfFormatTraceFormatTest {
{ assertEquals("makeseqdict_mammoth_mt_krause.fasta", reader.getString(TASK_ID)) },
{ assertEquals("eager-nextflow-chameleon", reader.getString(TASK_WORKFLOW_ID)) },
{ assertEquals(175000, reader.getDuration(TASK_RUNTIME)?.toMillis()) },
- { assertEquals(setOf("makebwaindex_mammoth_mt_krause.fasta"), reader.getSet(TASK_PARENTS, String::class.java)) },
+ { assertEquals(setOf("makebwaindex_mammoth_mt_krause.fasta"), reader.getSet(TASK_PARENTS, String::class.java)) }
)
reader.close()
diff --git a/opendc-trace/opendc-trace-wtf/src/main/kotlin/org/opendc/trace/wtf/parquet/TaskReadSupport.kt b/opendc-trace/opendc-trace-wtf/src/main/kotlin/org/opendc/trace/wtf/parquet/TaskReadSupport.kt
index 47d26ec5..33be38d4 100644
--- a/opendc-trace/opendc-trace-wtf/src/main/kotlin/org/opendc/trace/wtf/parquet/TaskReadSupport.kt
+++ b/opendc-trace/opendc-trace-wtf/src/main/kotlin/org/opendc/trace/wtf/parquet/TaskReadSupport.kt
@@ -139,7 +139,7 @@ internal class TaskReadSupport(private val projection: List<String>?) : ReadSupp
.named("list")
)
.`as`(LogicalTypeAnnotation.listType())
- .named("parents"),
+ .named("parents")
)
.named("task")
}
diff --git a/opendc-trace/opendc-trace-wtf/src/test/kotlin/org/opendc/trace/wtf/WtfTraceFormatTest.kt b/opendc-trace/opendc-trace-wtf/src/test/kotlin/org/opendc/trace/wtf/WtfTraceFormatTest.kt
index 16462217..9cd9538f 100644
--- a/opendc-trace/opendc-trace-wtf/src/test/kotlin/org/opendc/trace/wtf/WtfTraceFormatTest.kt
+++ b/opendc-trace/opendc-trace-wtf/src/test/kotlin/org/opendc/trace/wtf/WtfTraceFormatTest.kt
@@ -89,7 +89,7 @@ class WtfTraceFormatTest {
setOf("584055316413447529", "133113685133695608", "1008582348422865408"),
reader.getSet(TASK_PARENTS, String::class.java)
)
- },
+ }
)
assertAll(
@@ -103,7 +103,7 @@ class WtfTraceFormatTest {
setOf("584055316413447529", "133113685133695608", "1008582348422865408"),
reader.getSet(TASK_PARENTS, String::class.java)
)
- },
+ }
)
reader.close()
diff --git a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/Room.kt b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/Room.kt
index 5b305168..c5499150 100644
--- a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/Room.kt
+++ b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/Room.kt
@@ -29,5 +29,5 @@ public data class Room(
val id: String,
val name: String,
val tiles: Set<RoomTile>,
- val topologyId: String? = null,
+ val topologyId: String? = null
)
diff --git a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/RoomTile.kt b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/RoomTile.kt
index 666d66ee..53cb53cd 100644
--- a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/RoomTile.kt
+++ b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/RoomTile.kt
@@ -30,5 +30,5 @@ public data class RoomTile(
val positionX: Double,
val positionY: Double,
val rack: Rack? = null,
- val roomId: String? = null,
+ val roomId: String? = null
)
diff --git a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/Trace.kt b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/Trace.kt
index 2952a273..1c086cd8 100644
--- a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/Trace.kt
+++ b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/Trace.kt
@@ -32,5 +32,5 @@ package org.opendc.web.proto
public data class Trace(
val id: String,
val name: String,
- val type: String,
+ val type: String
)
diff --git a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Portfolio.kt b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Portfolio.kt
index 916d8cf0..5faad5b3 100644
--- a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Portfolio.kt
+++ b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Portfolio.kt
@@ -39,5 +39,5 @@ public data class Portfolio(
val id: Long,
val number: Int,
val name: String,
- val targets: Targets,
+ val targets: Targets
)
diff --git a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Topology.kt b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Topology.kt
index 4bffdee9..bc185aea 100644
--- a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Topology.kt
+++ b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/runner/Topology.kt
@@ -36,5 +36,5 @@ public data class Topology(
val name: String,
val rooms: List<Room>,
val createdAt: Instant,
- val updatedAt: Instant,
+ val updatedAt: Instant
)
diff --git a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Portfolio.kt b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Portfolio.kt
index 6f468e79..99d0f65e 100644
--- a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Portfolio.kt
+++ b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Portfolio.kt
@@ -67,6 +67,6 @@ public data class Portfolio(
val id: Long,
val number: Int,
val name: String,
- val targets: Targets,
+ val targets: Targets
)
}
diff --git a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/ProjectRole.kt b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/ProjectRole.kt
index 0f6de1fc..ea6a30ab 100644
--- a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/ProjectRole.kt
+++ b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/ProjectRole.kt
@@ -39,5 +39,5 @@ public enum class ProjectRole {
/**
* The user owns the project (so he can delete it).
*/
- OWNER,
+ OWNER
}
diff --git a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Scenario.kt b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Scenario.kt
index 552a4912..ed77ef08 100644
--- a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Scenario.kt
+++ b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Scenario.kt
@@ -58,7 +58,7 @@ public data class Scenario(
val workload: Workload.Spec,
val topology: Long,
val phenomena: OperationalPhenomena,
- val schedulerName: String,
+ val schedulerName: String
)
/**
diff --git a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Topology.kt b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Topology.kt
index a144a2e6..73748bb9 100644
--- a/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Topology.kt
+++ b/opendc-web/opendc-web-proto/src/main/kotlin/org/opendc/web/proto/user/Topology.kt
@@ -37,7 +37,7 @@ public data class Topology(
val name: String,
val rooms: List<Room>,
val createdAt: Instant,
- val updatedAt: Instant,
+ val updatedAt: Instant
) {
/**
* Create a new topology for a project.
@@ -70,6 +70,6 @@ public data class Topology(
val number: Int,
val name: String,
val createdAt: Instant,
- val updatedAt: Instant,
+ val updatedAt: Instant
)
}
diff --git a/opendc-web/opendc-web-runner-quarkus-deployment/src/main/java/org/opendc/web/runner/deployment/OpenDCRunnerProcessor.java b/opendc-web/opendc-web-runner-quarkus-deployment/src/main/java/org/opendc/web/runner/deployment/OpenDCRunnerProcessor.java
index 94921454..85a973e7 100644
--- a/opendc-web/opendc-web-runner-quarkus-deployment/src/main/java/org/opendc/web/runner/deployment/OpenDCRunnerProcessor.java
+++ b/opendc-web/opendc-web-runner-quarkus-deployment/src/main/java/org/opendc/web/runner/deployment/OpenDCRunnerProcessor.java
@@ -22,6 +22,8 @@
package org.opendc.web.runner.deployment;
+import static io.quarkus.deployment.annotations.ExecutionTime.RUNTIME_INIT;
+
import io.quarkus.arc.deployment.UnremovableBeanBuildItem;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
@@ -30,19 +32,15 @@ import io.quarkus.deployment.builditem.*;
import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem;
import io.quarkus.deployment.util.ServiceUtil;
import io.quarkus.runtime.RuntimeValue;
+import java.io.IOException;
+import java.util.Set;
+import java.util.function.BooleanSupplier;
import org.opendc.trace.spi.TraceFormat;
import org.opendc.web.runner.JobManager;
import org.opendc.web.runner.OpenDCRunner;
import org.opendc.web.runner.runtime.OpenDCRunnerRecorder;
import org.opendc.web.runner.runtime.OpenDCRunnerRuntimeConfig;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.Set;
-import java.util.function.BooleanSupplier;
-
-import static io.quarkus.deployment.annotations.ExecutionTime.RUNTIME_INIT;
-
/**
* Build processor for the OpenDC web runner Quarkus extension.
*/
@@ -65,12 +63,11 @@ public class OpenDCRunnerProcessor {
void registerTraceFormats(BuildProducer<ServiceProviderBuildItem> services) throws IOException {
String service = "META-INF/services/" + TraceFormat.class.getName();
- Set<String> implementations = ServiceUtil.classNamesNamedIn(Thread.currentThread().getContextClassLoader(),
- service);
+ Set<String> implementations =
+ ServiceUtil.classNamesNamedIn(Thread.currentThread().getContextClassLoader(), service);
services.produce(
- new ServiceProviderBuildItem(TraceFormat.class.getName(),
- implementations.toArray(new String[0])));
+ new ServiceProviderBuildItem(TraceFormat.class.getName(), implementations.toArray(new String[0])));
}
/**
@@ -86,9 +83,10 @@ public class OpenDCRunnerProcessor {
*/
@BuildStep(onlyIf = IsIncluded.class)
@Record(RUNTIME_INIT)
- ServiceStartBuildItem createRunnerService(OpenDCRunnerRecorder recorder,
- OpenDCRunnerRuntimeConfig config,
- BuildProducer<OpenDCRunnerBuildItem> runnerBuildItem) {
+ ServiceStartBuildItem createRunnerService(
+ OpenDCRunnerRecorder recorder,
+ OpenDCRunnerRuntimeConfig config,
+ BuildProducer<OpenDCRunnerBuildItem> runnerBuildItem) {
RuntimeValue<OpenDCRunner> runner = recorder.createRunner(config);
runnerBuildItem.produce(new OpenDCRunnerBuildItem(runner));
return new ServiceStartBuildItem("OpenDCRunnerService");
@@ -99,12 +97,13 @@ public class OpenDCRunnerProcessor {
*/
@BuildStep(onlyIf = IsIncluded.class)
@Record(RUNTIME_INIT)
- void startRunnerService(ApplicationStartBuildItem start,
- OpenDCRunnerBuildItem runnerBuildItem,
- OpenDCRunnerRecorder recorder,
- OpenDCRunnerRuntimeConfig config,
- ShutdownContextBuildItem shutdownContextBuildItem) {
- recorder.startRunner(runnerBuildItem.getRunner(), config,shutdownContextBuildItem);
+ void startRunnerService(
+ ApplicationStartBuildItem start,
+ OpenDCRunnerBuildItem runnerBuildItem,
+ OpenDCRunnerRecorder recorder,
+ OpenDCRunnerRuntimeConfig config,
+ ShutdownContextBuildItem shutdownContextBuildItem) {
+ recorder.startRunner(runnerBuildItem.getRunner(), config, shutdownContextBuildItem);
}
/**
diff --git a/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java b/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java
index f5c056ef..76f2368f 100644
--- a/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java
+++ b/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java
@@ -25,13 +25,12 @@ package org.opendc.web.runner.runtime;
import io.quarkus.runtime.RuntimeValue;
import io.quarkus.runtime.ShutdownContext;
import io.quarkus.runtime.annotations.Recorder;
+import java.io.File;
+import javax.enterprise.inject.spi.CDI;
import org.jboss.logging.Logger;
import org.opendc.web.runner.JobManager;
import org.opendc.web.runner.OpenDCRunner;
-import javax.enterprise.inject.spi.CDI;
-import java.io.File;
-
/**
* Helper class for starting the OpenDC web runner.
*/
@@ -52,13 +51,12 @@ public class OpenDCRunnerRecorder {
JobManager manager = CDI.current().select(JobManager.class).get();
OpenDCRunner runner = new OpenDCRunner(
- manager,
- new File(config.tracePath),
- parallelism,
- config.jobTimeout,
- config.pollInterval,
- config.heartbeatInterval
- );
+ manager,
+ new File(config.tracePath),
+ parallelism,
+ config.jobTimeout,
+ config.pollInterval,
+ config.heartbeatInterval);
return new RuntimeValue<>(runner);
}
@@ -66,9 +64,8 @@ public class OpenDCRunnerRecorder {
/**
* Helper method to start the OpenDC runner service.
*/
- public void startRunner(RuntimeValue<OpenDCRunner> runner,
- OpenDCRunnerRuntimeConfig config,
- ShutdownContext shutdownContext) {
+ public void startRunner(
+ RuntimeValue<OpenDCRunner> runner, OpenDCRunnerRuntimeConfig config, ShutdownContext shutdownContext) {
if (config.enable) {
LOGGER.info("Starting OpenDC Runner in background (polling every " + config.pollInterval + ")");
diff --git a/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRuntimeConfig.java b/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRuntimeConfig.java
index e9258f06..61c07e48 100644
--- a/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRuntimeConfig.java
+++ b/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRuntimeConfig.java
@@ -25,7 +25,6 @@ package org.opendc.web.runner.runtime;
import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;
-
import java.time.Duration;
/**
diff --git a/opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt b/opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt
index 56fecf78..299c4d09 100644
--- a/opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt
+++ b/opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt
@@ -109,7 +109,7 @@ class RunnerCli : CliktCommand(name = "opendc-runner") {
*/
private val parallelism by option(
"--parallelism",
- help = "maximum number of threads for simulations",
+ help = "maximum number of threads for simulations"
)
.int()
.default(Runtime.getRuntime().availableProcessors() - 1)
diff --git a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt
index b0f99084..226bad47 100644
--- a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt
+++ b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt
@@ -215,7 +215,7 @@ public class OpenDCRunner(
private inner class SimulationTask(
private val scenario: Scenario,
private val repeat: Int,
- private val topology: List<HostSpec>,
+ private val topology: List<HostSpec>
) : RecursiveTask<WebComputeMonitor.Results>() {
override fun compute(): WebComputeMonitor.Results {
val monitor = WebComputeMonitor()
@@ -261,10 +261,11 @@ public class OpenDCRunner(
val phenomena = scenario.phenomena
val failureModel =
- if (phenomena.failures)
+ if (phenomena.failures) {
grid5000(Duration.ofDays(7))
- else
+ } else {
null
+ }
// Run workload trace
service.replay(clock, vms, seed, failureModel = failureModel, interference = phenomena.interference)
diff --git a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/internal/WebComputeMonitor.kt b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/internal/WebComputeMonitor.kt
index 76377c08..4db70d3d 100644
--- a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/internal/WebComputeMonitor.kt
+++ b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/internal/WebComputeMonitor.kt
@@ -66,7 +66,7 @@ internal class WebComputeMonitor : ComputeMonitor {
val totalLostTime: Long = 0L,
val totalPowerDraw: Double = 0.0,
val totalFailureSlices: Double = 0.0,
- val totalFailureVmSlices: Double = 0.0,
+ val totalFailureVmSlices: Double = 0.0
)
private data class HostMetrics(
@@ -84,7 +84,7 @@ internal class WebComputeMonitor : ComputeMonitor {
max(reader.serversPending, serviceMetrics.vmWaitingCount),
max(reader.serversActive, serviceMetrics.vmActiveCount),
max(0, serviceMetrics.vmInactiveCount),
- max(reader.attemptsFailure, serviceMetrics.vmFailedCount),
+ max(reader.attemptsFailure, serviceMetrics.vmFailedCount)
)
}
@@ -115,7 +115,7 @@ internal class WebComputeMonitor : ComputeMonitor {
serviceMetrics.vmTotalCount,
serviceMetrics.vmWaitingCount,
serviceMetrics.vmInactiveCount,
- serviceMetrics.vmFailedCount,
+ serviceMetrics.vmFailedCount
)
}
diff --git a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Portfolio.kt b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Portfolio.kt
index 5b686d5f..09437712 100644
--- a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Portfolio.kt
+++ b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Portfolio.kt
@@ -87,7 +87,7 @@ class Portfolio(
*/
@Type(type = "json")
@Column(columnDefinition = "jsonb", nullable = false, updatable = false)
- val targets: Targets,
+ val targets: Targets
) {
/**
* The scenarios in this portfolio.
diff --git a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Project.kt b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Project.kt
index 5eb925ea..41d1a786 100644
--- a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Project.kt
+++ b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Project.kt
@@ -85,7 +85,7 @@ class Project(
var name: String,
@Column(name = "created_at", nullable = false, updatable = false)
- val createdAt: Instant,
+ val createdAt: Instant
) {
/**
* The instant at which the project was updated.
diff --git a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Scenario.kt b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Scenario.kt
index a7258e7b..62adc9e2 100644
--- a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Scenario.kt
+++ b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Scenario.kt
@@ -106,7 +106,7 @@ class Scenario(
val phenomena: OperationalPhenomena,
@Column(name = "scheduler_name", nullable = false, updatable = false)
- val schedulerName: String,
+ val schedulerName: String
) {
/**
* The [Job] associated with the scenario.
diff --git a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Trace.kt b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Trace.kt
index 0fc79ca8..14a88c5a 100644
--- a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Trace.kt
+++ b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/model/Trace.kt
@@ -43,7 +43,7 @@ import javax.persistence.Table
NamedQuery(
name = "Trace.findAll",
query = "SELECT t FROM Trace t"
- ),
+ )
]
)
class Trace(
@@ -54,7 +54,7 @@ class Trace(
val name: String,
@Column(nullable = false, updatable = false)
- val type: String,
+ val type: String
) {
/**
* Return a string representation of this trace.
diff --git a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/rest/user/PortfolioResource.kt b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/rest/user/PortfolioResource.kt
index da565fe4..ebe57ae2 100644
--- a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/rest/user/PortfolioResource.kt
+++ b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/rest/user/PortfolioResource.kt
@@ -43,7 +43,7 @@ import javax.ws.rs.WebApplicationException
@RolesAllowed("openid")
class PortfolioResource @Inject constructor(
private val portfolioService: PortfolioService,
- private val identity: SecurityIdentity,
+ private val identity: SecurityIdentity
) {
/**
* Get all portfolios that belong to the specified project.
diff --git a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/rest/user/PortfolioScenarioResource.kt b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/rest/user/PortfolioScenarioResource.kt
index 515f6be6..82f35127 100644
--- a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/rest/user/PortfolioScenarioResource.kt
+++ b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/rest/user/PortfolioScenarioResource.kt
@@ -42,7 +42,7 @@ import javax.ws.rs.WebApplicationException
@RolesAllowed("openid")
class PortfolioScenarioResource @Inject constructor(
private val scenarioService: ScenarioService,
- private val identity: SecurityIdentity,
+ private val identity: SecurityIdentity
) {
/**
* Get all scenarios that belong to the specified portfolio.
diff --git a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/service/ScenarioService.kt b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/service/ScenarioService.kt
index 1929f44b..fad4e56f 100644
--- a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/service/ScenarioService.kt
+++ b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/service/ScenarioService.kt
@@ -44,7 +44,7 @@ class ScenarioService @Inject constructor(
private val portfolioRepository: PortfolioRepository,
private val topologyRepository: TopologyRepository,
private val traceRepository: TraceRepository,
- private val scenarioRepository: ScenarioRepository,
+ private val scenarioRepository: ScenarioRepository
) {
/**
* List all [Scenario]s that belong a certain portfolio.
diff --git a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonBinarySqlTypeDescriptor.kt b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonBinarySqlTypeDescriptor.kt
index 45752d4e..df6a3013 100644
--- a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonBinarySqlTypeDescriptor.kt
+++ b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonBinarySqlTypeDescriptor.kt
@@ -1,3 +1,25 @@
+/*
+ * Copyright (c) 2022 AtLarge Research
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
package org.opendc.web.server.util.hibernate.json
import com.fasterxml.jackson.databind.JsonNode
diff --git a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonBytesSqlTypeDescriptor.kt b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonBytesSqlTypeDescriptor.kt
index cc8dad48..4924f586 100644
--- a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonBytesSqlTypeDescriptor.kt
+++ b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonBytesSqlTypeDescriptor.kt
@@ -77,10 +77,12 @@ internal object JsonBytesSqlTypeDescriptor : AbstractJsonSqlTypeDescriptor() {
private fun fromJsonBytes(jsonBytes: ByteArray?): String? {
return if (jsonBytes == null) {
null
- } else try {
- String(jsonBytes, CHARSET)
- } catch (e: UnsupportedEncodingException) {
- throw IllegalStateException(e)
+ } else {
+ try {
+ String(jsonBytes, CHARSET)
+ } catch (e: UnsupportedEncodingException) {
+ throw IllegalStateException(e)
+ }
}
}
}
diff --git a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonStringSqlTypeDescriptor.kt b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonStringSqlTypeDescriptor.kt
index 63f32849..6e015762 100644
--- a/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonStringSqlTypeDescriptor.kt
+++ b/opendc-web/opendc-web-server/src/main/kotlin/org/opendc/web/server/util/hibernate/json/JsonStringSqlTypeDescriptor.kt
@@ -1,3 +1,25 @@
+/*
+ * Copyright (c) 2022 AtLarge Research
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
package org.opendc.web.server.util.hibernate.json
import org.hibernate.type.descriptor.ValueBinder
diff --git a/opendc-web/opendc-web-server/src/test/kotlin/org/opendc/web/server/rest/runner/JobResourceTest.kt b/opendc-web/opendc-web-server/src/test/kotlin/org/opendc/web/server/rest/runner/JobResourceTest.kt
index 71aaa8a4..9aca58e9 100644
--- a/opendc-web/opendc-web-server/src/test/kotlin/org/opendc/web/server/rest/runner/JobResourceTest.kt
+++ b/opendc-web/opendc-web-server/src/test/kotlin/org/opendc/web/server/rest/runner/JobResourceTest.kt
@@ -62,7 +62,7 @@ class JobResourceTest {
private val dummyPortfolio = Portfolio(1, 1, "test", Targets(emptySet()))
private val dummyTopology = Topology(1, 1, "test", emptyList(), Instant.now(), Instant.now())
private val dummyTrace = Trace("bitbrains", "Bitbrains", "vm")
- private val dummyScenario = Scenario(1, 1, dummyPortfolio, "test", Workload(dummyTrace, 1.0), dummyTopology, OperationalPhenomena(false, false), "test",)
+ private val dummyScenario = Scenario(1, 1, dummyPortfolio, "test", Workload(dummyTrace, 1.0), dummyTopology, OperationalPhenomena(false, false), "test")
private val dummyJob = Job(1, dummyScenario, JobState.PENDING, Instant.now(), Instant.now())
@BeforeEach
diff --git a/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/AuthConfiguration.java b/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/AuthConfiguration.java
index 2e4d9198..82e02549 100644
--- a/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/AuthConfiguration.java
+++ b/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/AuthConfiguration.java
@@ -24,7 +24,6 @@ package org.opendc.web.ui.deployment;
import io.quarkus.runtime.annotations.ConfigGroup;
import io.quarkus.runtime.annotations.ConfigItem;
-
import java.util.Optional;
/**
diff --git a/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiConfig.java b/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiConfig.java
index 50c1fbe3..d630dbac 100644
--- a/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiConfig.java
+++ b/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiConfig.java
@@ -24,7 +24,6 @@ package org.opendc.web.ui.deployment;
import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigRoot;
-
import java.util.Optional;
/**
diff --git a/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiProcessor.java b/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiProcessor.java
index 54782ace..093a9bfa 100644
--- a/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiProcessor.java
+++ b/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiProcessor.java
@@ -41,9 +41,6 @@ import io.quarkus.vertx.http.deployment.webjar.WebJarResourcesFilter;
import io.quarkus.vertx.http.deployment.webjar.WebJarResultsBuildItem;
import io.vertx.core.Handler;
import io.vertx.ext.web.RoutingContext;
-import org.opendc.web.ui.runtime.OpenDCUiRecorder;
-import org.opendc.web.ui.runtime.OpenDCUiRuntimeConfig;
-
import java.io.*;
import java.util.ArrayList;
import java.util.Iterator;
@@ -51,6 +48,8 @@ import java.util.function.BooleanSupplier;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.opendc.web.ui.runtime.OpenDCUiRecorder;
+import org.opendc.web.ui.runtime.OpenDCUiRuntimeConfig;
/**
* Build processor for the OpenDC web UI Quarkus extension.
@@ -76,25 +75,25 @@ public class OpenDCUiProcessor {
* Build the WebJar that is used to serve the Next.js resources.
*/
@BuildStep(onlyIf = IsIncluded.class)
- public WebJarBuildItem buildWebJar(OpenDCUiConfig config,
- HttpRootPathBuildItem httpRootPathBuildItem) {
+ public WebJarBuildItem buildWebJar(OpenDCUiConfig config, HttpRootPathBuildItem httpRootPathBuildItem) {
return WebJarBuildItem.builder()
- .artifactKey(OPENDC_UI_WEBJAR_ARTIFACT_KEY)
- .root(OPENDC_UI_WEBJAR_STATIC_RESOURCES_PATH)
- .onlyCopyNonArtifactFiles(false)
- .useDefaultQuarkusBranding(false)
- .filter(new InsertVariablesResourcesFilter(config, httpRootPathBuildItem))
- .build();
+ .artifactKey(OPENDC_UI_WEBJAR_ARTIFACT_KEY)
+ .root(OPENDC_UI_WEBJAR_STATIC_RESOURCES_PATH)
+ .onlyCopyNonArtifactFiles(false)
+ .useDefaultQuarkusBranding(false)
+ .filter(new InsertVariablesResourcesFilter(config, httpRootPathBuildItem))
+ .build();
}
-
/**
* Build the Next.js routes based on the route manifest generated by it.
*/
@BuildStep(onlyIf = IsIncluded.class)
- public OpenDCUiRoutingBuildItem buildRoutes(CurateOutcomeBuildItem curateOutcomeBuildItem) throws IOException {
+ public OpenDCUiRoutingBuildItem buildRoutes(CurateOutcomeBuildItem curateOutcomeBuildItem) throws IOException {
ResolvedDependency dependency = getAppArtifact(curateOutcomeBuildItem, OPENDC_UI_WEBJAR_ARTIFACT_KEY);
- PathVisit visit = dependency.getContentTree().apply(OPENDC_UI_WEBJAR_STATIC_RESOURCES_PATH + "/routes-manifest.json", v -> v);
+ PathVisit visit = dependency
+ .getContentTree()
+ .apply(OPENDC_UI_WEBJAR_STATIC_RESOURCES_PATH + "/routes-manifest.json", v -> v);
if (visit == null) {
throw new FileNotFoundException("Cannot find routes-manifest.json");
@@ -103,7 +102,7 @@ public class OpenDCUiProcessor {
JsonNode routeManifest = objectMapper.readTree(visit.getUrl());
var pages = new ArrayList<OpenDCUiRoutingBuildItem.Page>();
- for (Iterator<JsonNode> it = routeManifest.get("staticRoutes").elements(); it.hasNext();) {
+ for (Iterator<JsonNode> it = routeManifest.get("staticRoutes").elements(); it.hasNext(); ) {
JsonNode route = it.next();
String page = route.get("page").asText();
@@ -112,7 +111,7 @@ public class OpenDCUiProcessor {
pages.add(new OpenDCUiRoutingBuildItem.Page(page, page));
}
- for (Iterator<JsonNode> it = routeManifest.get("dynamicRoutes").elements(); it.hasNext();) {
+ for (Iterator<JsonNode> it = routeManifest.get("dynamicRoutes").elements(); it.hasNext(); ) {
JsonNode route = it.next();
String page = route.get("page").asText();
@@ -122,7 +121,7 @@ public class OpenDCUiProcessor {
}
var redirects = new ArrayList<OpenDCUiRoutingBuildItem.Redirect>();
- for (Iterator<JsonNode> it = routeManifest.get("redirects").elements(); it.hasNext();) {
+ for (Iterator<JsonNode> it = routeManifest.get("redirects").elements(); it.hasNext(); ) {
JsonNode redirect = it.next();
if (redirect.has("internal")) {
continue;
@@ -148,16 +147,18 @@ public class OpenDCUiProcessor {
*/
@BuildStep(onlyIf = IsIncluded.class)
@Record(ExecutionTime.RUNTIME_INIT)
- public void registerOpenDCUiHandler(OpenDCUiRecorder recorder,
- BuildProducer<RouteBuildItem> routes,
- HttpRootPathBuildItem httpRootPathBuildItem,
- WebJarResultsBuildItem webJarResultsBuildItem,
- OpenDCUiRoutingBuildItem openDCUiBuildItem,
- OpenDCUiRuntimeConfig runtimeConfig,
- OpenDCUiConfig buildConfig,
- ShutdownContextBuildItem shutdownContext) {
-
- WebJarResultsBuildItem.WebJarResult result = webJarResultsBuildItem.byArtifactKey(OPENDC_UI_WEBJAR_ARTIFACT_KEY);
+ public void registerOpenDCUiHandler(
+ OpenDCUiRecorder recorder,
+ BuildProducer<RouteBuildItem> routes,
+ HttpRootPathBuildItem httpRootPathBuildItem,
+ WebJarResultsBuildItem webJarResultsBuildItem,
+ OpenDCUiRoutingBuildItem openDCUiBuildItem,
+ OpenDCUiRuntimeConfig runtimeConfig,
+ OpenDCUiConfig buildConfig,
+ ShutdownContextBuildItem shutdownContext) {
+
+ WebJarResultsBuildItem.WebJarResult result =
+ webJarResultsBuildItem.byArtifactKey(OPENDC_UI_WEBJAR_ARTIFACT_KEY);
if (result == null) {
return;
}
@@ -167,41 +168,41 @@ public class OpenDCUiProcessor {
/* Construct dynamic routes */
for (var redirect : openDCUiBuildItem.getRedirects()) {
- String destination = basePath.equals("/") ? redirect.getDestination() : basePath + redirect.getDestination();
-
- routes.produce(httpRootPathBuildItem.routeBuilder()
- .route(basePath + redirect.getPath())
- .handler(recorder.redirectHandler(destination, redirect.getStatusCode(), runtimeConfig))
- .build());
+ String destination =
+ basePath.equals("/") ? redirect.getDestination() : basePath + redirect.getDestination();
+
+ routes.produce(httpRootPathBuildItem
+ .routeBuilder()
+ .route(basePath + redirect.getPath())
+ .handler(recorder.redirectHandler(destination, redirect.getStatusCode(), runtimeConfig))
+ .build());
}
for (var page : openDCUiBuildItem.getPages()) {
- routes.produce(httpRootPathBuildItem.routeBuilder()
- .route(basePath + page.getPath())
- .handler(recorder.pageHandler(finalDestination, page.getName(), runtimeConfig))
- .build());
+ routes.produce(httpRootPathBuildItem
+ .routeBuilder()
+ .route(basePath + page.getPath())
+ .handler(recorder.pageHandler(finalDestination, page.getName(), runtimeConfig))
+ .build());
}
/* Construct static routes */
Handler<RoutingContext> staticHandler = recorder.staticHandler(
- finalDestination,
- basePath,
- result.getWebRootConfigurations(),
- runtimeConfig,
- shutdownContext
- );
-
- routes.produce(httpRootPathBuildItem.routeBuilder()
- .route(buildConfig.path)
- .displayOnNotFoundPage("OpenDC UI")
- .routeConfigKey("quarkus.opendc-ui.path")
- .handler(staticHandler)
- .build());
-
- routes.produce(httpRootPathBuildItem.routeBuilder()
- .route(buildConfig.path + "*")
- .handler(staticHandler)
- .build());
+ finalDestination, basePath, result.getWebRootConfigurations(), runtimeConfig, shutdownContext);
+
+ routes.produce(httpRootPathBuildItem
+ .routeBuilder()
+ .route(buildConfig.path)
+ .displayOnNotFoundPage("OpenDC UI")
+ .routeConfigKey("quarkus.opendc-ui.path")
+ .handler(staticHandler)
+ .build());
+
+ routes.produce(httpRootPathBuildItem
+ .routeBuilder()
+ .route(buildConfig.path + "*")
+ .handler(staticHandler)
+ .build());
}
/**
@@ -216,7 +217,6 @@ public class OpenDCUiProcessor {
private final OpenDCUiConfig config;
private final HttpRootPathBuildItem httpRootPathBuildItem;
-
public InsertVariablesResourcesFilter(OpenDCUiConfig config, HttpRootPathBuildItem httpRootPathBuildItem) {
this.config = config;
this.httpRootPathBuildItem = httpRootPathBuildItem;
@@ -304,7 +304,8 @@ public class OpenDCUiProcessor {
}
private static ResolvedDependency getAppArtifact(CurateOutcomeBuildItem curateOutcomeBuildItem, GACT artifactKey) {
- for (ResolvedDependency dep : curateOutcomeBuildItem.getApplicationModel().getDependencies()) {
+ for (ResolvedDependency dep :
+ curateOutcomeBuildItem.getApplicationModel().getDependencies()) {
if (dep.getKey().equals(artifactKey)) {
return dep;
}
diff --git a/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiRoutingBuildItem.java b/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiRoutingBuildItem.java
index 7e0f9408..6cf44893 100644
--- a/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiRoutingBuildItem.java
+++ b/opendc-web/opendc-web-ui-quarkus-deployment/src/main/java/org/opendc/web/ui/deployment/OpenDCUiRoutingBuildItem.java
@@ -23,7 +23,6 @@
package org.opendc.web.ui.deployment;
import io.quarkus.builder.item.SimpleBuildItem;
-
import java.util.List;
/**
@@ -57,7 +56,7 @@ public final class OpenDCUiRoutingBuildItem extends SimpleBuildItem {
}
public boolean hasCustom404() {
- return this.custom404;
+ return this.custom404;
}
/**
diff --git a/opendc-web/opendc-web-ui-quarkus/src/main/java/org/opendc/web/ui/runtime/OpenDCUiRecorder.java b/opendc-web/opendc-web-ui-quarkus/src/main/java/org/opendc/web/ui/runtime/OpenDCUiRecorder.java
index 026a9039..03fedd4f 100644
--- a/opendc-web/opendc-web-ui-quarkus/src/main/java/org/opendc/web/ui/runtime/OpenDCUiRecorder.java
+++ b/opendc-web/opendc-web-ui-quarkus/src/main/java/org/opendc/web/ui/runtime/OpenDCUiRecorder.java
@@ -29,7 +29,6 @@ import io.quarkus.vertx.http.runtime.webjar.WebJarNotFoundHandler;
import io.quarkus.vertx.http.runtime.webjar.WebJarStaticHandler;
import io.vertx.core.Handler;
import io.vertx.ext.web.RoutingContext;
-
import java.util.List;
import java.util.stream.Collectors;
@@ -42,16 +41,11 @@ public class OpenDCUiRecorder {
* Construct a {@link Handler} for serving a page of the OpenDC web interface.
*/
public Handler<RoutingContext> pageHandler(
- String finalDestination,
- String page,
- OpenDCUiRuntimeConfig runtimeConfig
- ) {
+ String finalDestination, String page, OpenDCUiRuntimeConfig runtimeConfig) {
if (runtimeConfig.enable) {
String pageDirectory = finalDestination + "/pages";
return (event) -> {
- event.response()
- .setStatusCode(200)
- .sendFile(pageDirectory + page + ".html");
+ event.response().setStatusCode(200).sendFile(pageDirectory + page + ".html");
};
}
@@ -62,19 +56,16 @@ public class OpenDCUiRecorder {
* Construct a {@link Handler} for handling redirects in the OpenDC web interface.
*/
public Handler<RoutingContext> redirectHandler(
- String destination,
- int statusCode,
- OpenDCUiRuntimeConfig runtimeConfig
- ) {
+ String destination, int statusCode, OpenDCUiRuntimeConfig runtimeConfig) {
if (runtimeConfig.enable) {
return (event) -> {
String query = event.request().query();
String fullDestination = query != null ? destination + "?" + query : destination;
event.response()
- .setStatusCode(statusCode)
- .putHeader("Location", fullDestination)
- .end();
+ .setStatusCode(statusCode)
+ .putHeader("Location", fullDestination)
+ .end();
};
}
@@ -85,19 +76,19 @@ public class OpenDCUiRecorder {
* Construct a {@link Handler} for serving the static files of the OpenDC web interface.
*/
public Handler<RoutingContext> staticHandler(
- String finalDestination,
- String path,
- List<FileSystemStaticHandler.StaticWebRootConfiguration> webRootConfigurations,
- OpenDCUiRuntimeConfig runtimeConfig,
- ShutdownContext shutdownContext
- ) {
+ String finalDestination,
+ String path,
+ List<FileSystemStaticHandler.StaticWebRootConfiguration> webRootConfigurations,
+ OpenDCUiRuntimeConfig runtimeConfig,
+ ShutdownContext shutdownContext) {
if (runtimeConfig.enable) {
- var augmentedWebRootConfigurations = webRootConfigurations
- .stream()
- .map(c -> new FileSystemStaticHandler.StaticWebRootConfiguration(c.getFileSystem(), c.getWebRoot().isEmpty() ? "static" : c.getWebRoot() + "/static"))
- .collect(Collectors.toList());
+ var augmentedWebRootConfigurations = webRootConfigurations.stream()
+ .map(c -> new FileSystemStaticHandler.StaticWebRootConfiguration(
+ c.getFileSystem(), c.getWebRoot().isEmpty() ? "static" : c.getWebRoot() + "/static"))
+ .collect(Collectors.toList());
- WebJarStaticHandler handler = new WebJarStaticHandler(finalDestination + "/static", path, augmentedWebRootConfigurations);
+ WebJarStaticHandler handler =
+ new WebJarStaticHandler(finalDestination + "/static", path, augmentedWebRootConfigurations);
shutdownContext.addShutdownTask(new ShutdownContext.CloseRunnable(handler));
return handler;
}
diff --git a/opendc-web/opendc-web-ui/build.gradle.kts b/opendc-web/opendc-web-ui/build.gradle.kts
index f8c0a45b..5e999359 100644
--- a/opendc-web/opendc-web-ui/build.gradle.kts
+++ b/opendc-web/opendc-web-ui/build.gradle.kts
@@ -76,10 +76,10 @@ val buildTask = tasks.register<NpmTask>("buildNext") {
"NEXT_PUBLIC_SENTRY_DSN",
"NEXT_PUBLIC_AUTH0_DOMAIN",
"NEXT_PUBLIC_AUTH0_CLIENT_ID",
- "NEXT_PUBLIC_AUTH0_AUDIENCE",
+ "NEXT_PUBLIC_AUTH0_AUDIENCE"
)
for (envvar in env) {
- environment.put(envvar, "%%${envvar}%%")
+ environment.put(envvar, "%%$envvar%%")
}
dependsOn(tasks.npmInstall)
diff --git a/opendc-workflow/opendc-workflow-api/src/main/kotlin/org/opendc/workflow/api/Metadata.kt b/opendc-workflow/opendc-workflow-api/src/main/kotlin/org/opendc/workflow/api/Metadata.kt
index db208998..a4e48b85 100644
--- a/opendc-workflow/opendc-workflow-api/src/main/kotlin/org/opendc/workflow/api/Metadata.kt
+++ b/opendc-workflow/opendc-workflow-api/src/main/kotlin/org/opendc/workflow/api/Metadata.kt
@@ -1,7 +1,5 @@
/*
- * MIT License
- *
- * Copyright (c) 2020 atlarge-research
+ * Copyright (c) 2020 AtLarge Research
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/job/LimitJobAdmissionPolicy.kt b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/job/LimitJobAdmissionPolicy.kt
index 6a0bfeb9..bd416546 100644
--- a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/job/LimitJobAdmissionPolicy.kt
+++ b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/job/LimitJobAdmissionPolicy.kt
@@ -35,10 +35,11 @@ public data class LimitJobAdmissionPolicy(public val limit: Int) : JobAdmissionP
override fun invoke(
job: JobState
): JobAdmissionPolicy.Advice =
- if (scheduler.activeJobs.size < limit)
+ if (scheduler.activeJobs.size < limit) {
JobAdmissionPolicy.Advice.ADMIT
- else
+ } else {
JobAdmissionPolicy.Advice.STOP
+ }
}
override fun toString(): String = "Limit-Active($limit)"
diff --git a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/BalancingTaskEligibilityPolicy.kt b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/BalancingTaskEligibilityPolicy.kt
index 42804f5a..a2c11e4d 100644
--- a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/BalancingTaskEligibilityPolicy.kt
+++ b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/BalancingTaskEligibilityPolicy.kt
@@ -65,10 +65,11 @@ public data class BalancingTaskEligibilityPolicy(public val tolerance: Double =
val activeTasks = scheduler.activeTasks.size
val baseline = max(activeTasks / activeJobs.toDouble(), 1.0)
val activeForJob = active[task.job]!!
- return if ((activeForJob + 1) / baseline < tolerance)
+ return if ((activeForJob + 1) / baseline < tolerance) {
TaskEligibilityPolicy.Advice.ADMIT
- else
+ } else {
TaskEligibilityPolicy.Advice.DENY
+ }
}
}
diff --git a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/LimitPerJobTaskEligibilityPolicy.kt b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/LimitPerJobTaskEligibilityPolicy.kt
index 229460df..b0eb3f2c 100644
--- a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/LimitPerJobTaskEligibilityPolicy.kt
+++ b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/LimitPerJobTaskEligibilityPolicy.kt
@@ -57,10 +57,11 @@ public data class LimitPerJobTaskEligibilityPolicy(public val limit: Int) : Task
override fun invoke(task: TaskState): TaskEligibilityPolicy.Advice {
val activeForJob = active[task.job]!!
- return if (activeForJob <= limit)
+ return if (activeForJob <= limit) {
TaskEligibilityPolicy.Advice.ADMIT
- else
+ } else {
TaskEligibilityPolicy.Advice.DENY
+ }
}
}
diff --git a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/LimitTaskEligibilityPolicy.kt b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/LimitTaskEligibilityPolicy.kt
index 57aa0d58..d2edc256 100644
--- a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/LimitTaskEligibilityPolicy.kt
+++ b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/scheduler/task/LimitTaskEligibilityPolicy.kt
@@ -33,10 +33,11 @@ public data class LimitTaskEligibilityPolicy(val limit: Int) : TaskEligibilityPo
override fun invoke(
task: TaskState
): TaskEligibilityPolicy.Advice =
- if (scheduler.activeTasks.size < limit)
+ if (scheduler.activeTasks.size < limit) {
TaskEligibilityPolicy.Advice.ADMIT
- else
+ } else {
TaskEligibilityPolicy.Advice.STOP
+ }
}
override fun toString(): String = "Limit-Active($limit)"
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 e675d836..036f3574 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
@@ -34,9 +34,9 @@ public data class RandomTaskEligibilityPolicy(val probability: Double = 0.5) : T
val random = Random(123)
override fun invoke(task: TaskState): TaskEligibilityPolicy.Advice =
- if (random.nextDouble() <= probability || scheduler.activeTasks.isEmpty())
+ if (random.nextDouble() <= probability || scheduler.activeTasks.isEmpty()) {
TaskEligibilityPolicy.Advice.ADMIT
- else {
+ } else {
TaskEligibilityPolicy.Advice.DENY
}
}
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 096a7ebd..977f5677 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
@@ -93,7 +93,7 @@ internal class WorkflowServiceTest {
jobAdmissionPolicy = NullJobAdmissionPolicy,
jobOrderPolicy = SubmissionTimeJobOrderPolicy(),
taskEligibilityPolicy = NullTaskEligibilityPolicy,
- taskOrderPolicy = SubmissionTimeTaskOrderPolicy(),
+ taskOrderPolicy = SubmissionTimeTaskOrderPolicy()
)
)
)