@Override
    public void close() {
        try {
            fileRecords.closeHandlers();
        } catch (Exception e) {
            log.error("Error closing fileRecords", e);
        }
        this.batchIterator = Collections.emptyIterator();
    }
Reads a log file containing KRaft record batches.
metadata/src/main/java/org/apache/kafka/metadata/util/BatchFileReader.java