Expand description
Column-aware pager. Pages Column instances out via mz_ore::pager,
optionally compressing with lz4.
The pager (mz_ore::pager) deals in Vec<u64> blobs and two backends. This
module adds:
- A
PagingPolicytrait that decides whether to page out, which backend, and whether to compress. Decisions live in the policy implementation, not in the global atomic the pager exposes. - A
ColumnPagerthat drains aColumn<C>into aPagedColumnand rehydrates it on demand. - Lz4 frame-format compression as an optional codec.
The serialization uses the existing ContainerBytes protocol on
Column<C>, so we get a single byte layout that both raw and compressed
paths share. See doc/developer/design/20260504_pager.md for background.
Modules§
- metrics
- Prometheus metrics for the column pager.
- policy
- Concrete
PagingPolicyimplementations.
Structs§
- Always
Resident 🔒Policy - Policy that keeps every column resident and discards events. Backs
ColumnPager::disabled. - Column
Pager - Pages typed
Columns out and back in, driven by aPagingPolicy. - Meta
- Sizing metadata captured at pageout time. Stored alongside the payload so
takecan size buffers. - Page
Hint - Inputs to a pageout decision.
- Resident
Ticket - Drop guard that returns budget to a
PagingPolicywhen aPagedColumn::Residentis destroyed.
Enums§
- Codec
- Compression codec applied to a paged-out column.
- Compressed
Inner - Storage location for the lz4-framed bytes inside a compressed paged column.
- Page
Decision - Outcome of a policy decision.
- Page
Event - Notifications the column-pager sends back to the policy. Implementations typically forward to metrics counters.
- Paged
Column - A column whose body may be resident, paged out, or paged out and compressed.
Statics§
- GLOBAL_
PAGER 🔒 - Process-global active pager. Defaults to
ColumnPager::disableduntil worker init callsset_global_pager. - TIERED_
POLICY 🔒 - Process-wide
policy::TieredPolicysingleton.
Traits§
- Paging
Policy - Decides whether/how to page a column out, and records page events.
Functions§
- apply_
tiered_ config - Apply a tiered-pager configuration. Reuses the singleton
policy::TieredPolicyso in-flightResidentTickets remain coherent with the running budget after the operator tunes any of the inputs. - global_
pager - Returns the current global pager. Cheap: clones the inner
Arc<dyn PagingPolicy>. - pad_
u8_ 🔒to_ u64 - Reinterprets
bytesas aVec<u64>by trailing-zero padding to a multiple of 8 and copying. The lz4 frame trailer self-delimits so the trailing pad is invisible toFrameDecoder. - set_
global_ pager - Install
pageras the process-wide active pager. Subsequentglobal_pagercalls return a clone of this value across all threads. - tiered_
policy - Returns a reference to the process-wide
policy::TieredPolicysingleton.