GenServer managing per-namespace commit-window configuration.
Stores namespace-specific window overrides in :ferricstore_ns_config.
Prefixes with no explicit override use a 1ms commit window.
Durability mode is intentionally not configurable. All writes use the quorum
path. A future acknowledgement policy such as ack=all should be added as a
separate feature, not by reviving the removed durability-mode switch.
ETS schema
{prefix, window_ms, changed_at, changed_by}Where:
prefix-- binary namespace prefix (e.g."rate","session")window_ms-- commit window in milliseconds (positive integer)changed_at-- Unix timestamp (seconds) of the last change, or0for defaultschanged_by-- identifier of the client that made the change (empty string for defaults)
Summary
Functions
Returns a specification to start this module under a supervisor.
Returns the default window_ms value.
Returns the configuration for a single namespace prefix.
Returns all explicitly configured namespace entries sorted by prefix.
Resets one namespace prefix to the default window.
Resets all namespace window overrides.
Sets a configuration field for the given namespace prefix.
Sets a configuration field and records caller identity for audit.
Starts the NamespaceConfig GenServer and creates the backing ETS table.
Returns the effective window_ms for a namespace prefix.
Types
@type field() :: :window_ms
Valid field names for set/3.
@type ns_entry() :: %{ prefix: binary(), window_ms: non_neg_integer(), changed_at: non_neg_integer(), changed_by: binary() }
A namespace configuration entry.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec default_window_ms() :: pos_integer()
Returns the default window_ms value.
Returns the configuration for a single namespace prefix.
@spec get_all() :: [ns_entry()]
Returns all explicitly configured namespace entries sorted by prefix.
@spec reset(binary()) :: :ok
Resets one namespace prefix to the default window.
@spec reset_all() :: :ok
Resets all namespace window overrides.
Sets a configuration field for the given namespace prefix.
Only window_ms is supported. Durability is not configurable.
Sets a configuration field and records caller identity for audit.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the NamespaceConfig GenServer and creates the backing ETS table.
@spec window_for(binary()) :: pos_integer()
Returns the effective window_ms for a namespace prefix.