From c7f4b7104b65734a8b6374c84ffd3fc019897122 Mon Sep 17 00:00:00 2001
From: Simon Ehrenstein <simon.ehrenstein@gmail.com>
Date: Mon, 25 May 2020 22:47:54 +0200
Subject: [PATCH] Replace sysouts with LOGGER calls

---
 execution/exp_counter.txt                     |   2 +-
 test-workload-generator/.directory            |   6 -
 .../.settings/org.eclipse.jdt.ui.prefs        | 127 ------------------
 .../qa.eclipse.plugin.checkstyle.prefs        |   4 -
 .../.settings/qa.eclipse.plugin.pmd.prefs     |   4 -
 test-workload-generator/build.gradle          |  31 -----
 test-workload-generator/docker-compose.yml    |  20 ---
 .../src/main/java/test/Main.java              |  40 ------
 .../uc2/workloadgenerator/LoadGenerator.java  |   6 +-
 .../uc3/workloadgenerator/LoadGenerator.java  |   3 +-
 .../java/common/dimensions/Dimension.java     |   8 --
 .../main/java/common/dimensions/Duration.java |   2 +-
 .../main/java/common/dimensions/KeySpace.java |   2 +-
 .../main/java/common/dimensions/Period.java   |   2 +-
 .../KafkaWorkloadGeneratorBuilder.java        |   7 +
 .../common/generators/WorkloadGenerator.java  |   9 +-
 .../main/java/common/misc/WorkloadEntity.java |   3 +
 .../zookeeper/WorkloadDistributor.java        |  12 +-
 18 files changed, 29 insertions(+), 259 deletions(-)
 delete mode 100644 test-workload-generator/.directory
 delete mode 100644 test-workload-generator/.settings/org.eclipse.jdt.ui.prefs
 delete mode 100644 test-workload-generator/.settings/qa.eclipse.plugin.checkstyle.prefs
 delete mode 100644 test-workload-generator/.settings/qa.eclipse.plugin.pmd.prefs
 delete mode 100644 test-workload-generator/build.gradle
 delete mode 100644 test-workload-generator/docker-compose.yml
 delete mode 100644 test-workload-generator/src/main/java/test/Main.java
 delete mode 100644 workload-generator-common/src/main/java/common/dimensions/Dimension.java

