@Test public void shouldSerdeWithEvent() { SnapshotTriggeringEvents ste = new SnapshotTriggeringEvents(); ste.add(a_1_99); String json = JSonMapper.toJson(ste); System.out.println("Json=" + json); SnapshotTriggeringEvents ste2 = JSonMapper.fromJson(json, SnapshotTriggeringEvents.class); System.out.println("ste2=" + ste2); }
public void add(String triggeringEvent) { DecodedEtopContext etpo = EtopEventContext.decode(triggeringEvent).get(); Map<Integer, Long> pos = topicsToPartitionsAndOffsets.get(etpo.topic); if (pos == null) { topicsToPartitionsAndOffsets.put(etpo.topic, new HashMap<>(Collections.singletonMap(etpo.partition, etpo.offset))); } else { Long maxOffset = pos.get(etpo.partition); if (maxOffset == null || etpo.offset > maxOffset) { pos.put(etpo.partition, etpo.offset); } } }
SnapshotTriggeringEvents { public void add(String triggeringEvent) { DecodedEtopContext etpo = EtopEventContext.decode(triggeringEvent).get(); Map<Integer, Long> pos = topicsToPartitionsAndOffsets.get(etpo.topic); if (pos == null) { topicsToPartitionsAndOffsets.put(etpo.topic, new HashMap<>(Collections.singletonMap(etpo.partition, etpo.offset))); } else { Long maxOffset = pos.get(etpo.partition); if (maxOffset == null || etpo.offset > maxOffset) { pos.put(etpo.partition, etpo.offset); } } } }
SnapshotTriggeringEvents { public void add(String triggeringEvent) { DecodedEtopContext etpo = EtopEventContext.decode(triggeringEvent).get(); Map<Integer, Long> pos = topicsToPartitionsAndOffsets.get(etpo.topic); if (pos == null) { topicsToPartitionsAndOffsets.put(etpo.topic, new HashMap<>(Collections.singletonMap(etpo.partition, etpo.offset))); } else { Long maxOffset = pos.get(etpo.partition); if (maxOffset == null || etpo.offset > maxOffset) { pos.put(etpo.partition, etpo.offset); } } }  }
SnapshotTriggeringEvents { public void add(String triggeringEvent) { DecodedEtopContext etpo = EtopEventContext.decode(triggeringEvent).get(); Map<Integer, Long> pos = topicsToPartitionsAndOffsets.get(etpo.topic); if (pos == null) { topicsToPartitionsAndOffsets.put(etpo.topic, new HashMap<>(Collections.singletonMap(etpo.partition, etpo.offset))); } else { Long maxOffset = pos.get(etpo.partition); if (maxOffset == null || etpo.offset > maxOffset) { pos.put(etpo.partition, etpo.offset); } } }  Map<String, Map<Integer, Long>> getTopicsToPartitionsAndOffsets(); void setTopicsToPartitionsAndOffsets(Map<String, Map<Integer, Long>> topicsToPartitionsAndOffsets); void checkForDuplicateEvent(DecodedEtopContext etpo); void add(String triggeringEvent); boolean isEmpty(); static void checkSnapshotForDuplicateEvent(LoadedSnapshot ss, EventContext te); static String snapshotTriggeringEvents(Optional<LoadedSnapshot> previousSnapshot, List<EventAndTrigger> events, Optional<EventContext> eventContext); static SnapshotTriggeringEvents getSnapshotTriggeringEvents(Optional<LoadedSnapshot> previousSnapshot, List<EventAndTrigger> events, Optional<EventContext> eventContext); }
SnapshotTriggeringEvents { public void add(String triggeringEvent) { DecodedEtopContext etpo = EtopEventContext.decode(triggeringEvent).get(); Map<Integer, Long> pos = topicsToPartitionsAndOffsets.get(etpo.topic); if (pos == null) { topicsToPartitionsAndOffsets.put(etpo.topic, new HashMap<>(Collections.singletonMap(etpo.partition, etpo.offset))); } else { Long maxOffset = pos.get(etpo.partition); if (maxOffset == null || etpo.offset > maxOffset) { pos.put(etpo.partition, etpo.offset); } } }  Map<String, Map<Integer, Long>> getTopicsToPartitionsAndOffsets(); void setTopicsToPartitionsAndOffsets(Map<String, Map<Integer, Long>> topicsToPartitionsAndOffsets); void checkForDuplicateEvent(DecodedEtopContext etpo); void add(String triggeringEvent); boolean isEmpty(); static void checkSnapshotForDuplicateEvent(LoadedSnapshot ss, EventContext te); static String snapshotTriggeringEvents(Optional<LoadedSnapshot> previousSnapshot, List<EventAndTrigger> events, Optional<EventContext> eventContext); static SnapshotTriggeringEvents getSnapshotTriggeringEvents(Optional<LoadedSnapshot> previousSnapshot, List<EventAndTrigger> events, Optional<EventContext> eventContext);  }