jsancio commented on a change in pull request #10085: URL: https://github.com/apache/kafka/pull/10085#discussion_r600926563
########## File path: raft/src/main/java/org/apache/kafka/raft/ReplicatedCounter.java ########## @@ -87,6 +96,25 @@ public synchronized void handleCommit(BatchReader<Integer> reader) { } } + @Override + public synchronized void handleSnapshot(SnapshotReader<Integer> reader) { + try { + try (SnapshotReader<Integer> snapshot = reader) { + log.debug("Loading snapshot {}", snapshot.snapshotId()); + for (List<Integer> batch : snapshot) { + for (Integer value : batch) { + log.debug("Setting value: {}", value); + this.committed = value; + this.uncommitted = value; + } + } + log.debug("Finished loading snapshot. Set value: {}", this.committed); + } + } catch (IOException e) { Review comment: I also changed a few places that were throwing `IOException` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org