Skip to main content

Module prefix

Module prefix 

Source
Expand description

Prefix-aware lookup index used by the router.

Each chunk hash (32 bytes, BLAKE3 over TOKENS_PER_CHUNK token ids — see crate::hash) is mapped to the set of nodes that currently hold that chunk, with TTL and last-seen timestamps for staleness control.

The index is concurrent-safe and read-mostly. It is rebuilt incrementally from etcd / gossip events; the router queries it on every request to compute KV-overlap scores.

Structs§

NodeEntry
Per-node entry stored under each prefix.
PrefixIndex
Concurrent prefix → nodes index. The internal map is DashMap keyed by the 32-byte digest. Per-prefix node lists are guarded by a RwLock to avoid lock contention on hot keys.