Skip to main content

producer_snapshot_strays

Function producer_snapshot_strays 

Source
pub fn producer_snapshot_strays(
    snapshots: &[i64],
    segment_bases: &[i64],
) -> Vec<bool>
Expand description

Classify all producer snapshots using their on-disk offset order.

This is the ordered, bulk form of producer_snapshot_stray. Both input slices must be sorted in nondecreasing order. The returned value at each index is true exactly when Kafka removes that snapshot. A single cursor through segment_bases is shared by every snapshot, so each input element is visited at most once; the greatest base is read once for Kafka’s clean-shutdown exception.

Kafka retains the newest snapshot even when it is not a segment base when it lies above every segment base. Empty segment lists therefore retain only the newest snapshot.