crabka-log 0.3.5

Byte-compatible reader/writer for Apache Kafka's on-disk log format
Documentation

crabka-log

Crates.io Docs.rs CI

Byte-compatible reader/writer for Apache Kafka's on-disk log format.

This crate is part of Crabka, a Rust implementation of Kafka-compatible infrastructure and clients.

Install

crabka-log = "0.3.2"

For workspace development, use the path dependency from this repository instead.

Usage example

Open a Kafka-compatible log directory, append a batch, and read it back:

use crabka_log::{Log, LogConfig};
use crabka_protocol::records::RecordBatch;

# fn run() -> Result<(), Box<dyn std::error::Error>> {
let mut log = Log::open("./target/orders-0", LogConfig::default())?;
let mut batch = RecordBatch::default();
// Fill the RecordBatch with records before appending in production code.
let base_offset = log.append(&mut batch)?;
let bytes = log.read(base_offset, 1024 * 1024)?;
println!("read {} bytes", bytes.bytes.len());
# Ok(())
# }

Documentation

API documentation is published on docs.rs/crabka-log. The repository README contains project-wide setup, development, and release notes.

License

Apache-2.0. See the repository LICENSE and NOTICE files for details.