public static FileRawSnapshotReader open(Path logDir, OffsetAndEpoch snapshotId) {
        FileRecords fileRecords;
        Path filePath = Snapshots.snapshotPath(logDir, snapshotId);
        try {
            fileRecords = FileRecords.open(
                filePath.toFile(),
                false, // mutable
                true, // fileAlreadyExists
                0, // initFileSize
                false // preallocate
            );
        } catch (IOException e) {
            throw new UncheckedIOException(
                String.format("Unable to Opens a snapshot file %s", filePath.toAbsolutePath()), e
            );
        }

        return new FileRawSnapshotReader(fileRecords, snapshotId);
    }
Opens a snapshot for reading.

@param logDir the directory for the topic partition
@param snapshotId the end offset and epoch for the snapshotId
raft/src/main/java/org/apache/kafka/snapshot/FileRawSnapshotReader.java