summaryrefslogtreecommitdiff
path: root/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/spi
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/spi')
-rw-r--r--opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/spi/TraceFormat.kt21
1 files changed, 21 insertions, 0 deletions
diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/spi/TraceFormat.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/spi/TraceFormat.kt
index e04dd948..f2e610db 100644
--- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/spi/TraceFormat.kt
+++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/spi/TraceFormat.kt
@@ -23,6 +23,7 @@
package org.opendc.trace.spi
import org.opendc.trace.TableReader
+import org.opendc.trace.TableWriter
import java.nio.file.Path
import java.util.*
@@ -36,6 +37,15 @@ public interface TraceFormat {
public val name: String
/**
+ * Construct an empty trace at [path].
+ *
+ * @param path The path where to create the empty trace.
+ * @throws IllegalArgumentException If [path] is invalid.
+ * @throws UnsupportedOperationException If the table does not support trace creation.
+ */
+ public fun create(path: Path)
+
+ /**
* Return the name of the tables available in the trace at the specified [path].
*
* @param path The path to the trace.
@@ -64,6 +74,17 @@ public interface TraceFormat {
public fun newReader(path: Path, table: String): TableReader
/**
+ * Open a [TableWriter] for the specified [table].
+ *
+ * @param path The path to the trace to open.
+ * @param table The name of the table to open a [TableWriter] for.
+ * @throws IllegalArgumentException If [table] does not exist.
+ * @throws UnsupportedOperationException If the format does not support writing.
+ * @return A [TableWriter] instance for the table.
+ */
+ public fun newWriter(path: Path, table: String): TableWriter
+
+ /**
* A helper object for resolving providers.
*/
public companion object {