void beginLoadSnapshot(OffsetAndEpoch snapshotId) {
        if (currentSnapshotId != null) {
            throw new RuntimeException("Can't begin reading snapshot for " + snapshotId +
                    ", because we are already reading " + currentSnapshotId);
        }
        this.currentSnapshotId = snapshotId;
        this.currentSnapshotName = Snapshots.filenameFromSnapshotId(snapshotId);
        log.info("Starting to load snapshot {}. Previous lastCommittedOffset was {}. Previous " +
                "transactionStartOffset was {}.", currentSnapshotName, lastCommittedOffset,
                transactionStartOffset);
        this.snapshotRegistry.reset();
        this.lastCommittedOffset = -1L;
        this.lastCommittedEpoch = -1;
        this.lastStableOffset = -1L;
        this.transactionStartOffset = -1L;
        this.nextWriteOffset = -1L;
    }
Called before we load a Raft snapshot.

@param snapshotId The Raft snapshot offset and epoch.
metadata/src/main/java/org/apache/kafka/controller/OffsetControlManager.java