batch_input() = kpro:batch_input()
batch_meta() = kpro:batch_meta()
compress_option() = kpro:compress_option()
magic() = kpro:magic()
message() = kpro:message()
seqno() = kpro:seqno()
txn_ctx() = kpro:txn_ctx()
decode/1 | Decode received message-set into a batch list. |
encode/3 | Encode a list of batch inputs into byte stream. |
encode_tx/4 | Encode a batch of magic version 2. |
is_control/1 | Return true if it is a control batch. |
decode(Bin::binary()) -> [{batch_meta(), [message()]}]
Decode received message-set into a batch list.
Ensured by kpro:decode_batches/1
, the input binary should contain
at least one mssage.
encode(MagicVsn::magic(), Batch::batch_input(), Compression::compress_option()) -> binary()
Encode a list of batch inputs into byte stream.
encode_tx(Batch::batch_input(), Compression::compress_option(), FirstSequence::seqno(), X4::txn_ctx()) -> iodata()
Encode a batch of magic version 2. RecordBatch => FirstOffset => int64 Length => int32 PartitionLeaderEpoch => int32 # client set whatever Magic => int8 # The 17th byte as in v0 and v1 CRC => int32 Attributes => int16 LastOffsetDelta => int32 FirstTimestamp => int64 MaxTimestamp => int64 ProducerId => int64 ProducerEpoch => int16 FirstSequence => int32 Records => [Record]
is_control(X1::batch_meta()) -> boolean()
Return true if it is a control batch.
Generated by EDoc