synchronized void addSnapshot(RawSnapshotReader newSnapshot) {
            if (newSnapshot.snapshotId().offset() - 1 > prevOffset) {
                log.error(
                    "Ignored attempt to add a snapshot {} that is greater than the latest offset {}",
                    newSnapshot,
                    prevOffset
                );
            } else {
                snapshots.put(newSnapshot.snapshotId().offset() - 1, newSnapshot);
                this.notifyAll();
            }
        }
Stores a new snapshot and notifies all threads waiting for a snapshot.
metadata/src/test/java/org/apache/kafka/metalog/LocalLogManager.java