From cb27869840f95e182e3cce7c8c447dd7d06c863b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de>
Date: Sat, 10 Dec 2022 23:00:36 +0100
Subject: [PATCH] Align time unit config for UC4

---
 .../docker-test/uc4-beam-flink/docker-compose.yml             | 2 --
 .../docker-test/uc4-beam-samza/docker-compose.yml             | 2 --
 .../docker-test/uc4-kstreams/docker-compose.yml               | 2 --
 .../rocks/theodolite/benchmarks/uc4/beam/PipelineFactory.java | 4 ++--
 .../theodolite/benchmarks/uc4/beam/Uc4ConfigurationKeys.java  | 2 +-
 .../src/main/resources/META-INF/application.properties        | 2 +-
 .../benchmarks/uc4/flink/AggregationServiceFlinkJob.java      | 2 +-
 .../theodolite/benchmarks/uc4/flink/Uc4ConfigurationKeys.java | 2 +-
 .../src/main/resources/META-INF/application.properties        | 2 +-
 .../benchmarks/uc4/hazelcastjet/HistoryService.java           | 4 ++--
 .../benchmarks/uc4/hazelcastjet/Uc4ConfigurationKeys.java     | 2 +-
 .../src/main/resources/META-INF/application.properties        | 2 +-
 12 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/theodolite-benchmarks/docker-test/uc4-beam-flink/docker-compose.yml b/theodolite-benchmarks/docker-test/uc4-beam-flink/docker-compose.yml
index 0e3b886e8..465fcb6ee 100644
--- a/theodolite-benchmarks/docker-test/uc4-beam-flink/docker-compose.yml
+++ b/theodolite-benchmarks/docker-test/uc4-beam-flink/docker-compose.yml
@@ -67,8 +67,6 @@ services:
           parallelism.default: 1
           state.backend: rocksdb
           state.checkpoints.dir: file:///data/flink/checkpoints
-        - GRACE_PERIOD_MS=5000
-        - TRIGGER_INTERVAL_SECONDS=1
       depends_on:
         - schema-registry
         - kafka
diff --git a/theodolite-benchmarks/docker-test/uc4-beam-samza/docker-compose.yml b/theodolite-benchmarks/docker-test/uc4-beam-samza/docker-compose.yml
index 563dbf5ac..51011d2d2 100644
--- a/theodolite-benchmarks/docker-test/uc4-beam-samza/docker-compose.yml
+++ b/theodolite-benchmarks/docker-test/uc4-beam-samza/docker-compose.yml
@@ -52,8 +52,6 @@ services:
       KAFKA_BOOTSTRAP_SERVERS: kafka:9092
       SCHEMA_REGISTRY_URL: http://schema-registry:8081
       ENABLE_METRICS: "false"
-      GRACE_PERIOD_MS: 5000
-      TRIGGER_INTERVAL_SECONDS: 1
   load-generator: 
     image: ghcr.io/cau-se/theodolite-uc4-workload-generator:${THEODOLITE_TAG:-latest}
     depends_on:
diff --git a/theodolite-benchmarks/docker-test/uc4-kstreams/docker-compose.yml b/theodolite-benchmarks/docker-test/uc4-kstreams/docker-compose.yml
index 000214d8f..6aaa02990 100755
--- a/theodolite-benchmarks/docker-test/uc4-kstreams/docker-compose.yml
+++ b/theodolite-benchmarks/docker-test/uc4-kstreams/docker-compose.yml
@@ -45,8 +45,6 @@ services:
     environment:
       KAFKA_BOOTSTRAP_SERVERS: kafka:9092
       SCHEMA_REGISTRY_URL: http://schema-registry:8081
-      COMMIT_INTERVAL_MS: 1000
-      GRACE_PERIOD_MS: 5000
   load-generator: 
     image: ghcr.io/cau-se/theodolite-uc4-workload-generator:${THEODOLITE_TAG:-latest}
     depends_on:
