diff --git a/uc1-application/src/main/java/spesb/uc1/application/ConfigurationKeys.java b/uc1-application/src/main/java/spesb/uc1/application/ConfigurationKeys.java index 7a275cb33a4cd35d228d8ca33ebb7303b251271b..bf5596cda5302863990076f7f622dcc121deb83f 100644 --- a/uc1-application/src/main/java/spesb/uc1/application/ConfigurationKeys.java +++ b/uc1-application/src/main/java/spesb/uc1/application/ConfigurationKeys.java @@ -5,19 +5,18 @@ package spesb.uc1.application; */ public final class ConfigurationKeys { - public static final String KAFKA_BOOTSTRAP_SERVERS = "kafka.bootstrap.servers"; + public static final String KAFKA_BOOTSTRAP_SERVERS = "kafka.bootstrap.servers"; - public static final String KAFKA_OUTPUT_TOPIC = "kafka.output.topic"; + public static final String KAFKA_OUTPUT_TOPIC = "kafka.output.topic"; - public static final String KAFKA_INPUT_TOPIC = "kafka.input.topic"; + public static final String KAFKA_INPUT_TOPIC = "kafka.input.topic"; - public static final String NUM_THREADS = "num.threads"; + public static final String NUM_THREADS = "num.threads"; - public static final String COMMIT_INTERVAL_MS = "commit.interval.ms"; + public static final String COMMIT_INTERVAL_MS = "commit.interval.ms"; - public static final String CACHE_MAX_BYTES_BUFFERING = "cache.max.bytes.buffering"; + public static final String CACHE_MAX_BYTES_BUFFERING = "cache.max.bytes.buffering"; - private ConfigurationKeys() { - } + private ConfigurationKeys() {} } diff --git a/uc1-workload-generator/src/main/java/spesb/uc1/workloadgenerator/LoadGenerator.java b/uc1-workload-generator/src/main/java/spesb/uc1/workloadgenerator/LoadGenerator.java index b0b22ceaecc7b078578016e56c52b831f0227e80..664ce366ddfb84b9a3f4748ab86fbc7a62c93a43 100644 --- a/uc1-workload-generator/src/main/java/spesb/uc1/workloadgenerator/LoadGenerator.java +++ b/uc1-workload-generator/src/main/java/spesb/uc1/workloadgenerator/LoadGenerator.java @@ -16,10 +16,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import titan.ccp.models.records.ActivePowerRecord; -public class LoadGenerator { +/** + * Load Generator for UC1. + */ +public final class LoadGenerator { private static final Logger LOGGER = LoggerFactory.getLogger(LoadGenerator.class); + private static final int MAX_DURATION_IN_DAYS = 30; + + private LoadGenerator() {} + public static void main(final String[] args) throws InterruptedException, IOException { // uc1 LOGGER.info("Start workload generator for use case UC1."); @@ -62,7 +69,7 @@ public class LoadGenerator { .setKeySpace(new KeySpace("s_", numSensors)) .setThreads(threads) .setPeriod(new Period(periodMs, TimeUnit.MILLISECONDS)) - .setDuration(new Duration(30, TimeUnit.DAYS)) + .setDuration(new Duration(MAX_DURATION_IN_DAYS, TimeUnit.DAYS)) .setGeneratorFunction( sensor -> new ActivePowerRecord(sensor, System.currentTimeMillis(), value)) .setZooKeeper(new ZooKeeper(zooKeeperHost, zooKeeperPort))