Expand description
Spill strategies and policies for MergeQueue entries under memory pressure.
Three traits compose here:
SpillPolicydecides whether and how a queue should be reshaped at eachextend. It is handed the rawVecDeque<QueueEntry>under the queue’s mutex and may replace entries freely.BytesSpilldecides where bytes go when a policy chooses to spill. Pluggable: file, object store, mlock pool, in-memory mock for tests.BytesFetchis the handle returned by aBytesSpill; it reads the spilled bytes back, consuming itself in the process.
The shipped threshold::Threshold pairs a BytesSpill strategy with
threshold/reserve/budget knobs and encodes the “spill the middle of the
queue when resident bytes get too large” heuristic. Other policies can
make entirely different decisions (memory-pressure-driven, periodic,
manual trigger, adaptive) using the same strategies.
Re-exports§
pub use threshold::Threshold;pub use prefetch::PrefetchPolicy;
Modules§
- prefetch
- Reader-side policy: materializes
Pagedentries near the front. - threshold
- Writer-side spill policy: threshold-based, spills the middle of the queue.
Traits§
- Bytes
Fetch - A consume-once handle to bytes previously written via a
BytesSpill. - Bytes
Spill - A type that can convert runs of bytes into runs of boxed bytes retrieval.
- Spill
Policy - Inspects and optionally rewrites a
MergeQueue’s entries.
Type Aliases§
- Spill
Policy Fn - A function that produces pairs of writer and reader
SpillPolicys.