summaryrefslogtreecommitdiff
path: root/simulator/opendc-compute
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2020-10-01 23:06:32 +0200
committerGitHub <noreply@github.com>2020-10-01 23:06:32 +0200
commit0119ca3b2e05b06f9646149c2d7bfe3d4b57c380 (patch)
tree3ce364af1efbadca9f33bca5d3abbace5af44b49 /simulator/opendc-compute
parentdff259fa1a721df3bc2601014d5749f6e620854c (diff)
parenteedf207bf4c9b723db685e6b7a9191bef9745486 (diff)
Merge pull request #44 from atlarge-research/feat/api-visibility
Add explicit API visibility
Diffstat (limited to 'simulator/opendc-compute')
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/ProcessingNode.kt10
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/execution/ServerContext.kt6
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/EmptyImage.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/FlopsApplicationImage.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/FlopsHistoryFragment.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/VmImage.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/workload/PerformanceInterferenceModel.kt22
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/workload/VmWorkload.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/Metadata.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/driver/BareMetalDriver.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/driver/SimpleBareMetalDriver.kt4
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/service/ProvisioningService.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/HypervisorImage.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/driver/SimpleVirtDriver.kt4
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/driver/VirtDriver.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/HypervisorView.kt14
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/SimpleVirtProvisioningService.kt24
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/VirtProvisioningEvent.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/VirtProvisioningService.kt4
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AllocationPolicy.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AvailableCoreMemoryAllocationPolicy.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AvailableMemoryAllocationPolicy.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ComparableAllocationPolicyLogic.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/NumberOfActiveServersAllocationPolicy.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ProvisionedCoresAllocationPolicy.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/RandomAllocationPolicy.kt2
-rw-r--r--simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt2
27 files changed, 63 insertions, 63 deletions
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/ProcessingNode.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/ProcessingNode.kt
index 23c82816..7e4694d4 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/ProcessingNode.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/ProcessingNode.kt
@@ -32,9 +32,9 @@ package org.opendc.compute.core
* @property arch The micro-architecture of the processor node.
* @property coreCount The number of logical CPUs in the processor node.
*/
-data class ProcessingNode(
- val vendor: String,
- val arch: String,
- val modelName: String,
- val coreCount: Int
+public data class ProcessingNode(
+ public val vendor: String,
+ public val arch: String,
+ public val modelName: String,
+ public val coreCount: Int
)
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/execution/ServerContext.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/execution/ServerContext.kt
index 3cab94c0..9674c98d 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/execution/ServerContext.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/execution/ServerContext.kt
@@ -65,7 +65,7 @@ public interface ServerContext {
* @param slice The representation of work to run on the processors.
* @param triggerMode The trigger condition to resume execution.
*/
- public suspend fun run(slice: Slice, triggerMode: TriggerMode = TriggerMode.FIRST) =
+ public suspend fun run(slice: Slice, triggerMode: TriggerMode = TriggerMode.FIRST): Unit =
select<Unit> { onRun(slice, triggerMode).invoke {} }
/**
@@ -88,7 +88,7 @@ public interface ServerContext {
batch: Sequence<Slice>,
triggerMode: TriggerMode = TriggerMode.FIRST,
merge: (Slice, Slice) -> Slice = { _, r -> r }
- ) = select<Unit> { onRun(batch, triggerMode, merge).invoke {} }
+ ): Unit = select<Unit> { onRun(batch, triggerMode, merge).invoke {} }
/**
* Ask the processor cores to run the specified [slice] and select when the trigger condition is met as specified
@@ -137,7 +137,7 @@ public interface ServerContext {
* @param limit The maximum usage in terms of MHz that the processing core may use while running the burst.
* @param deadline The instant at which this slice needs to be fulfilled.
*/
- public class Slice(val burst: LongArray, val limit: DoubleArray, val deadline: Long) {
+ public class Slice(public val burst: LongArray, public val limit: DoubleArray, public val deadline: Long) {
init {
require(burst.size == limit.size) { "Incompatible array dimensions" }
}
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/EmptyImage.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/EmptyImage.kt
index 1f760978..2b9158bf 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/EmptyImage.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/EmptyImage.kt
@@ -29,7 +29,7 @@ import java.util.UUID
/**
* An empty boot disk [Image] that exits immediately on start.
*/
-object EmptyImage : Image {
+public object EmptyImage : Image {
override val uid: UUID = UUID.randomUUID()
override val name: String = "empty"
override val tags: TagContainer = emptyMap()
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/FlopsApplicationImage.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/FlopsApplicationImage.kt
index 9a95520e..58c00e13 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/FlopsApplicationImage.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/FlopsApplicationImage.kt
@@ -38,7 +38,7 @@ import kotlin.math.min
* @property cores The number of cores that the image is able to utilize.
* @property utilization A model of the CPU utilization of the application.
*/
-data class FlopsApplicationImage(
+public data class FlopsApplicationImage(
public override val uid: UUID,
public override val name: String,
public override val tags: TagContainer,
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/FlopsHistoryFragment.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/FlopsHistoryFragment.kt
index 7097c818..5472e4e0 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/FlopsHistoryFragment.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/FlopsHistoryFragment.kt
@@ -1,3 +1,3 @@
package org.opendc.compute.core.image
-data class FlopsHistoryFragment(val tick: Long, val flops: Long, val duration: Long, val usage: Double, val cores: Int)
+public data class FlopsHistoryFragment(val tick: Long, val flops: Long, val duration: Long, val usage: Double, val cores: Int)
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/VmImage.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/VmImage.kt
index b6622fa4..72efbe0b 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/VmImage.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/image/VmImage.kt
@@ -27,7 +27,7 @@ import org.opendc.core.resource.TagContainer
import java.util.*
import kotlin.math.min
-class VmImage(
+public class VmImage(
public override val uid: UUID,
public override val name: String,
public override val tags: TagContainer,
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/workload/PerformanceInterferenceModel.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/workload/PerformanceInterferenceModel.kt
index f84366b2..7956c095 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/workload/PerformanceInterferenceModel.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/workload/PerformanceInterferenceModel.kt
@@ -29,26 +29,26 @@ import kotlin.random.Random
/**
* Meta-data key for the [PerformanceInterferenceModel] of an image.
*/
-const val IMAGE_PERF_INTERFERENCE_MODEL = "image:performance-interference"
+public const val IMAGE_PERF_INTERFERENCE_MODEL: String = "image:performance-interference"
/**
* Performance Interference Model describing the variability incurred by different sets of workloads if colocated.
*
* @param items The [PerformanceInterferenceModelItem]s that make up this model.
*/
-class PerformanceInterferenceModel(
- val items: SortedSet<PerformanceInterferenceModelItem>,
- val random: Random = Random(0)
+public class PerformanceInterferenceModel(
+ public val items: SortedSet<PerformanceInterferenceModelItem>,
+ private val random: Random = Random(0)
) {
private var intersectingItems: List<PerformanceInterferenceModelItem> = emptyList()
private val colocatedWorkloads = TreeMap<String, Int>()
- fun vmStarted(server: Server) {
+ internal fun vmStarted(server: Server) {
colocatedWorkloads.merge(server.image.name, 1, Int::plus)
intersectingItems = items.filter { item -> doesMatch(item) }
}
- fun vmStopped(server: Server) {
+ internal fun vmStopped(server: Server) {
colocatedWorkloads.computeIfPresent(server.image.name) { _, v -> (v - 1).takeUnless { it == 0 } }
intersectingItems = items.filter { item -> doesMatch(item) }
}
@@ -68,7 +68,7 @@ class PerformanceInterferenceModel(
return false
}
- fun apply(currentServerLoad: Double): Double {
+ internal fun apply(currentServerLoad: Double): Double {
if (intersectingItems.isEmpty()) {
return 1.0
}
@@ -92,10 +92,10 @@ class PerformanceInterferenceModel(
* @param performanceScore The performance score that should be applied to each workload's performance. 1 means no
* influence, <1 means that performance degrades, and >1 means that performance improves.
*/
-data class PerformanceInterferenceModelItem(
- val workloadNames: SortedSet<String>,
- val minServerLoad: Double,
- val performanceScore: Double
+public data class PerformanceInterferenceModelItem(
+ public val workloadNames: SortedSet<String>,
+ public val minServerLoad: Double,
+ public val performanceScore: Double
) : Comparable<PerformanceInterferenceModelItem> {
override fun equals(other: Any?): Boolean {
if (this === other) return true
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/workload/VmWorkload.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/workload/VmWorkload.kt
index d8edb416..6ab8da2a 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/workload/VmWorkload.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/core/workload/VmWorkload.kt
@@ -35,7 +35,7 @@ import java.util.UUID
* @property owner The owner of the VM.
* @property image The image of the VM.
*/
-data class VmWorkload(
+public data class VmWorkload(
override val uid: UUID,
override val name: String,
override val owner: User,
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/Metadata.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/Metadata.kt
index 389f4ab9..61a992b2 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/Metadata.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/Metadata.kt
@@ -31,4 +31,4 @@ package org.opendc.compute.metal
/**
* The cluster to which the node belongs.
*/
-const val NODE_CLUSTER = "bare-metal:cluster"
+public const val NODE_CLUSTER: String = "bare-metal:cluster"
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/driver/BareMetalDriver.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/driver/BareMetalDriver.kt
index 2d7ba2ed..5d8521ae 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/driver/BareMetalDriver.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/driver/BareMetalDriver.kt
@@ -82,5 +82,5 @@ public interface BareMetalDriver : Powerable, FailureDomain {
/**
* A key that allows access to the [BareMetalDriver] instance from a [Server] that runs on the bare-metal machine.
*/
- companion object Key : AbstractServiceKey<BareMetalDriver>(UUID.randomUUID(), "bare-metal:driver")
+ public companion object Key : AbstractServiceKey<BareMetalDriver>(UUID.randomUUID(), "bare-metal:driver")
}
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/driver/SimpleBareMetalDriver.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/driver/SimpleBareMetalDriver.kt
index 98ba8994..817528f6 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/driver/SimpleBareMetalDriver.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/driver/SimpleBareMetalDriver.kt
@@ -83,8 +83,8 @@ public class SimpleBareMetalDriver(
uid: UUID,
name: String,
metadata: Map<String, Any>,
- val cpus: List<ProcessingUnit>,
- val memoryUnits: List<MemoryUnit>,
+ private val cpus: List<ProcessingUnit>,
+ private val memoryUnits: List<MemoryUnit>,
powerModel: PowerModel<SimpleBareMetalDriver> = ConstantPowerModel(
0.0
)
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/service/ProvisioningService.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/service/ProvisioningService.kt
index 9b056adf..c8b38912 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/service/ProvisioningService.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/metal/service/ProvisioningService.kt
@@ -60,5 +60,5 @@ public interface ProvisioningService {
/**
* The service key of this service.
*/
- companion object Key : AbstractServiceKey<ProvisioningService>(UUID.randomUUID(), "provisioner")
+ public companion object Key : AbstractServiceKey<ProvisioningService>(UUID.randomUUID(), "provisioner")
}
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/HypervisorImage.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/HypervisorImage.kt
index 84d26593..ff88f0dc 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/HypervisorImage.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/HypervisorImage.kt
@@ -34,7 +34,7 @@ import java.util.UUID
/**
* A hypervisor managing the VMs of a node.
*/
-object HypervisorImage : Image {
+public object HypervisorImage : Image {
override val uid: UUID = UUID.randomUUID()
override val name: String = "vmm"
override val tags: TagContainer = emptyMap()
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/driver/SimpleVirtDriver.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/driver/SimpleVirtDriver.kt
index 4d39dc4b..fb3d5f84 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/driver/SimpleVirtDriver.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/driver/SimpleVirtDriver.kt
@@ -60,14 +60,14 @@ private val logger = KotlinLogging.logger {}
* A [VirtDriver] that is backed by a simple hypervisor implementation.
*/
@OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class)
-class SimpleVirtDriver(
+public class SimpleVirtDriver(
private val hostContext: ServerContext,
scope: CoroutineScope
) : VirtDriver, CoroutineScope by scope {
/**
* The [Server] on which this hypervisor runs.
*/
- val server: Server
+ public val server: Server
get() = hostContext.server
/**
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/driver/VirtDriver.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/driver/VirtDriver.kt
index b169a00b..9663f4da 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/driver/VirtDriver.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/driver/VirtDriver.kt
@@ -54,5 +54,5 @@ public interface VirtDriver {
flavor: Flavor
): Server
- companion object Key : AbstractServiceKey<VirtDriver>(UUID.randomUUID(), "virtual-driver")
+ public companion object Key : AbstractServiceKey<VirtDriver>(UUID.randomUUID(), "virtual-driver")
}
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/HypervisorView.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/HypervisorView.kt
index 197b4392..cf6b4487 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/HypervisorView.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/HypervisorView.kt
@@ -26,12 +26,12 @@ import org.opendc.compute.core.Server
import org.opendc.compute.virt.driver.VirtDriver
import java.util.UUID
-class HypervisorView(
- val uid: UUID,
- var server: Server,
- var numberOfActiveServers: Int,
- var availableMemory: Long,
- var provisionedCores: Int
+public class HypervisorView(
+ public val uid: UUID,
+ public var server: Server,
+ public var numberOfActiveServers: Int,
+ public var availableMemory: Long,
+ public var provisionedCores: Int
) {
- lateinit var driver: VirtDriver
+ public lateinit var driver: VirtDriver
}
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/SimpleVirtProvisioningService.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/SimpleVirtProvisioningService.kt
index c5d2fd66..3141529f 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/SimpleVirtProvisioningService.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/SimpleVirtProvisioningService.kt
@@ -49,7 +49,7 @@ import kotlin.math.max
private val logger = KotlinLogging.logger {}
@OptIn(ExperimentalCoroutinesApi::class)
-class SimpleVirtProvisioningService(
+public class SimpleVirtProvisioningService(
private val coroutineScope: CoroutineScope,
private val clock: Clock,
private val provisioningService: ProvisioningService,
@@ -75,11 +75,11 @@ class SimpleVirtProvisioningService(
*/
private val activeImages: MutableSet<ImageView> = mutableSetOf()
- var submittedVms = 0
- var queuedVms = 0
- var runningVms = 0
- var finishedVms = 0
- var unscheduledVms = 0
+ public var submittedVms: Int = 0
+ public var queuedVms: Int = 0
+ public var runningVms: Int = 0
+ public var finishedVms: Int = 0
+ public var unscheduledVms: Int = 0
private var maxCores = 0
private var maxMemory = 0L
@@ -370,11 +370,11 @@ class SimpleVirtProvisioningService(
}
}
- data class ImageView(
- val name: String,
- val image: Image,
- val flavor: Flavor,
- val continuation: Continuation<Server>,
- var server: Server? = null
+ public data class ImageView(
+ public val name: String,
+ public val image: Image,
+ public val flavor: Flavor,
+ public val continuation: Continuation<Server>,
+ public var server: Server? = null
)
}
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/VirtProvisioningEvent.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/VirtProvisioningEvent.kt
index 13930320..31f5d2c9 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/VirtProvisioningEvent.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/VirtProvisioningEvent.kt
@@ -36,7 +36,7 @@ public sealed class VirtProvisioningEvent {
/**
* An event emitted for writing metrics.
*/
- data class MetricsAvailable(
+ public data class MetricsAvailable(
override val provisioner: VirtProvisioningService,
public val totalHostCount: Int,
public val availableHostCount: Int,
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/VirtProvisioningService.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/VirtProvisioningService.kt
index a111603f..7ed577c4 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/VirtProvisioningService.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/VirtProvisioningService.kt
@@ -32,11 +32,11 @@ import org.opendc.compute.virt.service.allocation.AllocationPolicy
/**
* A service for VM provisioning on a cloud.
*/
-interface VirtProvisioningService {
+public interface VirtProvisioningService {
/**
* The policy used for allocating a VM on the available hypervisors.
*/
- val allocationPolicy: AllocationPolicy
+ public val allocationPolicy: AllocationPolicy
/**
* The events emitted by the service.
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AllocationPolicy.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AllocationPolicy.kt
index c2f730b9..099d1740 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AllocationPolicy.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AllocationPolicy.kt
@@ -46,5 +46,5 @@ public interface AllocationPolicy {
/**
* Builds the logic of the policy.
*/
- operator fun invoke(): Logic
+ public operator fun invoke(): Logic
}
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AvailableCoreMemoryAllocationPolicy.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AvailableCoreMemoryAllocationPolicy.kt
index 80debff7..cfbf3cd3 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AvailableCoreMemoryAllocationPolicy.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AvailableCoreMemoryAllocationPolicy.kt
@@ -29,7 +29,7 @@ import org.opendc.compute.virt.service.HypervisorView
*
* @param reversed An option to reverse the order of the machines (lower amount of memory scores better).
*/
-public class AvailableCoreMemoryAllocationPolicy(val reversed: Boolean = false) : AllocationPolicy {
+public class AvailableCoreMemoryAllocationPolicy(private val reversed: Boolean = false) : AllocationPolicy {
override fun invoke(): AllocationPolicy.Logic = object : ComparableAllocationPolicyLogic {
override val comparator: Comparator<HypervisorView> =
compareBy<HypervisorView> { -it.availableMemory / it.server.flavor.cpuCount }
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AvailableMemoryAllocationPolicy.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AvailableMemoryAllocationPolicy.kt
index 259077aa..48172765 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AvailableMemoryAllocationPolicy.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/AvailableMemoryAllocationPolicy.kt
@@ -29,7 +29,7 @@ import org.opendc.compute.virt.service.HypervisorView
*
* @param reversed A flag to reverse the order (least amount of memory scores the best).
*/
-public class AvailableMemoryAllocationPolicy(val reversed: Boolean = false) : AllocationPolicy {
+public class AvailableMemoryAllocationPolicy(public val reversed: Boolean = false) : AllocationPolicy {
override fun invoke(): AllocationPolicy.Logic = object : ComparableAllocationPolicyLogic {
override val comparator: Comparator<HypervisorView> = compareBy<HypervisorView> { -it.availableMemory }
.run { if (reversed) reversed() else this }
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ComparableAllocationPolicyLogic.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ComparableAllocationPolicyLogic.kt
index 4bccaef8..8803009d 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ComparableAllocationPolicyLogic.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ComparableAllocationPolicyLogic.kt
@@ -29,7 +29,7 @@ import org.opendc.compute.virt.service.SimpleVirtProvisioningService
/**
* The logic for an [AllocationPolicy] that uses a [Comparator] to select the appropriate node.
*/
-interface ComparableAllocationPolicyLogic : AllocationPolicy.Logic {
+public interface ComparableAllocationPolicyLogic : AllocationPolicy.Logic {
/**
* The comparator to use.
*/
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/NumberOfActiveServersAllocationPolicy.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/NumberOfActiveServersAllocationPolicy.kt
index c385e686..63ba64ce 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/NumberOfActiveServersAllocationPolicy.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/NumberOfActiveServersAllocationPolicy.kt
@@ -29,7 +29,7 @@ import org.opendc.compute.virt.service.HypervisorView
*
* @param reversed A flag to reverse the order, such that the node with the most active servers is selected.
*/
-public class NumberOfActiveServersAllocationPolicy(val reversed: Boolean = false) : AllocationPolicy {
+public class NumberOfActiveServersAllocationPolicy(public val reversed: Boolean = false) : AllocationPolicy {
override fun invoke(): AllocationPolicy.Logic = object : ComparableAllocationPolicyLogic {
override val comparator: Comparator<HypervisorView> = compareBy<HypervisorView> { it.numberOfActiveServers }
.run { if (reversed) reversed() else this }
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ProvisionedCoresAllocationPolicy.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ProvisionedCoresAllocationPolicy.kt
index f5d4abc5..d76e9c82 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ProvisionedCoresAllocationPolicy.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ProvisionedCoresAllocationPolicy.kt
@@ -31,7 +31,7 @@ import org.opendc.compute.virt.service.HypervisorView
* @param reversed A flag to reverse the order of the policy, such that the machine with the most provisioned cores
* is selected.
*/
-class ProvisionedCoresAllocationPolicy(val reversed: Boolean = false) : AllocationPolicy {
+public class ProvisionedCoresAllocationPolicy(private val reversed: Boolean = false) : AllocationPolicy {
override fun invoke(): AllocationPolicy.Logic = object : ComparableAllocationPolicyLogic {
override val comparator: Comparator<HypervisorView> =
compareBy<HypervisorView> { it.provisionedCores / it.server.flavor.cpuCount }
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/RandomAllocationPolicy.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/RandomAllocationPolicy.kt
index d40b2bc2..d143ffe6 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/RandomAllocationPolicy.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/RandomAllocationPolicy.kt
@@ -30,7 +30,7 @@ import kotlin.random.Random
/**
* An [AllocationPolicy] that select a random node on which the server fits.
*/
-public class RandomAllocationPolicy(val random: Random = Random(0)) : AllocationPolicy {
+public class RandomAllocationPolicy(private val random: Random = Random(0)) : AllocationPolicy {
@OptIn(ExperimentalStdlibApi::class)
override fun invoke(): AllocationPolicy.Logic = object : AllocationPolicy.Logic {
override fun select(
diff --git a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt
index fb086027..a623633d 100644
--- a/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt
+++ b/simulator/opendc-compute/src/main/kotlin/org/opendc/compute/virt/service/allocation/ReplayAllocationPolicy.kt
@@ -34,7 +34,7 @@ private val logger = KotlinLogging.logger {}
* Within each cluster, the active servers on each node determine which node gets
* assigned the VM image.
*/
-class ReplayAllocationPolicy(val vmPlacements: Map<String, String>) : AllocationPolicy {
+public class ReplayAllocationPolicy(private val vmPlacements: Map<String, String>) : AllocationPolicy {
override fun invoke(): AllocationPolicy.Logic = object : AllocationPolicy.Logic {
override fun select(
hypervisors: Set<HypervisorView>,