pub struct ReplicaDcManager { /* private fields */ }Expand description
Replica datacenter replication receiver
Receives and applies replication entries from the primary DC, maintaining an eventually-consistent copy of the vector index.
Implementations§
Source§impl ReplicaDcManager
impl ReplicaDcManager
Sourcepub fn new(config: CrossDcConfig) -> Result<Self>
pub fn new(config: CrossDcConfig) -> Result<Self>
Create a new replica DC manager
Sourcepub fn receive_entries(&self, entries: Vec<ReplicationEntry>) -> ReplicationSeq
pub fn receive_entries(&self, entries: Vec<ReplicationEntry>) -> ReplicationSeq
Receive a batch of replication entries from the primary
Sourcepub fn apply_pending(&self) -> usize
pub fn apply_pending(&self) -> usize
Apply all buffered entries to the local state
Sourcepub fn get_vector(
&self,
vector_id: &str,
) -> Option<(Vec<f32>, HashMap<String, String>)>
pub fn get_vector( &self, vector_id: &str, ) -> Option<(Vec<f32>, HashMap<String, String>)>
Get a vector from local state
Sourcepub fn last_applied_seq(&self) -> ReplicationSeq
pub fn last_applied_seq(&self) -> ReplicationSeq
Get the last applied sequence number
Sourcepub fn lag_entries(&self) -> u64
pub fn lag_entries(&self) -> u64
Get estimated lag (entries behind primary)
Sourcepub fn is_within_lag_tolerance(&self) -> bool
pub fn is_within_lag_tolerance(&self) -> bool
Check if we are within the configured lag tolerance
Sourcepub fn vector_count(&self) -> usize
pub fn vector_count(&self) -> usize
Get the number of vectors in local state
Sourcepub fn get_stats(&self) -> CrossDcStats
pub fn get_stats(&self) -> CrossDcStats
Get current statistics
Sourcepub fn search_similar(&self, query: &[f32], k: usize) -> Vec<(String, f32)>
pub fn search_similar(&self, query: &[f32], k: usize) -> Vec<(String, f32)>
Search for similar vectors in local state
Sourcepub fn primary_heartbeat_recent(&self) -> bool
pub fn primary_heartbeat_recent(&self) -> bool
Check if primary heartbeat is recent
Sourcepub fn conflict_log(&self) -> Vec<ConflictRecord>
pub fn conflict_log(&self) -> Vec<ConflictRecord>
Get the conflict log
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Get the pending buffer size
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReplicaDcManager
impl !RefUnwindSafe for ReplicaDcManager
impl Send for ReplicaDcManager
impl Sync for ReplicaDcManager
impl Unpin for ReplicaDcManager
impl UnsafeUnpin for ReplicaDcManager
impl !UnwindSafe for ReplicaDcManager
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.