Kayrock.RecordBatch (kayrock v1.0.0-rc1)

Copy Markdown View Source

Represents a batch of records (also called a record set)

This is the newer format in Kafka 0.11+

See https://kafka.apache.org/documentation/#recordbatch

Summary

Types

t()

@type t() :: %Kayrock.RecordBatch{
  attributes: term(),
  base_sequence: term(),
  batch_length: term(),
  batch_offset: term(),
  crc: term(),
  first_timestamp: term(),
  last_offset_delta: term(),
  max_timestamp: term(),
  partition_leader_epoch: term(),
  producer_epoch: term(),
  producer_id: term(),
  records: term()
}

Functions

deserialize(record_batch_data)

@spec deserialize(binary()) :: nil | Kayrock.MessageSet.t() | t()

Direct deserializer Supplied for compatibility with the Request protocol

deserialize(msg_set_size, msg_set_data)

@spec deserialize(integer(), binary()) :: nil | Kayrock.MessageSet.t() | t()

from_binary_list(messages, compression \\ :none)

@spec from_binary_list([binary()], atom()) :: t()

serialize(record_batch)

@spec serialize(t()) :: iodata()