void endLoadSnapshot(long timestamp) {
        if (currentSnapshotId == null) {
            throw new RuntimeException("Can't end loading snapshot, because there is no " +
                    "current snapshot.");
        }
        log.info("Successfully loaded snapshot {}.", currentSnapshotName);
        this.snapshotRegistry.getOrCreateSnapshot(currentSnapshotId.offset());
        this.lastCommittedOffset = currentSnapshotId.offset();
        this.lastCommittedEpoch = currentSnapshotId.epoch();
        this.lastStableOffset = currentSnapshotId.offset();
        this.transactionStartOffset = -1L;
        this.nextWriteOffset = -1L;
        metrics.setLastCommittedRecordOffset(currentSnapshotId.offset());
        metrics.setLastAppliedRecordOffset(currentSnapshotId.offset());
        metrics.setLastAppliedRecordTimestamp(timestamp);
        this.currentSnapshotId = null;
        this.currentSnapshotName = null;
    }
Called after we have finished loading a Raft snapshot.

@param timestamp The timestamp of the snapshot.
metadata/src/main/java/org/apache/kafka/controller/OffsetControlManager.java