diff --git a/execution/exp_counter.txt b/execution/exp_counter.txt
index ec635144f..b1bd38b62 100644
--- a/execution/exp_counter.txt
+++ b/execution/exp_counter.txt
@@ -1 +1 @@
-9
+13
diff --git a/test-workload-generator/.directory b/test-workload-generator/.directory
deleted file mode 100644
index 60c20eff5..000000000
--- a/test-workload-generator/.directory
+++ /dev/null
@@ -1,6 +0,0 @@
-[Dolphin]
-Timestamp=2020,5,12,13,3,57
-Version=4
-
-[Settings]
-HiddenFilesShown=true
diff --git a/test-workload-generator/.settings/org.eclipse.jdt.ui.prefs b/test-workload-generator/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index f0bbf1d01..000000000
--- a/test-workload-generator/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,127 +0,0 @@
-cleanup.add_default_serial_version_id=true
-cleanup.add_generated_serial_version_id=false
-cleanup.add_missing_annotations=true
-cleanup.add_missing_deprecated_annotations=true
-cleanup.add_missing_methods=false
-cleanup.add_missing_nls_tags=false
-cleanup.add_missing_override_annotations=true
-cleanup.add_missing_override_annotations_interface_methods=true
-cleanup.add_serial_version_id=false
-cleanup.always_use_blocks=true
-cleanup.always_use_parentheses_in_expressions=false
-cleanup.always_use_this_for_non_static_field_access=true
-cleanup.always_use_this_for_non_static_method_access=true
-cleanup.convert_functional_interfaces=false
-cleanup.convert_to_enhanced_for_loop=true
-cleanup.correct_indentation=true
-cleanup.format_source_code=true
-cleanup.format_source_code_changes_only=false
-cleanup.insert_inferred_type_arguments=false
-cleanup.make_local_variable_final=true
-cleanup.make_parameters_final=true
-cleanup.make_private_fields_final=true
-cleanup.make_type_abstract_if_missing_method=false
-cleanup.make_variable_declarations_final=true
-cleanup.never_use_blocks=false
-cleanup.never_use_parentheses_in_expressions=true
-cleanup.organize_imports=true
-cleanup.qualify_static_field_accesses_with_declaring_class=false
-cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-cleanup.qualify_static_member_accesses_with_declaring_class=true
-cleanup.qualify_static_method_accesses_with_declaring_class=false
-cleanup.remove_private_constructors=true
-cleanup.remove_redundant_modifiers=false
-cleanup.remove_redundant_semicolons=true
-cleanup.remove_redundant_type_arguments=true
-cleanup.remove_trailing_whitespaces=true
-cleanup.remove_trailing_whitespaces_all=true
-cleanup.remove_trailing_whitespaces_ignore_empty=false
-cleanup.remove_unnecessary_casts=true
-cleanup.remove_unnecessary_nls_tags=true
-cleanup.remove_unused_imports=true
-cleanup.remove_unused_local_variables=false
-cleanup.remove_unused_private_fields=true
-cleanup.remove_unused_private_members=false
-cleanup.remove_unused_private_methods=true
-cleanup.remove_unused_private_types=true
-cleanup.sort_members=false
-cleanup.sort_members_all=false
-cleanup.use_anonymous_class_creation=false
-cleanup.use_blocks=true
-cleanup.use_blocks_only_for_return_and_throw=false
-cleanup.use_lambda=true
-cleanup.use_parentheses_in_expressions=true
-cleanup.use_this_for_non_static_field_access=true
-cleanup.use_this_for_non_static_field_access_only_if_necessary=false
-cleanup.use_this_for_non_static_method_access=true
-cleanup.use_this_for_non_static_method_access_only_if_necessary=false
-cleanup_profile=_CAU-SE-Style
-cleanup_settings_version=2
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_CAU-SE-Style
-formatter_settings_version=16
-org.eclipse.jdt.ui.ignorelowercasenames=true
-org.eclipse.jdt.ui.importorder=;
-org.eclipse.jdt.ui.ondemandthreshold=99
-org.eclipse.jdt.ui.staticondemandthreshold=99
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=true
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_missing_override_annotations_interface_methods=true
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=true
-sp_cleanup.always_use_this_for_non_static_method_access=true
-sp_cleanup.convert_functional_interfaces=false
-sp_cleanup.convert_to_enhanced_for_loop=true
-sp_cleanup.correct_indentation=true
-sp_cleanup.format_source_code=true
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.insert_inferred_type_arguments=false
-sp_cleanup.make_local_variable_final=true
-sp_cleanup.make_parameters_final=true
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=true
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=true
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=true
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_redundant_modifiers=false
-sp_cleanup.remove_redundant_semicolons=true
-sp_cleanup.remove_redundant_type_arguments=true
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=true
-sp_cleanup.remove_unnecessary_nls_tags=true
-sp_cleanup.remove_unused_imports=true
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_anonymous_class_creation=false
-sp_cleanup.use_blocks=true
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_lambda=true
-sp_cleanup.use_parentheses_in_expressions=true
-sp_cleanup.use_this_for_non_static_field_access=true
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false
-sp_cleanup.use_this_for_non_static_method_access=true
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=false
diff --git a/test-workload-generator/.settings/qa.eclipse.plugin.checkstyle.prefs b/test-workload-generator/.settings/qa.eclipse.plugin.checkstyle.prefs
deleted file mode 100644
index 87860c815..000000000
--- a/test-workload-generator/.settings/qa.eclipse.plugin.checkstyle.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-configFilePath=../config/checkstyle.xml
-customModulesJarPaths=
-eclipse.preferences.version=1
-enabled=true
diff --git a/test-workload-generator/.settings/qa.eclipse.plugin.pmd.prefs b/test-workload-generator/.settings/qa.eclipse.plugin.pmd.prefs
deleted file mode 100644
index 40bfd0ecd..000000000
--- a/test-workload-generator/.settings/qa.eclipse.plugin.pmd.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-customRulesJars=
-eclipse.preferences.version=1
-enabled=false
-ruleSetFilePath=../config/pmd.xml
diff --git a/test-workload-generator/build.gradle b/test-workload-generator/build.gradle
deleted file mode 100644
index 1c1986ab6..000000000
--- a/test-workload-generator/build.gradle
+++ /dev/null
@@ -1,31 +0,0 @@
-apply plugin: 'application'
-apply plugin: 'eclipse'
-
-buildscript {
-  repositories {
-    maven {
-      url "https://plugins.gradle.org/m2/"
-    }
-  }
-}
-
-sourceCompatibility = "1.11"
-targetCompatibility = "1.11"
-
-dependencies {
-    compile project(':')
-    compile 'org.slf4j:slf4j-simple:1.6.1'
-        
-
-    // Use JUnit test framework
-    testCompile 'junit:junit:4.12'
-}
-
-mainClassName = "test.Main"
-
-eclipse {
-    classpath {
-       downloadSources=true
-       downloadJavadoc=true
-    }
-}
diff --git a/test-workload-generator/docker-compose.yml b/test-workload-generator/docker-compose.yml
deleted file mode 100644
index b34f9239f..000000000
--- a/test-workload-generator/docker-compose.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-version: '3.1'
-
-services:
-  version: '3.1'
-
-services:
-  zookeeper:
-    image: zookeeper
-    ports:
-      - "2181:2181"
-  kafka:
-    image: wurstmeister/kafka
-    ports:
-      - "9092:9092"
-    environment:
-      KAFKA_ADVERTISED_HOST_NAME: localhost # Replace with docker network
-      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
-      KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 30000
-      KAFKA_CREATE_TOPICS: "input:3:1"
-
diff --git a/test-workload-generator/src/main/java/test/Main.java b/test-workload-generator/src/main/java/test/Main.java
deleted file mode 100644
index 65ed8e874..000000000
--- a/test-workload-generator/src/main/java/test/Main.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package test;
-
-import common.dimensions.Duration;
-import common.dimensions.KeySpace;
-import common.dimensions.Period;
-import common.generators.KafkaWorkloadGenerator;
-import common.generators.KafkaWorkloadGeneratorBuilder;
-import common.messages.OutputMessage;
-import common.misc.ZooKeeper;
-import communication.kafka.KafkaRecordSender;
-import java.util.concurrent.TimeUnit;
-import kieker.common.record.IMonitoringRecord;
-import titan.ccp.models.records.ActivePowerRecord;
-
-public class Main {
-
-  public static void main(final String[] args) {
-
-    final KafkaRecordSender<IMonitoringRecord> recordSender =
-        new KafkaRecordSender<>("localhost:9092", "input");
-
-    final KafkaWorkloadGenerator<IMonitoringRecord> generator =
-        KafkaWorkloadGeneratorBuilder.builder()
-            .setZooKeeper(new ZooKeeper("127.0.0.1", 2181))
-            .setKafkaRecordSender(recordSender)
-            .setBeforeAction(() -> {
-              System.out.println("Before Hook");
-            })
-            .setKeySpace(new KeySpace(5))
-            .setPeriod(new Period(1000, TimeUnit.MILLISECONDS))
-            .setDuration(new Duration(60, TimeUnit.SECONDS))
-            .setGeneratorFunction(
-                key -> new OutputMessage<>(key,
-                    new ActivePowerRecord(key, 0L, 100d)))
-            .build();
-
-    generator.start();
-  }
-
-}
diff --git a/uc2-workload-generator/src/main/java/spesb/uc2/workloadgenerator/LoadGenerator.java b/uc2-workload-generator/src/main/java/spesb/uc2/workloadgenerator/LoadGenerator.java
index 21e5216a3..46ff2890c 100644
--- a/uc2-workload-generator/src/main/java/spesb/uc2/workloadgenerator/LoadGenerator.java
+++ b/uc2-workload-generator/src/main/java/spesb/uc2/workloadgenerator/LoadGenerator.java
@@ -78,16 +78,16 @@ public class LoadGenerator {
                     new ConfigPublisher(kafkaBootstrapServers, "configuration");
                 configPublisher.publish(Event.SENSOR_REGISTRY_CHANGED, sensorRegistry.toJson());
                 configPublisher.close();
-                System.out.println("Configuration sent.");
+                LOGGER.info("Configuration sent.");
 
-                System.out.println("Now wait 30 seconds");
+                LOGGER.info("Now wait 30 seconds");
                 try {
                   Thread.sleep(30_000);
                 } catch (final InterruptedException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                 }
-                System.out.println("And woke up again :)");
+                LOGGER.info("And woke up again :)");
               }
             })
             .setGeneratorFunction(
diff --git a/uc3-workload-generator/src/main/java/spesb/uc3/workloadgenerator/LoadGenerator.java b/uc3-workload-generator/src/main/java/spesb/uc3/workloadgenerator/LoadGenerator.java
index 1be92e61e..74bd38b28 100644
--- a/uc3-workload-generator/src/main/java/spesb/uc3/workloadgenerator/LoadGenerator.java
+++ b/uc3-workload-generator/src/main/java/spesb/uc3/workloadgenerator/LoadGenerator.java
@@ -20,9 +20,8 @@ public class LoadGenerator {
 
   private static final Logger LOGGER = LoggerFactory.getLogger(LoadGenerator.class);
 
-  private static final int WL_MAX_RECORDS = 150_000;
-
   public static void main(final String[] args) throws InterruptedException, IOException {
+    // uc2
     LOGGER.info("Start workload generator for use case UC3.");
 
     // get environment variables
diff --git a/workload-generator-common/src/main/java/common/dimensions/Dimension.java b/workload-generator-common/src/main/java/common/dimensions/Dimension.java
deleted file mode 100644
index 9869a5a44..000000000
--- a/workload-generator-common/src/main/java/common/dimensions/Dimension.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package common.dimensions;
-
-/*
- * Base class for workload dimensions.
- */
-public abstract class Dimension {
-
-}
diff --git a/workload-generator-common/src/main/java/common/dimensions/Duration.java b/workload-generator-common/src/main/java/common/dimensions/Duration.java
index 519293c27..7fac08ae1 100644
--- a/workload-generator-common/src/main/java/common/dimensions/Duration.java
+++ b/workload-generator-common/src/main/java/common/dimensions/Duration.java
@@ -6,7 +6,7 @@ import common.generators.WorkloadGenerator;
 /**
  * Wrapper class for the definition of the duration for the {@link WorkloadGenerator}.
  */
-public class Duration extends Dimension {
+public class Duration {
 
   private final int duration;
   private final TimeUnit timeUnit;
diff --git a/workload-generator-common/src/main/java/common/dimensions/KeySpace.java b/workload-generator-common/src/main/java/common/dimensions/KeySpace.java
index c91e54223..20bcc964b 100644
--- a/workload-generator-common/src/main/java/common/dimensions/KeySpace.java
+++ b/workload-generator-common/src/main/java/common/dimensions/KeySpace.java
@@ -6,7 +6,7 @@ import common.generators.WorkloadGenerator;
  * Wrapper class for the definition of the Keys that should be used by the
  * {@link WorkloadGenerator}.
  */
-public class KeySpace extends Dimension {
+public class KeySpace {
 
   private final String prefix;
   private final int min;
diff --git a/workload-generator-common/src/main/java/common/dimensions/Period.java b/workload-generator-common/src/main/java/common/dimensions/Period.java
index 0aa129fd0..0ba24f798 100644
--- a/workload-generator-common/src/main/java/common/dimensions/Period.java
+++ b/workload-generator-common/src/main/java/common/dimensions/Period.java
@@ -6,7 +6,7 @@ import common.generators.WorkloadGenerator;
 /**
  * Wrapper class for the definition of period to use for the {@link WorkloadGenerator}.
  */
-public class Period extends Dimension {
+public class Period {
 
   private final int period;
   private final TimeUnit timeUnit;
diff --git a/workload-generator-common/src/main/java/common/generators/KafkaWorkloadGeneratorBuilder.java b/workload-generator-common/src/main/java/common/generators/KafkaWorkloadGeneratorBuilder.java
index d6ce8894a..db58f4959 100644
--- a/workload-generator-common/src/main/java/common/generators/KafkaWorkloadGeneratorBuilder.java
+++ b/workload-generator-common/src/main/java/common/generators/KafkaWorkloadGeneratorBuilder.java
@@ -41,6 +41,12 @@ public class KafkaWorkloadGeneratorBuilder<T extends IMonitoringRecord> {
     return new KafkaWorkloadGeneratorBuilder<>();
   }
 
+  /**
+   * Set the ZooKeeper reference.
+   *
+   * @param zooKeeper a reference to the ZooKeeper instance.
+   * @return the builder.
+   */
   public KafkaWorkloadGeneratorBuilder<T> setZooKeeper(final ZooKeeper zooKeeper) {
     this.zooKeeper = zooKeeper;
     return this;
@@ -129,6 +135,7 @@ public class KafkaWorkloadGeneratorBuilder<T extends IMonitoringRecord> {
    * Build the actual {@link KafkaWorkloadGenerator}. The following parameters are must be
    * specicified before this method is called:
    * <ul>
+   * <li>zookeeper</li>
    * <li>key space</li>
    * <li>period</li>
    * <li>duration</li>
diff --git a/workload-generator-common/src/main/java/common/generators/WorkloadGenerator.java b/workload-generator-common/src/main/java/common/generators/WorkloadGenerator.java
index 832e31d22..452ca49af 100644
--- a/workload-generator-common/src/main/java/common/generators/WorkloadGenerator.java
+++ b/workload-generator-common/src/main/java/common/generators/WorkloadGenerator.java
@@ -78,13 +78,13 @@ public abstract class WorkloadGenerator<T extends IMonitoringRecord> implements
     this.duration = duration;
     this.beforeAction = beforeAction;
     this.generatorFunction = generatorFunction;
-    this.workloadSelector = (workloadDeclaration, worker) -> {
+    this.workloadSelector = (workloadDefinition, worker) -> {
       final List<WorkloadEntity<T>> workloadEntities = new LinkedList<>();
 
       for (int i =
-          workloadDeclaration.getKeySpace().getMin() + worker.getId(); i <= workloadDeclaration
-              .getKeySpace().getMax(); i += workloadDeclaration.getNumberOfWorkers()) {
-        final String id = workloadDeclaration.getKeySpace().getPrefix() + i;
+          workloadDefinition.getKeySpace().getMin() + worker.getId(); i <= workloadDefinition
+              .getKeySpace().getMax(); i += workloadDefinition.getNumberOfWorkers()) {
+        final String id = workloadDefinition.getKeySpace().getPrefix() + i;
         workloadEntities.add(new WorkloadEntity<>(id, this.generatorFunction));
       }
 
@@ -103,6 +103,7 @@ public abstract class WorkloadGenerator<T extends IMonitoringRecord> implements
 
       LOGGER.info("Beginning of Experiment...");
       LOGGER.info("Experiment is going to be executed for the specified duration...");
+
       entities.forEach(entity -> {
         final T message = entity.generateMessage();
         final long initialDelay = random.nextInt(periodMs);
diff --git a/workload-generator-common/src/main/java/common/misc/WorkloadEntity.java b/workload-generator-common/src/main/java/common/misc/WorkloadEntity.java
index c0133022c..b31982d51 100644
--- a/workload-generator-common/src/main/java/common/misc/WorkloadEntity.java
+++ b/workload-generator-common/src/main/java/common/misc/WorkloadEntity.java
@@ -3,6 +3,9 @@ package common.misc;
 import common.functions.MessageGenerator;
 import kieker.common.record.IMonitoringRecord;
 
+/*
+ * Representation of a entity of the workload generation that generates load for one fixed key.
+ */
 public class WorkloadEntity<T extends IMonitoringRecord> {
   private final String key;
   private final MessageGenerator<T> generator;
diff --git a/workload-generator-common/src/main/java/communication/zookeeper/WorkloadDistributor.java b/workload-generator-common/src/main/java/communication/zookeeper/WorkloadDistributor.java
index 8701877f7..f81ac94f7 100644
--- a/workload-generator-common/src/main/java/communication/zookeeper/WorkloadDistributor.java
+++ b/workload-generator-common/src/main/java/communication/zookeeper/WorkloadDistributor.java
@@ -106,11 +106,11 @@ public class WorkloadDistributor {
 
         LOGGER.info("Number of Workers: {}", numberOfWorkers);
 
-        final WorkloadDefinition declaration =
+        final WorkloadDefinition definition =
             new WorkloadDefinition(this.keySpace, numberOfWorkers);
 
         this.client.create().withMode(CreateMode.EPHEMERAL).forPath(WORKLOAD_DEFINITION_PATH,
-            declaration.toString().getBytes(StandardCharsets.UTF_8));
+            definition.toString().getBytes(StandardCharsets.UTF_8));
 
       } else {
         LOGGER.info("This instance is worker with id {}", worker.getId());
@@ -118,7 +118,7 @@ public class WorkloadDistributor {
         this.client.getChildren().usingWatcher(watcher).forPath(WORKLOAD_PATH);
       }
 
-      Thread.sleep(20000); // wait until the workload declaration is retrieved
+      Thread.sleep(20000); // wait until the workload definition is retrieved
     } catch (final Exception e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
@@ -139,16 +139,16 @@ public class WorkloadDistributor {
         if (event.getType() == EventType.NodeChildrenChanged) {
           final byte[] bytes =
               WorkloadDistributor.this.client.getData().forPath(WORKLOAD_DEFINITION_PATH);
-          final WorkloadDefinition declaration =
+          final WorkloadDefinition definition =
               WorkloadDefinition.fromString(new String(bytes, StandardCharsets.UTF_8));
 
-          if (worker.getId() > declaration.getNumberOfWorkers() - 1) {
+          if (worker.getId() > definition.getNumberOfWorkers() - 1) {
             LOGGER.warn("Worker with id {} was to slow and is therefore in idle state",
                 worker.getId());
             WorkloadDistributor.this.workerAction.accept(new WorkloadDefinition(new KeySpace(0), 0),
                 worker); // this worker generates no workload
           } else {
-            WorkloadDistributor.this.workerAction.accept(declaration, worker);
+            WorkloadDistributor.this.workerAction.accept(definition, worker);
           }
         }
       }
-- 
GitLab