View Source kpro_compress (kafka_protocol v4.2.7)
Summary
Functions
Translate codec in kafka batch attributes to compression method.
Compress encoded batch.
Decompress batch.
Translate compression method to bits for kafka batch attributes.
Set snappy, lz4 or zstd compression modules. This should override the default usage of snappyer
, lz4b_frame
and ezstd
.
Functions
-spec codec_to_method(byte()) -> kpro:compress_option().
Translate codec in kafka batch attributes to compression method.
-spec compress(kpro:compress_option(), iodata()) -> iodata().
Compress encoded batch.
-spec decompress(kpro:compress_option(), binary()) -> binary().
Decompress batch.
Translate compression method to bits for kafka batch attributes.
-spec provide([{snappy | lz4 | zstd, module()}]) -> ok.
Set snappy, lz4 or zstd compression modules. This should override the default usage of snappyer
, lz4b_frame
and ezstd
.