pub struct TtlManager<S: VectorStorage> { /* private fields */ }Expand description
TTL Manager for coordinating automatic vector expiration
Implementations§
Source§impl<S: VectorStorage + 'static> TtlManager<S>
impl<S: VectorStorage + 'static> TtlManager<S>
Sourcepub fn with_defaults(storage: Arc<S>) -> Self
pub fn with_defaults(storage: Arc<S>) -> Self
Create a new TTL manager with default config
Sourcepub fn update_config(&self, config: TtlConfig)
pub fn update_config(&self, config: TtlConfig)
Update configuration
Sourcepub fn set_policy(&self, namespace: &NamespaceId, policy: NamespaceTtlPolicy)
pub fn set_policy(&self, namespace: &NamespaceId, policy: NamespaceTtlPolicy)
Set TTL policy for a namespace
Sourcepub fn get_policy(&self, namespace: &NamespaceId) -> Option<NamespaceTtlPolicy>
pub fn get_policy(&self, namespace: &NamespaceId) -> Option<NamespaceTtlPolicy>
Get TTL policy for a namespace
Sourcepub fn remove_policy(
&self,
namespace: &NamespaceId,
) -> Option<NamespaceTtlPolicy>
pub fn remove_policy( &self, namespace: &NamespaceId, ) -> Option<NamespaceTtlPolicy>
Remove TTL policy for a namespace
Sourcepub fn list_policies(&self) -> HashMap<NamespaceId, NamespaceTtlPolicy>
pub fn list_policies(&self) -> HashMap<NamespaceId, NamespaceTtlPolicy>
Get all namespace policies
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the cleanup service is running
Sourcepub fn validate_ttl(
&self,
namespace: &NamespaceId,
ttl_seconds: Option<u64>,
) -> Result<Option<u64>>
pub fn validate_ttl( &self, namespace: &NamespaceId, ttl_seconds: Option<u64>, ) -> Result<Option<u64>>
Validate and apply TTL for a vector in a namespace
Sourcepub async fn run_cleanup(&self) -> Result<TtlCleanupResult>
pub async fn run_cleanup(&self) -> Result<TtlCleanupResult>
Run cleanup once (manual trigger)
Sourcepub fn trigger_cleanup(&self)
pub fn trigger_cleanup(&self)
Trigger an immediate cleanup (async, doesn’t wait)
Auto Trait Implementations§
impl<S> !Freeze for TtlManager<S>
impl<S> !RefUnwindSafe for TtlManager<S>
impl<S> Send for TtlManager<S>
impl<S> Sync for TtlManager<S>
impl<S> Unpin for TtlManager<S>
impl<S> UnsafeUnpin for TtlManager<S>
impl<S> !UnwindSafe for TtlManager<S>
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