pub struct LogConfig {
pub segment_bytes: u64,
pub segment_ms: Duration,
pub retention_ms: Option<Duration>,
pub retention_bytes: Option<u64>,
pub index_interval_bytes: u32,
pub flush_on_append: bool,
pub validate_on_open: bool,
pub cleanup_policy: CleanupPolicy,
pub compression_type: Option<CompressionType>,
pub remote_storage_enable: bool,
pub local_retention_ms: Option<Duration>,
pub local_retention_bytes: Option<u64>,
}Expand description
Fields§
§segment_bytes: u64Roll the active segment when it exceeds this many bytes. Kafka default: 1 GiB.
segment_ms: DurationRoll the active segment when its first record is older than this. Kafka default: 7 days.
retention_ms: Option<Duration>Delete sealed segments older than this. None = unlimited. Kafka default: 7 days.
retention_bytes: Option<u64>Delete oldest sealed segments until the total .log size fits. None = unlimited.
index_interval_bytes: u32Write one .index/.timeindex entry per N bytes of .log. Kafka default: 4 KiB.
flush_on_append: boolfsync after every append. Default off; broker manages fsync separately.
validate_on_open: boolOn open, CRC every batch in the active segment from the last index entry to EOF.
cleanup_policy: CleanupPolicyCleanup policy. Defaults to Delete. See CleanupPolicy.
compression_type: Option<CompressionType>Broker-side recompression target. None is Kafka’s
compression.type=producer (pass-through — store the batch
exactly as the producer sent it). Some(c) forces every batch
the broker accepts on this partition to be re-encoded to c
before write. Matches Kafka’s per-topic compression.type
config: gzip / snappy / lz4 / zstd / uncompressed map
to Some(_); producer (the default) maps to None.
remote_storage_enable: boolWhen true, this partition’s sealed segments (KIP-405)
are eligible to be copied to the remote tier by the broker’s
RemoteLogManager. Maps to Kafka’s per-topic remote.storage.enable.
Default false (Kafka’s default — tiered storage is opt-in per topic).
local_retention_ms: Option<Duration>Local-disk time-retention window for tiered
partitions (KIP-405). None inherits retention_ms. Default None.
local_retention_bytes: Option<u64>Local-disk size budget for tiered partitions (KIP-405).
None inherits retention_bytes. Default None.