Skip to main content

Module conf

Module conf 

Source
Expand description

YAML configuration: schema, parsing, defaulting, validation.

The top-level YAML document is a single-key mapping from a pool name to a ConfPool. Config wraps both. The typical lifecycle is:

  1. Config::parse_str (or Config::parse_file) - parse YAML and apply structural checks.
  2. Config::finalize - apply defaults to fields that were left unset.
  3. Config::validate - run the full set of cross-field checks.

Config::test_conf is the convenience used by the -t flag of the server binary and runs finalize + validate and returns a short status string.

§Examples

use dynomite::conf::Config;

let yaml = r#"
dyn_o_mite:
  listen: 127.0.0.1:8102
  dyn_listen: 127.0.0.1:8101
  tokens: '101134286'
  servers:
  - 127.0.0.1:22122:1
  data_store: 0
  mbuf_size: 16384
  max_msgs: 300000
"#;

let mut cfg = Config::parse_str(yaml).unwrap();
cfg.finalize();
cfg.validate().unwrap();
assert_eq!(cfg.pool_name(), "dyn_o_mite");

Structs§

ConfBucketType
Routing-property bundle attached to a key bucket.
ConfDynSeed
A dyn_seeds: entry: a peer dynomite node with rack / dc / tokens.
ConfListen
A parsed listen: / dyn_listen: / stats_listen: endpoint.
ConfPool
Pool configuration body. One per top-level YAML pool name.
ConfRiak
Optional Riak-mode listener / AAE knobs.
ConfRiakWasmModule
One Wasm module entry inside a ConfRiak::wasm_modules list.
ConfServer
A servers: entry: a single backing datastore endpoint.
ConfTlsProfile
One per-DC TLS profile inside ConfPool::peer_tls_profiles.
Config
Top-level configuration value: a single named ConfPool.
ObservabilityConfig
Opt-in observability configuration.
Servers
Wrapper for the servers: field that enforces the invariant of “exactly one datastore” without losing the YAML list shape.
TokenComponent
One element of a comma-separated token list.
TokenList
A list of TokenComponents parsed from a comma-separated string.

Enums§

ConfError
Errors that can occur while loading or validating a Config.
ConsistencyLevel
Quorum policy for read or write paths.
DataStore
Datastore family selected by data_store:.
Distribution
Distribution algorithm selected by the pool’s distribution: directive.
EndpointKind
Address family of a ConfListen.
HashType
Hash algorithm selected by hash:.
SecureServerOption
Inter-node security mode selected by secure_server_option:.

Functions§

is_noxu_supported
Read the process-wide “noxu data_store is supported” flag.
set_noxu_supported
Set the process-wide “noxu data_store is supported” flag.