- if (lastCommit.plus(commitInterval).isBefore(clock.instant()))
- {
- log.debug("Storing data, last commit: {}", lastCommit);
- recordHandler.getState().forEach((partiton, adder) -> stateRepository.save(
+ partitions
+ .stream()
+ .forEach(partition ->
+ {
+ log.info("{} - persisting state & offset for partition: {}", id, partition);
+ ApplicationState state = recordHandler.getState(partition);
+ log.info(
+ "{} - offset of next unseen message for partition {} is {}",
+ id,
+ partition,
+ state.getOffset());
+ for (String user : state.getAdderState().keySet())
+ {
+ log.info(
+ "{} - Saved state for partition={}|user={}: {}",
+ id,
+ partition,
+ user,
+ state.getAdderState().get(user));
+ }
+ Map<String, List<AdderResult>> results = adderResults.getState(partition);
+ stateRepository.save(