Merge branch 'rebalance-listener' into stored-state
[demos/kafka/training] / src / main / java / de / juplo / kafka / StatisticsDocument.java
index 9318c4c..be998ca 100644 (file)
@@ -14,26 +14,15 @@ public class StatisticsDocument
 {
   @Id
   public String id;
-  public String topic;
-  public Integer partition;
-  public Map<String, Long> statistics;
+  public Map<String, Integer> statistics;
 
   public StatisticsDocument()
   {
   }
 
-  public StatisticsDocument(String topic, Integer partition, Map<String, Long> statistics)
+  public StatisticsDocument(Integer partition, Map<String, Integer> statistics)
   {
-    this.partition = partition;
+    this.id = Integer.toString(partition);
     this.statistics = statistics;
   }
-
-  public StatisticsDocument(PartitionStatistics statistics)
-  {
-    this.topic = statistics.getPartition().topic();
-    this.id = statistics.toString();
-    this.partition = statistics.getPartition().partition();
-    this.statistics = new HashMap<>();
-    statistics.getStatistics().forEach(counter -> this.statistics.put(counter.getKey(), counter.getResult()));
-  }
 }