Skip to main content

Module batch

Module batch 

Source
Expand description

Record-batch v2 container.

Layout (after the 12-byte log overhead):

baseOffset (8) | batchLength (4)
  ─────── log overhead ────────
partitionLeaderEpoch (4) | magic (1) | crc (4)
  ─────── CRC-covered region ────────
    attributes (2) | lastOffsetDelta (4) | firstTimestamp (8)
    maxTimestamp (8) | producerId (8) | producerEpoch (2)
    baseSequence (4) | recordCount (4) | records[…]

Structs§

RecordBatch
A Kafka record batch (message format v2).

Enums§

TimestampType
Kafka timestamp type — derived from bit 3 of the batch attributes field.

Functions§

decode_batches
Decode every batch in a contiguous buffer.
decode_next_batch
Decode the next complete batch from buf, when one is present.