pub struct ConfRiak {
pub pbc_listen: Option<String>,
pub http_listen: Option<String>,
pub aae_enabled: Option<bool>,
pub aae_full_sweep_interval_seconds: Option<u64>,
pub aae_segment_interval_seconds: Option<u64>,
pub tls_cert: Option<PathBuf>,
pub tls_key: Option<PathBuf>,
pub tls_ca: Option<PathBuf>,
pub wasm_modules: Option<Vec<ConfRiakWasmModule>>,
}Expand description
Optional Riak-mode listener / AAE knobs.
Every field is optional. The PBC and HTTP listeners are
independent: setting one without the other is supported.
When aae_enabled is true the active anti-entropy
scheduler is spawned; the cadence knobs default to the
values shipped by dyniak::aae::config.
§Examples
use dynomite::conf::ConfRiak;
let r = ConfRiak {
pbc_listen: Some("127.0.0.1:8087".into()),
http_listen: Some("127.0.0.1:8098".into()),
aae_enabled: Some(false),
aae_full_sweep_interval_seconds: None,
aae_segment_interval_seconds: None,
tls_cert: None,
tls_key: None,
tls_ca: None,
wasm_modules: None,
};
assert!(r.validate().is_ok());Fields§
§pbc_listen: Option<String>Address the Riak Protocol Buffers Client listener binds
to (host:port). When unset, the PBC listener is not
started.
http_listen: Option<String>Address the Riak HTTP gateway listener binds to
(host:port). When unset, the HTTP gateway is not
started.
aae_enabled: Option<bool>When true, the Riak active anti-entropy scheduler is
spawned alongside the listeners. Default: false.
aae_full_sweep_interval_seconds: Option<u64>Override for the AAE full-sweep cadence, in seconds.
When unset, dyniak::aae::config::DEFAULT_FULL_SWEEP_SECONDS
(24h) is used.
aae_segment_interval_seconds: Option<u64>Override for the AAE per-segment exchange cadence, in
seconds. When unset, dyniak::aae::config::DEFAULT_SEGMENT_SECONDS
(60s) is used.
tls_cert: Option<PathBuf>tls_cert: - PEM certificate path for the Riak PBC and
HTTP listeners. When both tls_cert and tls_key are
set, both Riak listeners terminate TLS; when both are
absent, both listeners run in plaintext (the historical
behaviour). Setting one without the other is rejected at
validation time.
tls_key: Option<PathBuf>tls_key: - PEM private-key path matching
Self::tls_cert.
tls_ca: Option<PathBuf>tls_ca: - optional PEM CA bundle for mutual TLS on the
Riak listeners. When set, every inbound client must
present a certificate signed by a CA from this bundle.
When unset, the listeners terminate TLS without
requesting a client certificate.
wasm_modules: Option<Vec<ConfRiakWasmModule>>wasm_modules: - optional list of Wasm modules to
register with the MapReduce executor at startup. Each
entry pairs a logical id with the on-disk path of a
Wasm binary (.wasm) or WAT text (.wat) file. When
dynomited is built with the wasm Cargo feature it
loads every entry through
[dyniak::mapreduce::wasm::load_modules_from_config]
and exposes the resulting store on the executor; without
the feature the field is parsed and validated but the
loader is never called (the runtime returns the typed
WasmNotImplemented error if a Phase::WasmModule is
submitted).
Validation: every id must be unique and every path
must point at an existing file at validation time.
Implementations§
Source§impl ConfRiak
impl ConfRiak
Sourcepub fn validate(&self) -> Result<(), ConfError>
pub fn validate(&self) -> Result<(), ConfError>
Validate the cross-field invariants of the Riak block.
§Errors
Returns a ConfError::BadServer when an address fails
to parse as a host:port socket address, when an AAE
cadence is zero, or when aae_segment_interval_seconds
exceeds aae_full_sweep_interval_seconds.
§Examples
use dynomite::conf::ConfRiak;
let r = ConfRiak {
pbc_listen: Some("not-a-socket-addr".into()),
..ConfRiak::default()
};
assert!(r.validate().is_err());Trait Implementations§
Source§impl<'de> Deserialize<'de> for ConfRiak
impl<'de> Deserialize<'de> for ConfRiak
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ConfRiak
impl StructuralPartialEq for ConfRiak
Auto Trait Implementations§
impl Freeze for ConfRiak
impl RefUnwindSafe for ConfRiak
impl Send for ConfRiak
impl Sync for ConfRiak
impl Unpin for ConfRiak
impl UnsafeUnpin for ConfRiak
impl UnwindSafe for ConfRiak
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.