pub struct ConfPool {Show 59 fields
pub listen: Option<ConfListen>,
pub dyn_listen: Option<ConfListen>,
pub stats_listen: Option<ConfListen>,
pub hash: Option<HashType>,
pub hash_tag: Option<String>,
pub distribution: Option<Distribution>,
pub distribution_shadow: Option<Distribution>,
pub server_connections: Option<i64>,
pub timeout: Option<i64>,
pub backlog: Option<i64>,
pub client_connections: Option<i64>,
pub data_store: Option<i64>,
pub noxu_path: Option<PathBuf>,
pub preconnect: Option<bool>,
pub redis_requirepass: Option<String>,
pub auto_eject_hosts: Option<bool>,
pub server_retry_timeout: Option<i64>,
pub server_failure_limit: Option<i64>,
pub servers: Option<Servers>,
pub dyn_read_timeout: Option<i64>,
pub dyn_write_timeout: Option<i64>,
pub dyn_seed_provider: Option<String>,
pub dyn_seeds: Option<Vec<ConfDynSeed>>,
pub dyn_port: Option<i64>,
pub dyn_connections: Option<i64>,
pub rack: Option<String>,
pub tokens: Option<TokenList>,
pub gos_interval: Option<i64>,
pub secure_server_option: Option<String>,
pub pem_key_file: Option<String>,
pub recon_key_file: Option<String>,
pub recon_iv_file: Option<String>,
pub recon_interval_seconds: Option<u64>,
pub datacenter: Option<String>,
pub env: Option<String>,
pub conn_msg_rate: Option<u32>,
pub read_consistency: Option<String>,
pub write_consistency: Option<String>,
pub stats_interval: Option<i64>,
pub enable_gossip: Option<bool>,
pub peer_tls_cert: Option<PathBuf>,
pub peer_tls_key: Option<PathBuf>,
pub peer_tls_ca: Option<PathBuf>,
pub peer_tls_profiles: BTreeMap<String, ConfTlsProfile>,
pub mbuf_size: Option<i64>,
pub max_msgs: Option<i64>,
pub datastore_connections: Option<u8>,
pub local_peer_connections: Option<u8>,
pub remote_peer_connections: Option<u8>,
pub read_repairs_enabled: Option<bool>,
pub enable_hinted_handoff: Option<bool>,
pub hint_ttl_seconds: Option<u64>,
pub hint_store_max_bytes: Option<u64>,
pub hint_drain_interval_ms: Option<u64>,
pub log_format: Option<String>,
pub observability: Option<ObservabilityConfig>,
pub bucket_types: Vec<ConfBucketType>,
pub default_bucket_type: Option<String>,
pub riak: Option<ConfRiak>,
}Expand description
Pool configuration body. One per top-level YAML pool name.
§Examples
use dynomite::conf::{ConfPool, ConfListen};
let mut p = ConfPool::default();
assert!(p.listen.is_none());
p.listen = Some(ConfListen::parse("listen", "127.0.0.1:8102").unwrap());
p.apply_defaults();
assert_eq!(p.timeout, Some(5_000));Fields§
§listen: Option<ConfListen>listen: - client-facing listener address.
dyn_listen: Option<ConfListen>dyn_listen: - peer-facing listener address.
stats_listen: Option<ConfListen>stats_listen: - HTTP stats endpoint.
hash: Option<HashType>hash: - hash function name.
hash_tag: Option<String>hash_tag: - two-character delimiter pair.
distribution: Option<Distribution>distribution: - distribution algorithm. Defaults to
Distribution::Vnode. Setting one of the legacy
ketama / modula / random values is accepted but
emits a deprecation warning at config-load time and
collapses to vnode at runtime.
distribution_shadow: Option<Distribution>distribution_shadow: - optional shadow distribution
computed alongside the live one. When set, the
dispatcher routes via Self::distribution but also
computes the shadow route for every key and bumps a
counter when the two disagree. Used to validate a
migration before flipping the live distribution.
server_connections: Option<i64>server_connections: - deprecated; recorded for warning but ignored.
timeout: Option<i64>timeout: - request timeout in milliseconds.
backlog: Option<i64>backlog: - listen backlog.
client_connections: Option<i64>client_connections: - max client connections.
data_store: Option<i64>data_store: - 0 = redis, 1 = memcache, 2 = noxu.
Operators may also write the textual form (redis,
memcache, noxu); the deserializer normalises both
shapes to the integer code that the rest of the engine
consumes.
noxu_path: Option<PathBuf>noxu_path: - filesystem directory the in-process Noxu
DB datastore opens its environment at. Required when
data_store: noxu is selected; ignored otherwise. The
directory must be writable; an existing environment is
reused, otherwise one is created.
preconnect: Option<bool>preconnect: - eagerly establish connections at startup.
redis_requirepass: Option<String>redis_requirepass: - optional password sent as AUTH <pw>
on every backend connection right after the TCP handshake.
Mirrors the Redis server option of the same name. Leave
unset to disable. Memcache backends are not authenticated
(AUTH is Redis-specific; memcache binary SASL is not
implemented).
auto_eject_hosts: Option<bool>auto_eject_hosts: - automatically eject failing peers.
server_retry_timeout: Option<i64>server_retry_timeout: - retry interval for ejected servers (ms).
server_failure_limit: Option<i64>server_failure_limit: - consecutive failures before eject.
servers: Option<Servers>servers: - the (single-element) datastore list.
dyn_read_timeout: Option<i64>dyn_read_timeout: - inter-node read timeout (ms).
dyn_write_timeout: Option<i64>dyn_write_timeout: - inter-node write timeout (ms).
dyn_seed_provider: Option<String>dyn_seed_provider: - seeds backend.
dyn_seeds: Option<Vec<ConfDynSeed>>dyn_seeds: - peer dynomite nodes.
dyn_port: Option<i64>dyn_port: - default peer port.
dyn_connections: Option<i64>dyn_connections: - per-peer connection count.
rack: Option<String>rack: - this node’s rack.
tokens: Option<TokenList>tokens: - this node’s tokens.
gos_interval: Option<i64>gos_interval: - gossip period (ms).
secure_server_option: Option<String>secure_server_option: - inter-node TLS mode.
pem_key_file: Option<String>pem_key_file: - path to the PEM private key.
recon_key_file: Option<String>recon_key_file: - reconciliation key path.
recon_iv_file: Option<String>recon_iv_file: - reconciliation IV path.
recon_interval_seconds: Option<u64>recon_interval_seconds: - period (in seconds) of the
background entropy reconciliation cycle.
Ignored when Self::recon_key_file is unset or when the
configured key file cannot be opened at startup. When the
entropy task is enabled the default cadence is 300 seconds
(five minutes); operators can override it via this YAML
directive.
datacenter: Option<String>datacenter: - this node’s datacenter.
env: Option<String>env: - cloud environment marker.
conn_msg_rate: Option<u32>conn_msg_rate: - per-connection message rate cap.
read_consistency: Option<String>read_consistency: - quorum policy for reads.
write_consistency: Option<String>write_consistency: - quorum policy for writes.
stats_interval: Option<i64>stats_interval: - stats aggregation period (ms).
enable_gossip: Option<bool>enable_gossip: - enable / disable gossip thread.
peer_tls_cert: Option<PathBuf>peer_tls_cert: - PEM certificate path for the dnode
listener and outbound dnode connections. When both this
field and Self::peer_tls_key are set the peer plane
runs over TLS; when both are absent the peer plane runs
in plaintext (the historical behaviour). Setting one
without the other is rejected at validation time.
peer_tls_key: Option<PathBuf>peer_tls_key: - PEM private-key path matching
Self::peer_tls_cert.
peer_tls_ca: Option<PathBuf>peer_tls_ca: - optional PEM CA bundle. When set, the
dnode listener requires every inbound peer to present a
certificate signed by a CA from this bundle (mutual TLS).
When unset, the listener still terminates TLS but does
not request a client certificate. The outbound side uses
this bundle as its trust anchor; when unset, the bundled
webpki_roots Mozilla bundle is used.
peer_tls_profiles: BTreeMap<String, ConfTlsProfile>peer_tls_profiles: - per-DC TLS material lookup. Each
entry is keyed by the target peer’s datacenter name; the
value is a ConfTlsProfile giving the cert / key / CA
triple to use when negotiating peer-plane TLS to or from a
peer in that DC. When the inbound listener accepts a
connection it picks the cert by SNI hostname
(dc-<dc-name>.dynomite.local); the outbound peer
supervisor dials with the same SNI hostname so the remote
listener can route the handshake.
When this map is empty (the default), the legacy
peer_tls_cert / peer_tls_key / peer_tls_ca triple is
the only profile in use, applied to every peer regardless
of DC. When the map is non-empty, each entry takes
precedence over the legacy fields for matching DCs; the
legacy fields become the implicit “default” profile used
for any DC without an explicit entry. When neither the
map nor the legacy fields are set, the peer plane is
plaintext.
mbuf_size: Option<i64>mbuf_size: - mbuf chunk size in bytes.
max_msgs: Option<i64>max_msgs: - allocated message buffer size.
datastore_connections: Option<u8>datastore_connections: - count of connections to the datastore.
local_peer_connections: Option<u8>local_peer_connections: - count of connections to local-DC peers.
remote_peer_connections: Option<u8>remote_peer_connections: - count of connections to remote peers.
read_repairs_enabled: Option<bool>read_repairs_enabled: - enable read-repair on quorum mismatch.
enable_hinted_handoff: Option<bool>enable_hinted_handoff: - when true, writes whose target
peer is in crate::cluster::peer::PeerState::Down (or
whose outbound channel is closed / full) are stored in a
node-local hint queue and counted toward the consistency
threshold; a background drainer ships the hints to the
peer once it returns to
crate::cluster::peer::PeerState::Normal. When false
(the default) the dispatcher behaviour is unchanged: a
Down or unreachable target is silently skipped and the
request fails with DynomiteNoQuorumAchieved if the
remaining targets cannot satisfy the consistency level.
hint_ttl_seconds: Option<u64>hint_ttl_seconds: - per-hint expiry. Hints older than
this many seconds are dropped during periodic sweeps to
bound the in-memory store. Defaults to 86400 (24 hours).
Ignored when enable_hinted_handoff is false.
hint_store_max_bytes: Option<u64>hint_store_max_bytes: - upper bound on the in-memory
hint store. Once the store reaches this many bytes,
further enqueues fail with
crate::cluster::hints::HintStoreError::OverCapacity
and the dispatcher falls back to its non-handoff error
path. Defaults to 64 MiB. Ignored when
enable_hinted_handoff is false.
hint_drain_interval_ms: Option<u64>hint_drain_interval_ms: - period of the background hint
drainer sweep. Defaults to 30000 ms (30 seconds). Ignored
when enable_hinted_handoff is false.
log_format: Option<String>log_format: - selectable shape for tracing output.
Accepted values are default, rfc5424, rfc3164, json,
and ndjson (alias of json). When unset, the historical
default text format is used. Parsing is performed at
log-installation time by crate::core::log::LogFormat::parse;
invalid values fail the dynomited --test-conf gate.
observability: Option<ObservabilityConfig>observability: - opt-in observability knobs (distributed
tracing OTLP exporter today; the OTLP log appender is
scoped but not yet wired). Absent / null disables every
observability surface, preserving today’s silent default.
See ObservabilityConfig.
bucket_types: Vec<ConfBucketType>bucket_types: - per-bucket routing-property bundles.
Each entry is a ConfBucketType keyed by name. The
dispatcher extracts the bucket name from the request key
(the prefix before the first /; see
crate::proto::redis::bucket_name) and, when a matching
entry exists, swaps in that type’s read_consistency,
write_consistency, and n_val for the lifetime of that
request. Pool-level fields stay the fallback for keys
without a slash, for keys whose bucket prefix is unknown,
and for any field the bucket-type stanza leaves at its
default. Empty list disables the feature; entries must have
unique names.
default_bucket_type: Option<String>default_bucket_type: - name of the bucket type to apply
when the request key has no slash (or has an empty prefix).
Must reference an entry of bucket_types when set; unset
(the default) falls all the way back to pool-level
consistency.
riak: Option<ConfRiak>riak: - optional Riak-mode listener / AAE configuration.
Consumed only when dynomited is built with the
--features riak Cargo feature: the binary then
instantiates a Protocol Buffers Client (PBC) listener,
an HTTP gateway, and (optionally) the active anti-entropy
scheduler against the supplied addresses. When the field
is absent (or every inner option is unset), the binary
behaves identically to a Redis / Memcache deployment.
The block is parsed unconditionally so YAML files
authored against the Riak-enabled binary still validate
under the default build.
Implementations§
Source§impl ConfPool
impl ConfPool
Sourcepub fn resolved_distribution(&self) -> Distribution
pub fn resolved_distribution(&self) -> Distribution
Resolve the configured Distribution for the engine.
Folds the legacy ketama / modula / random aliases
down to Distribution::Vnode (the only algorithm those
names ever resolved to in the Rust port). Emits a
tracing::warn! for the legacy aliases the first time
the field is read so the operator notices the
deprecation.
§Examples
use dynomite::conf::{ConfPool, Distribution};
let p = ConfPool {
distribution: Some(Distribution::RandomSlicing),
..ConfPool::default()
};
assert_eq!(p.resolved_distribution(), Distribution::RandomSlicing);Source§impl ConfPool
impl ConfPool
Sourcepub fn apply_defaults(&mut self)
pub fn apply_defaults(&mut self)
Apply defaults to any field still left None after parsing.
§Examples
use dynomite::conf::ConfPool;
let mut p = ConfPool::default();
p.apply_defaults();
assert_eq!(p.timeout, Some(5_000));
assert_eq!(p.rack.as_deref(), Some("localrack"));Sourcepub fn validate(&self, pool_name: &str) -> Result<(), ConfError>
pub fn validate(&self, pool_name: &str) -> Result<(), ConfError>
Run the full validation pass against the (presumably finalized) pool body.
§Examples
use dynomite::conf::{ConfListen, ConfPool, ConfServer, Servers, TokenList};
let mut p = ConfPool {
listen: Some(ConfListen::parse("listen", "127.0.0.1:8102").unwrap()),
servers: Some(Servers::from_vec(vec![ConfServer::parse("127.0.0.1:6379:1").unwrap()])),
tokens: Some(TokenList::parse("0").unwrap()),
..ConfPool::default()
};
p.apply_defaults();
assert!(p.validate("dyn_o_mite").is_ok());