Expand description
Pure window/unit planning for faucet backfill — boundary parsing, range
chunking (timezone/DST-correct), ${backfill.*} token substitution, and
the stable range hash the progress marker is keyed by. No I/O.
Structs§
- Backfill
Unit - One independent, resumable slice of the backfill range.
Constants§
- MAX_
UNITS - Hard ceiling on planned units — a tiny
--windowover a huge range is a config error, not a workload. - WARN_
UNITS - Above this many units a loud warning is emitted (but planning proceeds).
Functions§
- parse_
boundary - Parse a
--from/--toboundary: RFC3339 (2026-06-01T00:00:00Z) or a bare date (2026-06-01, interpreted as midnight intz). A date that falls in a DST gap resolves to the earliest valid instant. - parse_
window - Parse a
--windowduration:45s,30m,6h,1d,1w(or a bare integer = seconds). Must be positive. - plan_
windows - Chunk
[from, to)into contiguous half-open windows ofwindow(the last window truncated atto).window: None= the whole range as one unit. Window arithmetic is absolute (instants), so units never gap or overlap — including across DST transitions; boundaries are re-rendered intzso${now.*}tokens see local wall-clock time. - range_
hash - Deterministic 64-bit FNV-1a hash of the range descriptor, hex-encoded.
Keys the progress marker so
--resumefinds the same backfill across process restarts (std’sDefaultHasheris randomly seeded — unusable). - substitute_
unit_ tokens - Substitute
${backfill.*}tokens in every string leaf ofvalue:start/end(RFC3339),start_date/end_date(YYYY-MM-DD, local),start_unix/end_unix(epoch seconds),unit(the unit id). An unrecognized${backfill.*}token is a typo — typed error.