I am trying to parse the complete log file, but for some reason the last record batch seems to be out-of-place. I’ve considered Varints wherever mentioned as per the spec and my data for the first 4 Record batches seems to align. Based on the log, I see it has the following structure:
Record Batch 1:
- Feature Level Record
Record Batch 2:
- Topic Record
- Partition Record
Record Batch 3:
- Topic Record
- Partition Record
Record Batch 4:
- Topic Record
- Partition Record
- Partition Record
Since the test checks for a single topic with multiple partitions, I would be able to pass the test if I stopped parsing. But I am choosing to parse the log completely, I am not sure if the following RecordBatch 5 is being parsed as expected. Here’s the dump of the last RecordBatch 5 which seems to be incorrect to me but maybe that’s what is expected:
remote: [your_program] RecordBatch
remote: [your_program] Base Offset: 432345564227567616
remote: [your_program] Batch Length: -469762048
remote: [your_program] Partition Leader Epoch: 16777216
remote: [your_program] Magic Byte: 00000010
remote: [your_program] CRC: -607245691
remote: [your_program] Attributes: 0
remote: [your_program] Last Offset Delta: 33554432
remote: [your_program] Base Timestamp: 1525976868812029952
remote: [your_program] Max Timestamp: 1525976868812029952
remote: [your_program] Producer ID: -1
remote: [your_program] Producer Epoch: -1
remote: [your_program] Base Sequence: -1
remote: [your_program] Records Length: 50331648