1 package de.juplo.kafka;
3 import java.util.HashMap;
4 import java.util.LinkedList;
9 public class AdderResults
11 private final Map<Integer, Map<String, List<AdderResult>>> results = new HashMap<>();
14 public void addResults(Integer partition, String user, AdderResult result)
16 Map<String, List<AdderResult>> resultsByUser = this.results.get(partition);
18 List<AdderResult> results = resultsByUser.get(user);
21 results = new LinkedList<>();
22 resultsByUser.put(user, results);
28 protected void addPartition(Integer partition, Map<String, List<AdderResult>> results)
30 this.results.put(partition, results);
33 protected Map<String, List<AdderResult>> removePartition(Integer partition)
35 return this.results.remove(partition);
38 public Map<Integer, Map<String, List<AdderResult>>> getState()
43 public Map<String, List<AdderResult>> getState(Integer partition)
45 return results.get(partition);