pub struct DeterministicSplitStore { /* private fields */ }Expand description
In-memory split store with deterministic assignment derivation.
Implementations§
Source§impl DeterministicSplitStore
impl DeterministicSplitStore
Sourcepub fn new(ratios: SplitRatios, seed: u64) -> Result<Self, SamplerError>
pub fn new(ratios: SplitRatios, seed: u64) -> Result<Self, SamplerError>
Create an in-memory split store configured with ratios and seed.
Trait Implementations§
Source§impl EpochStateStore for DeterministicSplitStore
impl EpochStateStore for DeterministicSplitStore
Source§fn load_epoch_meta(
&self,
) -> Result<HashMap<SplitLabel, PersistedSplitMeta>, SamplerError>
fn load_epoch_meta( &self, ) -> Result<HashMap<SplitLabel, PersistedSplitMeta>, SamplerError>
Load split→epoch metadata map.
Source§fn load_epoch_hashes(
&self,
label: SplitLabel,
) -> Result<Option<PersistedSplitHashes>, SamplerError>
fn load_epoch_hashes( &self, label: SplitLabel, ) -> Result<Option<PersistedSplitHashes>, SamplerError>
Load persisted epoch hashes for one split, if available.
Source§fn save_epoch_meta(
&self,
meta: &HashMap<SplitLabel, PersistedSplitMeta>,
) -> Result<(), SamplerError>
fn save_epoch_meta( &self, meta: &HashMap<SplitLabel, PersistedSplitMeta>, ) -> Result<(), SamplerError>
Persist split→epoch metadata map.
Source§fn save_epoch_hashes(
&self,
label: SplitLabel,
hashes: &PersistedSplitHashes,
) -> Result<(), SamplerError>
fn save_epoch_hashes( &self, label: SplitLabel, hashes: &PersistedSplitHashes, ) -> Result<(), SamplerError>
Persist epoch hash list for one split.
Source§impl SamplerStateStore for DeterministicSplitStore
impl SamplerStateStore for DeterministicSplitStore
Source§fn load_sampler_state(
&self,
) -> Result<Option<PersistedSamplerState>, SamplerError>
fn load_sampler_state( &self, ) -> Result<Option<PersistedSamplerState>, SamplerError>
Load persisted sampler runtime state, if present.
Source§fn save_sampler_state(
&self,
state: &PersistedSamplerState,
_save_path: Option<&Path>,
) -> Result<(), SamplerError>
fn save_sampler_state( &self, state: &PersistedSamplerState, _save_path: Option<&Path>, ) -> Result<(), SamplerError>
Save sampler runtime state, optionally mirroring to
save_path.Source§impl SplitStore for DeterministicSplitStore
impl SplitStore for DeterministicSplitStore
Source§fn label_for(&self, id: &RecordId) -> Option<SplitLabel>
fn label_for(&self, id: &RecordId) -> Option<SplitLabel>
Return split label for
id if known/derivable.Source§fn upsert(&self, id: RecordId, label: SplitLabel) -> Result<(), SamplerError>
fn upsert(&self, id: RecordId, label: SplitLabel) -> Result<(), SamplerError>
Persist an explicit split assignment for
id.Source§fn ratios(&self) -> SplitRatios
fn ratios(&self) -> SplitRatios
Return configured split ratios.
Source§fn ensure(&self, id: RecordId) -> Result<SplitLabel, SamplerError>
fn ensure(&self, id: RecordId) -> Result<SplitLabel, SamplerError>
Return the split label for
id, creating/deriving one when needed.Auto Trait Implementations§
impl !Freeze for DeterministicSplitStore
impl RefUnwindSafe for DeterministicSplitStore
impl Send for DeterministicSplitStore
impl Sync for DeterministicSplitStore
impl Unpin for DeterministicSplitStore
impl UnsafeUnpin for DeterministicSplitStore
impl UnwindSafe for DeterministicSplitStore
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more