diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-10-06 15:34:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-06 15:34:19 +0200 |
| commit | 7ba3b953300c46b4e3afcde17cd3dd14b1af8406 (patch) | |
| tree | 950ba678869ec868c26ab3b95b57e4cabadb23c7 /opendc-compute/opendc-compute-service/src/main | |
| parent | c2047d09b27b0c05f5c203509dde524e17d3b729 (diff) | |
| parent | 47357afd16f928260db34d4dd3e686fb9ee7c5ff (diff) | |
merge: Update build and runtime dependencies (#107)
This pull request updates the build and runtime dependencies used by OpenDC to their latest
version compatible with the project.
## Implementation Notes :hammer_and_pick:
* Update simulator dependency versions
* Remove unused distribution conventions
* Update next version to 3.0
* Eliminate use of wildcard imports
* Switch to Spotless for formatting
Diffstat (limited to 'opendc-compute/opendc-compute-service/src/main')
14 files changed, 29 insertions, 16 deletions
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/Host.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/Host.kt index 67b144d9..fad8757e 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/Host.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/driver/Host.kt @@ -27,7 +27,7 @@ import org.opendc.compute.service.driver.telemetry.GuestCpuStats import org.opendc.compute.service.driver.telemetry.GuestSystemStats import org.opendc.compute.service.driver.telemetry.HostCpuStats import org.opendc.compute.service.driver.telemetry.HostSystemStats -import java.util.* +import java.util.UUID /** * Base interface for representing compute resources that host virtualized [Server] instances. 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/internal/ClientImage.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ClientImage.kt index e0b5c171..f0032acf 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ClientImage.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ClientImage.kt @@ -23,7 +23,7 @@ package org.opendc.compute.service.internal import org.opendc.compute.api.Image -import java.util.* +import java.util.UUID /** * An [Image] implementation that is passed to clients but delegates its implementation to another class. diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ClientServer.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ClientServer.kt index 45775640..6cd7d30f 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ClientServer.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ClientServer.kt @@ -28,7 +28,7 @@ import org.opendc.compute.api.Server import org.opendc.compute.api.ServerState import org.opendc.compute.api.ServerWatcher import java.time.Instant -import java.util.* +import java.util.UUID /** * A [Server] implementation that is passed to clients but delegates its implementation to another class. diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ComputeServiceImpl.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ComputeServiceImpl.kt index 519cf6c6..caa95e09 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ComputeServiceImpl.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ComputeServiceImpl.kt @@ -22,10 +22,18 @@ package org.opendc.compute.service.internal -import kotlinx.coroutines.* +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Job +import kotlinx.coroutines.cancel +import kotlinx.coroutines.isActive +import kotlinx.coroutines.launch import mu.KotlinLogging import org.opendc.common.util.Pacer -import org.opendc.compute.api.* +import org.opendc.compute.api.ComputeClient +import org.opendc.compute.api.Flavor +import org.opendc.compute.api.Image +import org.opendc.compute.api.Server +import org.opendc.compute.api.ServerState import org.opendc.compute.service.ComputeService import org.opendc.compute.service.driver.Host import org.opendc.compute.service.driver.HostListener @@ -35,7 +43,10 @@ import org.opendc.compute.service.telemetry.SchedulerStats import java.time.Clock import java.time.Duration import java.time.Instant -import java.util.* +import java.util.ArrayDeque +import java.util.Deque +import java.util.Random +import java.util.UUID import kotlin.coroutines.CoroutineContext import kotlin.math.max diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/InternalFlavor.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/InternalFlavor.kt index b8fb6279..acd87dfc 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/InternalFlavor.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/InternalFlavor.kt @@ -23,7 +23,7 @@ package org.opendc.compute.service.internal import org.opendc.compute.api.Flavor -import java.util.* +import java.util.UUID /** * Internal stateful representation of a [Flavor]. diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/InternalImage.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/InternalImage.kt index d9ed5896..a0a35a55 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/InternalImage.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/InternalImage.kt @@ -23,7 +23,7 @@ package org.opendc.compute.service.internal import org.opendc.compute.api.Image -import java.util.* +import java.util.UUID /** * Internal stateful representation of an [Image]. diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/InternalServer.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/InternalServer.kt index f9da24d8..e3bae405 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/InternalServer.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/InternalServer.kt @@ -23,7 +23,9 @@ package org.opendc.compute.service.internal import mu.KotlinLogging -import org.opendc.compute.api.* +import org.opendc.compute.api.Server +import org.opendc.compute.api.ServerState +import org.opendc.compute.api.ServerWatcher import org.opendc.compute.service.driver.Host import java.time.Instant import java.util.UUID diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/FilterScheduler.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/FilterScheduler.kt index 8c2d4715..233f5ef6 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/FilterScheduler.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/FilterScheduler.kt @@ -26,7 +26,7 @@ import org.opendc.compute.api.Server import org.opendc.compute.service.internal.HostView import org.opendc.compute.service.scheduler.filters.HostFilter import org.opendc.compute.service.scheduler.weights.HostWeigher -import java.util.* +import java.util.Random import kotlin.math.min /** diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/filters/DifferentHostFilter.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/filters/DifferentHostFilter.kt index 54f2f303..f6736ac0 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/filters/DifferentHostFilter.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/filters/DifferentHostFilter.kt @@ -24,7 +24,7 @@ package org.opendc.compute.service.scheduler.filters import org.opendc.compute.api.Server import org.opendc.compute.service.internal.HostView -import java.util.* +import java.util.UUID /** * A [HostFilter] that ensures an instance is scheduled on a different host from a set of instances. diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/filters/SameHostFilter.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/filters/SameHostFilter.kt index febb085d..090e1437 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/filters/SameHostFilter.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/scheduler/filters/SameHostFilter.kt @@ -24,7 +24,7 @@ package org.opendc.compute.service.scheduler.filters import org.opendc.compute.api.Server import org.opendc.compute.service.internal.HostView -import java.util.* +import java.util.UUID /** * A [HostFilter] that ensures an instance is scheduled on the same host as all other instances in a set of instances. 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 ) } |
