@Override
    public BatchAndType next() {
        FileChannelRecordBatch input = batchIterator.next();
        if (input.isControlBatch()) {
            return nextControlBatch(input);
        } else {
            return nextDataBatch(input);
        }
    }
Reads a log file containing KRaft record batches.
metadata/src/main/java/org/apache/kafka/metadata/util/BatchFileReader.java