From eedf207bf4c9b723db685e6b7a9191bef9745486 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 31 Aug 2020 20:57:06 +0200 Subject: Add explicit API visibility This change adds explicit visibility modifiers to the public interfaces and enables Kotlin 1.4's explicit API mode. --- .../kotlin/org/opendc/format/environment/EnvironmentReader.kt | 4 ++-- .../opendc/format/environment/sc18/Sc18EnvironmentReader.kt | 2 +- .../format/environment/sc20/Sc20ClusterEnvironmentReader.kt | 4 ++-- .../opendc/format/environment/sc20/Sc20EnvironmentReader.kt | 2 +- .../opendc/format/trace/PerformanceInterferenceModelReader.kt | 4 ++-- .../src/main/kotlin/org/opendc/format/trace/TraceEntry.kt | 10 +++++----- .../src/main/kotlin/org/opendc/format/trace/TraceReader.kt | 2 +- .../src/main/kotlin/org/opendc/format/trace/TraceWriter.kt | 4 ++-- .../main/kotlin/org/opendc/format/trace/VmPlacementReader.kt | 4 ++-- .../org/opendc/format/trace/bitbrains/BitbrainsTraceReader.kt | 2 +- .../main/kotlin/org/opendc/format/trace/gwf/GwfTraceReader.kt | 6 +++--- .../format/trace/sc20/Sc20PerformanceInterferenceReader.kt | 2 +- .../kotlin/org/opendc/format/trace/sc20/Sc20TraceReader.kt | 2 +- .../org/opendc/format/trace/sc20/Sc20VmPlacementReader.kt | 2 +- .../main/kotlin/org/opendc/format/trace/swf/SwfTraceReader.kt | 2 +- .../main/kotlin/org/opendc/format/trace/wtf/WtfTraceReader.kt | 2 +- 16 files changed, 27 insertions(+), 27 deletions(-) (limited to 'simulator/opendc-format') diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/EnvironmentReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/EnvironmentReader.kt index dd1f8edb..1f73bb61 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/EnvironmentReader.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/EnvironmentReader.kt @@ -30,9 +30,9 @@ import java.time.Clock /** * An interface for reading descriptions of topology environments into memory as [Environment]. */ -interface EnvironmentReader : Closeable { +public interface EnvironmentReader : Closeable { /** * Construct an [Environment] in the specified [CoroutineScope]. */ - suspend fun construct(coroutineScope: CoroutineScope, clock: Clock): Environment + public suspend fun construct(coroutineScope: CoroutineScope, clock: Clock): Environment } diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc18/Sc18EnvironmentReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc18/Sc18EnvironmentReader.kt index 16bb92c2..027548a8 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc18/Sc18EnvironmentReader.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc18/Sc18EnvironmentReader.kt @@ -48,7 +48,7 @@ import java.util.* * @param input The input stream to read from. * @param mapper The Jackson object mapper to use. */ -class Sc18EnvironmentReader(input: InputStream, mapper: ObjectMapper = jacksonObjectMapper()) : EnvironmentReader { +public class Sc18EnvironmentReader(input: InputStream, mapper: ObjectMapper = jacksonObjectMapper()) : EnvironmentReader { /** * The environment that was read from the file. */ diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt index 2232b548..634d5de6 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt @@ -47,11 +47,11 @@ import java.util.* * * @param environmentFile The file describing the physical cluster. */ -class Sc20ClusterEnvironmentReader( +public class Sc20ClusterEnvironmentReader( private val input: InputStream ) : EnvironmentReader { - constructor(file: File) : this(FileInputStream(file)) + public constructor(file: File) : this(FileInputStream(file)) @Suppress("BlockingMethodInNonBlockingContext") override suspend fun construct(coroutineScope: CoroutineScope, clock: Clock): Environment { diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt index 74afd8c4..9fd38d13 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt @@ -48,7 +48,7 @@ import java.util.* * @param input The input stream to read from. * @param mapper The Jackson object mapper to use. */ -class Sc20EnvironmentReader(input: InputStream, mapper: ObjectMapper = jacksonObjectMapper()) : EnvironmentReader { +public class Sc20EnvironmentReader(input: InputStream, mapper: ObjectMapper = jacksonObjectMapper()) : EnvironmentReader { /** * The environment that was read from the file. */ diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/PerformanceInterferenceModelReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/PerformanceInterferenceModelReader.kt index 768974e1..7f60cd90 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/PerformanceInterferenceModelReader.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/PerformanceInterferenceModelReader.kt @@ -29,9 +29,9 @@ import kotlin.random.Random /** * An interface for reading descriptions of performance interference models into memory. */ -interface PerformanceInterferenceModelReader : Closeable { +public interface PerformanceInterferenceModelReader : Closeable { /** * Construct a [PerformanceInterferenceModel]. */ - fun construct(random: Random): Map + public fun construct(random: Random): Map } diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/TraceEntry.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/TraceEntry.kt index d532ab35..ec547e84 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/TraceEntry.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/TraceEntry.kt @@ -31,24 +31,24 @@ import org.opendc.core.workload.Workload * * @param T The shape of the workload in this entry. */ -interface TraceEntry { +public interface TraceEntry { /** * The time of submission of the workload. */ - val submissionTime: Long + public val submissionTime: Long /** * The workload in this trace entry. */ - val workload: T + public val workload: T /** * Extract the submission time from this entry. */ - operator fun component1() = submissionTime + public operator fun component1(): Long = submissionTime /** * Extract the workload from this entry. */ - operator fun component2() = workload + public operator fun component2(): T = workload } diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/TraceReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/TraceReader.kt index 81c1294a..a0beec3e 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/TraceReader.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/TraceReader.kt @@ -32,4 +32,4 @@ import java.io.Closeable * * @param T The shape of the workloads supported by this reader. */ -interface TraceReader : Iterator>, Closeable +public interface TraceReader : Iterator>, Closeable diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/TraceWriter.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/TraceWriter.kt index 56b1b025..54fb6214 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/TraceWriter.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/TraceWriter.kt @@ -32,7 +32,7 @@ import java.io.Closeable * * @param T The type of [Workload] supported by this writer. */ -interface TraceWriter : Closeable { +public interface TraceWriter : Closeable { /** * Write an entry to the trace. * @@ -41,5 +41,5 @@ interface TraceWriter : Closeable { * @param submissionTime The time of submission of the workload. * @param workload The workload to write to the trace. */ - fun write(submissionTime: Long, workload: T) + public fun write(submissionTime: Long, workload: T) } diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/VmPlacementReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/VmPlacementReader.kt index 7f9e9960..6861affe 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/VmPlacementReader.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/VmPlacementReader.kt @@ -29,9 +29,9 @@ import java.io.Closeable /** * An interface for reading VM placement data into memory. */ -interface VmPlacementReader : Closeable { +public interface VmPlacementReader : Closeable { /** * Construct a map of VMs to clusters. */ - fun construct(): Map + public fun construct(): Map } diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/bitbrains/BitbrainsTraceReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/bitbrains/BitbrainsTraceReader.kt index 26c599c2..89d4246d 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/bitbrains/BitbrainsTraceReader.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/bitbrains/BitbrainsTraceReader.kt @@ -41,7 +41,7 @@ import java.util.* * @param traceDirectory The directory of the traces. * @param performanceInterferenceModel The performance model covering the workload in the VM trace. */ -class BitbrainsTraceReader( +public class BitbrainsTraceReader( traceDirectory: File, performanceInterferenceModel: PerformanceInterferenceModel ) : TraceReader { diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/gwf/GwfTraceReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/gwf/GwfTraceReader.kt index 4382e0b5..9f8fb558 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/gwf/GwfTraceReader.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/gwf/GwfTraceReader.kt @@ -63,7 +63,7 @@ import kotlin.math.min * * @param reader The buffered reader to read the trace with. */ -class GwfTraceReader(reader: BufferedReader) : TraceReader { +public class GwfTraceReader(reader: BufferedReader) : TraceReader { /** * The internal iterator to use for this reader. */ @@ -74,14 +74,14 @@ class GwfTraceReader(reader: BufferedReader) : TraceReader { * * @param file The file to read from. */ - constructor(file: File) : this(file.bufferedReader()) + public constructor(file: File) : this(file.bufferedReader()) /** * Create a [GwfTraceReader] instance from the specified [InputStream]. * * @param input The input stream to read from. */ - constructor(input: InputStream) : this(input.bufferedReader()) + public constructor(input: InputStream) : this(input.bufferedReader()) /** * Initialize the reader. diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/sc20/Sc20PerformanceInterferenceReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/sc20/Sc20PerformanceInterferenceReader.kt index 0ab7d035..fd8cdfce 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/sc20/Sc20PerformanceInterferenceReader.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/sc20/Sc20PerformanceInterferenceReader.kt @@ -38,7 +38,7 @@ import kotlin.random.Random * @param input The input stream to read from. * @param mapper The Jackson object mapper to use. */ -class Sc20PerformanceInterferenceReader(input: InputStream, mapper: ObjectMapper = jacksonObjectMapper()) : +public class Sc20PerformanceInterferenceReader(input: InputStream, mapper: ObjectMapper = jacksonObjectMapper()) : PerformanceInterferenceModelReader { /** * The computed value from the file. diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/sc20/Sc20TraceReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/sc20/Sc20TraceReader.kt index e26e59a8..bfcc30ce 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/sc20/Sc20TraceReader.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/sc20/Sc20TraceReader.kt @@ -44,7 +44,7 @@ import kotlin.random.Random * @param traceDirectory The directory of the traces. * @param performanceInterferenceModel The performance model covering the workload in the VM trace. */ -class Sc20TraceReader( +public class Sc20TraceReader( traceDirectory: File, performanceInterferenceModel: PerformanceInterferenceModel, selectedVms: List, diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/sc20/Sc20VmPlacementReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/sc20/Sc20VmPlacementReader.kt index 93428d49..61bdea60 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/sc20/Sc20VmPlacementReader.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/sc20/Sc20VmPlacementReader.kt @@ -34,7 +34,7 @@ import java.io.InputStream * @param input The input stream to read from. * @param mapper The Jackson object mapper to use. */ -class Sc20VmPlacementReader(input: InputStream, mapper: ObjectMapper = jacksonObjectMapper()) : +public class Sc20VmPlacementReader(input: InputStream, mapper: ObjectMapper = jacksonObjectMapper()) : VmPlacementReader { /** * The environment that was read from the file. diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/swf/SwfTraceReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/swf/SwfTraceReader.kt index 6fb29a03..13bd7ac3 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/swf/SwfTraceReader.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/swf/SwfTraceReader.kt @@ -40,7 +40,7 @@ import java.util.* * * @param file The trace file. */ -class SwfTraceReader( +public class SwfTraceReader( file: File, maxNumCores: Int = -1 ) : TraceReader { diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/wtf/WtfTraceReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/wtf/WtfTraceReader.kt index 12a60aec..de6647d0 100644 --- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/wtf/WtfTraceReader.kt +++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/trace/wtf/WtfTraceReader.kt @@ -41,7 +41,7 @@ import kotlin.math.min * * @param path The path to the trace. */ -class WtfTraceReader(path: String) : TraceReader { +public class WtfTraceReader(path: String) : TraceReader { /** * The internal iterator to use for this reader. */ -- cgit v1.2.3