Ferricstore.Commands.Namespace (ferricstore v0.4.0)

Copy Markdown View Source

Handles the FERRICSTORE.CONFIG command for namespace-aware configuration.

Provides three subcommands for managing per-namespace commit window timing:

Supported commands

  • FERRICSTORE.CONFIG SET prefix field value -- sets a namespace config field
  • FERRICSTORE.CONFIG GET [prefix] -- returns config for one or all namespaces
  • FERRICSTORE.CONFIG RESET [prefix] -- resets one or all namespaces to defaults

Fields

  • window_ms -- commit window in milliseconds (positive integer) Durability is not configurable; writes always use quorum.

Examples

FERRICSTORE.CONFIG SET rate window_ms 10
FERRICSTORE.CONFIG GET rate
FERRICSTORE.CONFIG GET
FERRICSTORE.CONFIG RESET rate
FERRICSTORE.CONFIG RESET

Summary

Functions

Handles a FERRICSTORE.CONFIG command.

4-arity variant that accepts conn_state for audit trail (changed_by).

Functions

handle(cmd, args, store)

@spec handle(binary(), [binary()], map()) :: term()

Handles a FERRICSTORE.CONFIG command.

Parameters

  • cmd -- the full uppercased command name ("FERRICSTORE.CONFIG")
  • args -- list of string arguments (subcommand + params)
  • _store -- injected store map (unused by namespace config commands)

Returns

Command-specific return values:

  • SET: :ok or {:error, reason}
  • GET: flat key-value list or {:error, reason}
  • RESET: :ok

handle(cmd, args, store, conn_state)

@spec handle(binary(), [binary()], map(), map()) :: term()

4-arity variant that accepts conn_state for audit trail (changed_by).

When conn_state contains a :client_id, it is recorded as "client:<id>" in the audit trail.