3 ms·
One question about the index file, "in Kafka, the index uses 4 bytes for storing an offset relative to the base offset and 4 bytes for storing the log position.
by ww520 9y ago
One question about the index file, "in Kafka, the index uses 4 bytes for storing an offset relative to the base offset and 4 bytes for storing the log position." Isn't the relative offset to the base offset already pointing to the physical location of the message in the segment file? What's the purpose of the second 4-byte field log position?
- foota 9y agoI think that the offsets are both in terms of number of messages, whereas the log position is the byte in the file that the message occurs at.
- kungfooguru 9y agoRight, I think earlier Kafka it was actually the position as well, but then they moved to the current method.