Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Record = Record {
- attributes :: !Word8
- timestampDelta :: !Int64
- offsetDelta :: !Int64
- key :: !Bytes
- value :: !Bytes
- headers :: !(SmallArray Header)
- data Header = Header {}
- decodeArray :: Bytes -> Maybe (SmallArray Record)
- decodeArrayAbsolute :: Int64 -> Int64 -> Bytes -> Maybe (SmallArray Record)
Documentation
Information about Record
from Kafka documentation:
length: varint attributes: int8 bit 0~7: unused timestampDelta: varlong offsetDelta: varint keyLength: varint key: byte[] valueLen: varint value: byte[] Headers => [Header]
Record | |
|
Information about Header
from Kafka documentation:
headerKeyLength: varint headerKey: String headerValueLength: varint value: byte[]
Decode
Relative Offsets
decodeArray :: Bytes -> Maybe (SmallArray Record) Source #
This consumes the entire input. If it succeeds, there were no leftovers.
Decode
Absolute Offsets
:: Int64 | Base timestamp (from record batch) |
-> Int64 | Base offset (from record batch) |
-> Bytes | |
-> Maybe (SmallArray Record) |
Variant of decodeArray
that converts the timestamp and offset
deltas to absolute timestamps and offsets. In the resulting records,
the fields $sel:timestampDelta:Record
and $sel:offsetDelta:Record
are misnomers.