From 485e370471c2cbf83edf8001c3c5c1fa49438832 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de>
Date: Tue, 23 Feb 2021 16:52:37 +0100
Subject: [PATCH] Add some documentation

---
 .../functions/MessageGenerator.java                |  4 ++++
 .../functions/RecordGenerator.java                 |  4 ++--
 .../functions/TitanMessageGeneratorFactory.java    | 14 ++++++++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/benchmarks/workload-generator-commons/src/main/java/theodolite/commons/workloadgeneration/functions/MessageGenerator.java b/benchmarks/workload-generator-commons/src/main/java/theodolite/commons/workloadgeneration/functions/MessageGenerator.java
index 11034c2d5..f59423b95 100644
--- a/benchmarks/workload-generator-commons/src/main/java/theodolite/commons/workloadgeneration/functions/MessageGenerator.java
+++ b/benchmarks/workload-generator-commons/src/main/java/theodolite/commons/workloadgeneration/functions/MessageGenerator.java
@@ -1,5 +1,9 @@
 package theodolite.commons.workloadgeneration.functions;
 
+/**
+ * Interface representing a message generator, which sends messages for given keys to some
+ * destination.
+ */
 @FunctionalInterface
 public interface MessageGenerator {
 
diff --git a/benchmarks/workload-generator-commons/src/main/java/theodolite/commons/workloadgeneration/functions/RecordGenerator.java b/benchmarks/workload-generator-commons/src/main/java/theodolite/commons/workloadgeneration/functions/RecordGenerator.java
index 1075d089f..4a94d8c3b 100644
--- a/benchmarks/workload-generator-commons/src/main/java/theodolite/commons/workloadgeneration/functions/RecordGenerator.java
+++ b/benchmarks/workload-generator-commons/src/main/java/theodolite/commons/workloadgeneration/functions/RecordGenerator.java
@@ -1,8 +1,8 @@
 package theodolite.commons.workloadgeneration.functions;
 
 /**
- * This interface describes a function that takes meta information from a string (e.g. an ID) and
- * produces an object of type T.
+ * This interface describes a function that takes meta information from a string key and produces an
+ * object of type T.
  *
  * @param <T> the type of the objects that will be generated by the function.
  */
diff --git a/benchmarks/workload-generator-commons/src/main/java/theodolite/commons/workloadgeneration/functions/TitanMessageGeneratorFactory.java b/benchmarks/workload-generator-commons/src/main/java/theodolite/commons/workloadgeneration/functions/TitanMessageGeneratorFactory.java
index 3fa9dba7c..2fd784e80 100644
--- a/benchmarks/workload-generator-commons/src/main/java/theodolite/commons/workloadgeneration/functions/TitanMessageGeneratorFactory.java
+++ b/benchmarks/workload-generator-commons/src/main/java/theodolite/commons/workloadgeneration/functions/TitanMessageGeneratorFactory.java
@@ -4,6 +4,10 @@ import java.util.Properties;
 import theodolite.commons.workloadgeneration.communication.kafka.KafkaRecordSender;
 import titan.ccp.model.records.ActivePowerRecord;
 
+/**
+ * A factory for creating {@link MessageGenerator}s that creates Titan {@link ActivePowerRecord}s
+ * and sends them via Kafka.
+ */
 public final class TitanMessageGeneratorFactory {
 
   private final RecordSender<ActivePowerRecord> recordSender;
@@ -12,12 +16,19 @@ public final class TitanMessageGeneratorFactory {
     this.recordSender = recordSender;
   }
 
+  /**
+   * Create a {@link MessageGenerator} that generates Titan {@link ActivePowerRecord}s with a
+   * constant value.
+   */
   public MessageGenerator forConstantValue(final double value) {
     return MessageGenerator.from(
         sensor -> new ActivePowerRecord(sensor, System.currentTimeMillis(), value),
         this.recordSender);
   }
 
+  /**
+   * Create a new TitanMessageGeneratorFactory for the given Kafka configuration.
+   */
   public static TitanMessageGeneratorFactory withKafkaConfig(
       final String bootstrapServers,
       final String topic,
@@ -25,6 +36,9 @@ public final class TitanMessageGeneratorFactory {
     return withKafkaConfig(bootstrapServers, topic, schemaRegistryUrl, new Properties());
   }
 
+  /**
+   * Create a new TitanMessageGeneratorFactory for the given Kafka configuration.
+   */
   public static TitanMessageGeneratorFactory withKafkaConfig(
       final String bootstrapServers,
       final String topic,
-- 
GitLab