Module kpro_batch

Data Types

batch_input()

batch_input() = kpro:batch_input()

batch_meta()

batch_meta() = kpro:batch_meta()

compress_option()

compress_option() = kpro:compress_option()

magic()

magic() = kpro:magic()

message()

message() = kpro:message()

seqno()

seqno() = kpro:seqno()

txn_ctx()

txn_ctx() = kpro:txn_ctx()

Function Index

decode/1Decode received message-set into a batch list.
encode/3Encode a list of batch inputs into byte stream.
encode_tx/4Encode a batch of magic version 2.
is_control/1Return true if it is a control batch.

Function Details

decode/1

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/3

encode(MagicVsn::magic(), Batch::batch_input(), Compression::compress_option()) -> iodata()

Encode a list of batch inputs into byte stream.

encode_tx/4

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/1

is_control(X1::batch_meta()) -> boolean()

Return true if it is a control batch.


Generated by EDoc