Skip to main content

Module seq

Module seq 

Source
Expand description

Keyed dense sequence types: validated keys, contiguous grants, and the leadership/epoch gate. Pure and synchronous, no I/O — the same discipline as allocator.rs. Unlike Allocator, this holds NO per-key counter state: every counter lives in the durable layer and every block start is assigned there.

Structs§

SeqAllocator
Leadership/epoch gate plus request validation for the dense path. Holds NO per-key counter state — counters live in the durable layer and start is assigned there. This type only decides “may this request proceed, and is it well-formed?”.
SeqGrant
A contiguous block of count dense ordinals for one key, starting at start, issued under one leadership epoch. Covers [start, start + count).
SeqKey
A validated sequence key: non-empty, valid UTF-8 (guaranteed by String), and at most MAX_SEQ_KEY_LEN bytes. try_new is the single validation site — a value of this type is proof the key is in range.

Constants§

DEFAULT_MAX_SEQ_BATCH_KEYS
Default cap on the number of (key, count) entries in one GetSeqBatch request. A soft anti-abuse guardrail bounding fan-out and the size of one atomic consensus entry; operators tune it via ServerBuilder::max_seq_batch_keys.
DEFAULT_MAX_SEQ_COUNT
Default per-call ceiling on GetSeq’s count — the largest block a single request may reserve when the server has not overridden it.
MAX_SEQ_KEY_LEN
Maximum length, in bytes, of a sequence key’s UTF-8 encoding.