Expand description
Priority-aware k-way merge. Each source carries an explicit
priority integer. On key tie, the highest-priority source wins.
Ties between equal priorities fall through to the source’s
registration order (higher source index breaks the tie - matches
the latest-source-wins shape used by dedup and tombstones).
This generalises dedup: pass (priority = source_index, ...) for
the same behaviour. The reason to reach for priority is when the
producer order on the wire doesn’t match the recency / authority
ordering you want (e.g. an in-memory memtable should beat every
on-disk SSTable level even though it was registered first).
Structs§
- Priority
Entry - Priority
Merge Iterator - Priority
Source - A source + the priority it carries. Higher
prioritywins on key ties. Equal-priority ties fall through to registration order (the index in thenew(...)argument list).