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
startis assigned there. This type only decides “may this request proceed, and is it well-formed?”. - SeqGrant
- A contiguous block of
countdense ordinals for one key, starting atstart, issued under one leadershipepoch. Covers[start, start + count). - SeqKey
- A validated sequence key: non-empty, valid UTF-8 (guaranteed by
String), and at mostMAX_SEQ_KEY_LENbytes.try_newis 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 oneGetSeqBatchrequest. A soft anti-abuse guardrail bounding fan-out and the size of one atomic consensus entry; operators tune it viaServerBuilder::max_seq_batch_keys. - DEFAULT_
MAX_ SEQ_ COUNT - Default per-call ceiling on
GetSeq’scount— 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.