diff --git a/theodolite-benchmarks/uc4-beam/src/main/java/rocks/theodolite/benchmarks/uc4/beam/PipelineFactory.java b/theodolite-benchmarks/uc4-beam/src/main/java/rocks/theodolite/benchmarks/uc4/beam/PipelineFactory.java
index 200e0da60..009605391 100644
--- a/theodolite-benchmarks/uc4-beam/src/main/java/rocks/theodolite/benchmarks/uc4/beam/PipelineFactory.java
+++ b/theodolite-benchmarks/uc4-beam/src/main/java/rocks/theodolite/benchmarks/uc4/beam/PipelineFactory.java
@@ -75,8 +75,8 @@ public class PipelineFactory extends AbstractPipelineFactory {
     final Duration duration = Duration.millis(
         this.config.getInt(Uc4ConfigurationKeys.EMIT_PERIOD_MS));
     // final boolean enableTrigger = this.config.getBoolean(Uc4ConfigurationKeys.TRIGGER_ENABLE);
-    final Duration triggerDelay = Duration.standardSeconds(
-        this.config.getInt(Uc4ConfigurationKeys.TRIGGER_INTERVAL_SECONDS));
+    final Duration triggerDelay = Duration.millis(
+        this.config.getInt(Uc4ConfigurationKeys.TRIGGER_INTERVAL_MS));
     final Duration gracePeriod = Duration.millis(
         this.config.getInt(Uc4ConfigurationKeys.GRACE_PERIOD_MS));
 
diff --git a/theodolite-benchmarks/uc4-beam/src/main/java/rocks/theodolite/benchmarks/uc4/beam/Uc4ConfigurationKeys.java b/theodolite-benchmarks/uc4-beam/src/main/java/rocks/theodolite/benchmarks/uc4/beam/Uc4ConfigurationKeys.java
index f34f70141..7f2fa2d30 100644
--- a/theodolite-benchmarks/uc4-beam/src/main/java/rocks/theodolite/benchmarks/uc4/beam/Uc4ConfigurationKeys.java
+++ b/theodolite-benchmarks/uc4-beam/src/main/java/rocks/theodolite/benchmarks/uc4/beam/Uc4ConfigurationKeys.java
@@ -15,7 +15,7 @@ public final class Uc4ConfigurationKeys {
 
   public static final String GRACE_PERIOD_MS = "grace.period.ms";
 
-  public static final String TRIGGER_INTERVAL_SECONDS = "trigger.interval.seconds";
+  public static final String TRIGGER_INTERVAL_MS = "trigger.interval.ms";
 
   private Uc4ConfigurationKeys() {}
 
diff --git a/theodolite-benchmarks/uc4-beam/src/main/resources/META-INF/application.properties b/theodolite-benchmarks/uc4-beam/src/main/resources/META-INF/application.properties
index e761c2646..1791e4f99 100644
--- a/theodolite-benchmarks/uc4-beam/src/main/resources/META-INF/application.properties
+++ b/theodolite-benchmarks/uc4-beam/src/main/resources/META-INF/application.properties
@@ -10,7 +10,7 @@ kafka.feedback.topic=aggregation-feedback
 schema.registry.url=http://localhost:8081
 
 emit.period.ms=5000
-trigger.interval.seconds=1
+trigger.interval.ms=1000
 grace.period.ms=5000
 
 specific.avro.reader=true
diff --git a/theodolite-benchmarks/uc4-flink/src/main/java/rocks/theodolite/benchmarks/uc4/flink/AggregationServiceFlinkJob.java b/theodolite-benchmarks/uc4-flink/src/main/java/rocks/theodolite/benchmarks/uc4/flink/AggregationServiceFlinkJob.java
index e0c2a2a00..adfd54ab5 100644
--- a/theodolite-benchmarks/uc4-flink/src/main/java/rocks/theodolite/benchmarks/uc4/flink/AggregationServiceFlinkJob.java
+++ b/theodolite-benchmarks/uc4-flink/src/main/java/rocks/theodolite/benchmarks/uc4/flink/AggregationServiceFlinkJob.java
@@ -75,7 +75,7 @@ public final class AggregationServiceFlinkJob extends AbstractFlinkService {
     final Duration windowGrace =
         Duration.ofMillis(this.config.getLong(Uc4ConfigurationKeys.GRACE_PERIOD_MS));
     final Time triggerDuration =
-        Time.seconds(this.config.getLong(Uc4ConfigurationKeys.TRIGGER_INTERVAL_SECONDS));
+        Time.milliseconds(this.config.getLong(Uc4ConfigurationKeys.TRIGGER_INTERVAL_MS));
     final String configurationTopic =
         this.config.getString(Uc4ConfigurationKeys.CONFIGURATION_KAFKA_TOPIC);
     final boolean checkpointing = this.config.getBoolean(ConfigurationKeys.CHECKPOINTING, true);
diff --git a/theodolite-benchmarks/uc4-flink/src/main/java/rocks/theodolite/benchmarks/uc4/flink/Uc4ConfigurationKeys.java b/theodolite-benchmarks/uc4-flink/src/main/java/rocks/theodolite/benchmarks/uc4/flink/Uc4ConfigurationKeys.java
index 49c38ae66..772fcb147 100644
--- a/theodolite-benchmarks/uc4-flink/src/main/java/rocks/theodolite/benchmarks/uc4/flink/Uc4ConfigurationKeys.java
+++ b/theodolite-benchmarks/uc4-flink/src/main/java/rocks/theodolite/benchmarks/uc4/flink/Uc4ConfigurationKeys.java
@@ -19,7 +19,7 @@ public final class Uc4ConfigurationKeys {
 
   public static final String GRACE_PERIOD_MS = "grace.period.ms";
 
-  public static final String TRIGGER_INTERVAL_SECONDS = "trigger.interval.seconds";
+  public static final String TRIGGER_INTERVAL_MS = "trigger.interval.ms";
 
   private Uc4ConfigurationKeys() {}
 
diff --git a/theodolite-benchmarks/uc4-flink/src/main/resources/META-INF/application.properties b/theodolite-benchmarks/uc4-flink/src/main/resources/META-INF/application.properties
index bb26b56fa..1de229de9 100644
--- a/theodolite-benchmarks/uc4-flink/src/main/resources/META-INF/application.properties
+++ b/theodolite-benchmarks/uc4-flink/src/main/resources/META-INF/application.properties
@@ -10,7 +10,7 @@ kafka.feedback.topic=aggregation-feedback
 schema.registry.url=http://localhost:8081
 
 emit.period.ms=5000
-trigger.interval.seconds=1
+trigger.interval.ms=1000
 grace.period.ms=5000
 
 # Flink configuration
diff --git a/theodolite-benchmarks/uc4-hazelcastjet/src/main/java/rocks/theodolite/benchmarks/uc4/hazelcastjet/HistoryService.java b/theodolite-benchmarks/uc4-hazelcastjet/src/main/java/rocks/theodolite/benchmarks/uc4/hazelcastjet/HistoryService.java
index 5790d5e3d..24d0a8aeb 100644
--- a/theodolite-benchmarks/uc4-hazelcastjet/src/main/java/rocks/theodolite/benchmarks/uc4/hazelcastjet/HistoryService.java
+++ b/theodolite-benchmarks/uc4-hazelcastjet/src/main/java/rocks/theodolite/benchmarks/uc4/hazelcastjet/HistoryService.java
@@ -59,8 +59,8 @@ public class HistoryService extends HazelcastJetService {
     final Duration gracePeriod = Duration.ofMillis(
         this.config.getInt(Uc4ConfigurationKeys.GRACE_PERIOD_MS));
 
-    final Duration triggerPeriod = Duration.ofSeconds(
-        this.config.getInt(Uc4ConfigurationKeys.TRIGGER_INTERVAL_SECONDS));
+    final Duration triggerPeriod = Duration.ofMillis(
+        this.config.getInt(Uc4ConfigurationKeys.TRIGGER_INTERVAL_MS));
 
     this.pipelineFactory = new Uc4PipelineFactory(
         kafkaProps,
diff --git a/theodolite-benchmarks/uc4-hazelcastjet/src/main/java/rocks/theodolite/benchmarks/uc4/hazelcastjet/Uc4ConfigurationKeys.java b/theodolite-benchmarks/uc4-hazelcastjet/src/main/java/rocks/theodolite/benchmarks/uc4/hazelcastjet/Uc4ConfigurationKeys.java
index 3eedfc0bc..92e91a79b 100644
--- a/theodolite-benchmarks/uc4-hazelcastjet/src/main/java/rocks/theodolite/benchmarks/uc4/hazelcastjet/Uc4ConfigurationKeys.java
+++ b/theodolite-benchmarks/uc4-hazelcastjet/src/main/java/rocks/theodolite/benchmarks/uc4/hazelcastjet/Uc4ConfigurationKeys.java
@@ -15,6 +15,6 @@ public class Uc4ConfigurationKeys {
 
   public static final String GRACE_PERIOD_MS = "grace.period.ms";
 
-  public static final String TRIGGER_INTERVAL_SECONDS = "trigger.interval.seconds";
+  public static final String TRIGGER_INTERVAL_MS = "trigger.interval.ms";
 
 }
diff --git a/theodolite-benchmarks/uc4-hazelcastjet/src/main/resources/META-INF/application.properties b/theodolite-benchmarks/uc4-hazelcastjet/src/main/resources/META-INF/application.properties
index af55655bb..7ec1b4826 100644
--- a/theodolite-benchmarks/uc4-hazelcastjet/src/main/resources/META-INF/application.properties
+++ b/theodolite-benchmarks/uc4-hazelcastjet/src/main/resources/META-INF/application.properties
@@ -10,5 +10,5 @@ kafka.feedback.topic=aggregation-feedback
 schema.registry.url=http://localhost:8081
 
 emit.period.ms=5000
-trigger.interval.seconds=1
+trigger.interval.ms=1000
 grace.period.ms=5000
-- 
GitLab