Merge branch 'stored-state' into stored-offsets
[demos/kafka/training] / src / main / java / de / juplo / kafka / StatisticsDocument.java
index be998ca..96ebfb1 100644 (file)
@@ -14,15 +14,23 @@ public class StatisticsDocument
 {
   @Id
   public String id;
+  public long offset;
   public Map<String, Integer> statistics;
 
   public StatisticsDocument()
   {
   }
 
-  public StatisticsDocument(Integer partition, Map<String, Integer> statistics)
+  public StatisticsDocument(Integer partition)
+  {
+    this.id = Integer.toString(partition);
+    this.statistics = new HashMap<>();
+  }
+
+  public StatisticsDocument(Integer partition, Map<String, Integer> statistics, long offset)
   {
     this.id = Integer.toString(partition);
     this.statistics = statistics;
+    this.offset = offset;
   }
 }