Rückbau der Berücksichtigung von `auto.offset.rest`, wenn Offset unbekannt
[demos/kafka/training] / src / main / java / de / juplo / kafka / StateDocument.java
index 2583c8e..5c4ca22 100644 (file)
@@ -9,14 +9,15 @@ import java.util.List;
 import java.util.Map;
 
 
-@Document(collection = "statistics")
+@Document(collection = "state")
 @ToString
 public class StateDocument
 {
   @Id
   public String id;
-  public long offset = -1l;
-  public Map<String, Long> state;
+  public long offset = 0l;
+  public Map<String, AdderResult> state;
+  public Map<String, List<AdderResult>> results;
 
   public StateDocument()
   {
@@ -26,15 +27,18 @@ public class StateDocument
   {
     this.id = Integer.toString(partition);
     this.state = new HashMap<>();
+    this.results = new HashMap<>();
   }
 
   public StateDocument(
       Integer partition,
-      Map<String, Long> state,
+      Map<String, AdderResult> state,
+      Map<String, List<AdderResult>> results,
       long offset)
   {
     this.id = Integer.toString(partition);
     this.state = state;
+    this.results = results;
     this.offset = offset;
   }
 }