pub struct UpdateBuffer { /* private fields */ }Expand description
Buffer for batching online updates
Implementations§
Source§impl UpdateBuffer
impl UpdateBuffer
Sourcepub fn new(config: OnlineUpdateConfig) -> Self
pub fn new(config: OnlineUpdateConfig) -> Self
Create a new update buffer
Sourcepub fn buffer_insert(&self, id: VectorId, vector: Vec<f32>)
pub fn buffer_insert(&self, id: VectorId, vector: Vec<f32>)
Add an insert to the buffer
Sourcepub fn buffer_delete(&self, id: VectorId)
pub fn buffer_delete(&self, id: VectorId)
Add a delete to the buffer
Sourcepub fn should_flush(&self) -> bool
pub fn should_flush(&self) -> bool
Check if buffer should be flushed
Sourcepub fn flush_deletes(&self) -> HashSet<VectorId>
pub fn flush_deletes(&self) -> HashSet<VectorId>
Flush pending deletes and return them
Sourcepub fn stats(&self) -> OnlineUpdateStats
pub fn stats(&self) -> OnlineUpdateStats
Get buffer statistics
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for UpdateBuffer
impl RefUnwindSafe for UpdateBuffer
impl Send for UpdateBuffer
impl Sync for UpdateBuffer
impl Unpin for UpdateBuffer
impl UnsafeUnpin for UpdateBuffer
impl UnwindSafe for UpdateBuffer
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