SuperCache.Cluster.Raft.Config (SuperCache v1.7.0)

Copy Markdown View Source

Configuration defaults and validation for the opt-in :raft replication mode.

All settings are optional and live under config :super_cache, :raft:

config :super_cache, :raft,
  data_dir: "/var/lib/my_app/super_cache_raft",
  command_timeout_ms: 2_000,
  wal_sync_method: :datasync,
  wal_max_size_bytes: 256_000_000

The default data_dir is a per-node directory in the system temp dir; deployments that need durable Raft logs across restarts should set it explicitly.

Summary

Functions

Return all Raft settings with application config overrides applied.

Return the default configuration keyword list.

Return a single Raft setting.

Forget the memoized default data directory (used by tests).

Validate the configured settings, raising ArgumentError on invalid values.

Functions

all()

@spec all() :: keyword()

Return all Raft settings with application config overrides applied.

defaults()

@spec defaults() :: keyword()

Return the default configuration keyword list.

get(key)

@spec get(atom()) :: term()

Return a single Raft setting.

reset()

@spec reset() :: :ok

Forget the memoized default data directory (used by tests).

validate!()

@spec validate!() :: :ok

Validate the configured settings, raising ArgumentError on invalid values.

Bootstrap calls this before starting any Raft group so a bad configuration fails on startup rather than on the first write.