Shared routing helpers used by all distributed high-level stores (KeyValue, Queue, Stack, Struct).
Write routing
Every write wraps its data in a tuple whose partition value is derived
from the store's namespace key (kv_name, queue_name, stack_name, or
struct_name). The tuple is handed to Router.route_put!/1 which
forwards it to the correct primary node if needed.
Read routing
Reads always go to the local ETS table (eventual consistency by default).
Pass read_mode: :primary where strong consistency is required.
Delete routing
Single-key deletes use Router.route_delete_by_key_partition!/2.
Pattern deletes use Router.route_delete_match!/2.
Summary
Functions
Read ets_key from the local partition for namespace.
insert_new on the local partition for namespace.
Match-object scan on the local partition for namespace.
take on the local partition for namespace.
Route a delete for ets_key whose partition is derived from namespace.
Route a pattern delete scoped to namespace.
Route a put for a record whose ETS key is ets_key and whose partition
is determined by namespace (the store name).
Functions
Read ets_key from the local partition for namespace.
insert_new on the local partition for namespace.
Match-object scan on the local partition for namespace.
take on the local partition for namespace.
Route a delete for ets_key whose partition is derived from namespace.
Route a pattern delete scoped to namespace.
Route a put for a record whose ETS key is ets_key and whose partition
is determined by namespace (the store name).
Builds the canonical two-element tuple {ets_key, value} and routes it.
The partition position is 0 (the key), so ets_key must embed the
namespace so that partition hashing is namespace-scoped.