summaryrefslogtreecommitdiff
path: root/opendc-trace/opendc-trace-wfformat
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-09-12 11:22:07 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-09-12 11:27:57 +0200
commit49dd8377c8bfde1e64e411c6a6f921c768b9b53b (patch)
tree7ea0698750f3a898f110d483ba59837fbe05f93d /opendc-trace/opendc-trace-wfformat
parentb7be3400bb4b21d0cd7021e2baf1f6ce43aba189 (diff)
refactor(trace): Add API for accessing available table columns
This change adds a new API to the Table interface for accessing the table columns that the table supports. This does not necessarily mean that the column will have a value for every row, but that the table format has defined this particular column.
Diffstat (limited to 'opendc-trace/opendc-trace-wfformat')
-rw-r--r--opendc-trace/opendc-trace-wfformat/src/main/kotlin/org/opendc/trace/wfformat/WfFormatTaskTable.kt19
1 files changed, 8 insertions, 11 deletions
diff --git a/opendc-trace/opendc-trace-wfformat/src/main/kotlin/org/opendc/trace/wfformat/WfFormatTaskTable.kt b/opendc-trace/opendc-trace-wfformat/src/main/kotlin/org/opendc/trace/wfformat/WfFormatTaskTable.kt
index 907bf7ff..7b7f979f 100644
--- a/opendc-trace/opendc-trace-wfformat/src/main/kotlin/org/opendc/trace/wfformat/WfFormatTaskTable.kt
+++ b/opendc-trace/opendc-trace-wfformat/src/main/kotlin/org/opendc/trace/wfformat/WfFormatTaskTable.kt
@@ -34,17 +34,14 @@ internal class WfFormatTaskTable(private val factory: JsonFactory, private val p
override val isSynthetic: Boolean = false
- override fun isSupported(column: TableColumn<*>): Boolean {
- return when (column) {
- TASK_ID -> true
- TASK_WORKFLOW_ID -> true
- TASK_RUNTIME -> true
- TASK_REQ_NCPUS -> true
- TASK_PARENTS -> true
- TASK_CHILDREN -> true
- else -> false
- }
- }
+ override val columns: List<TableColumn<*>> = listOf(
+ TASK_ID,
+ TASK_WORKFLOW_ID,
+ TASK_RUNTIME,
+ TASK_REQ_NCPUS,
+ TASK_PARENTS,
+ TASK_CHILDREN
+ )
override fun newReader(): TableReader {
val parser = factory.createParser(path.toFile())