pub struct PredictivePrefetcher { /* private fields */ }Expand description
Predictive prefetcher
Implementations§
Source§impl PredictivePrefetcher
impl PredictivePrefetcher
Sourcepub fn new(config: DistribCacheConfig) -> Self
pub fn new(config: DistribCacheConfig) -> Self
Create a new prefetcher
Sourcepub fn record(&self, session: &SessionId, fingerprint: QueryFingerprint)
pub fn record(&self, session: &SessionId, fingerprint: QueryFingerprint)
Record a query for pattern learning
Sourcepub fn predict_and_prefetch(
&self,
current: &QueryFingerprint,
_session: &SessionId,
)
pub fn predict_and_prefetch( &self, current: &QueryFingerprint, _session: &SessionId, )
Predict and enqueue prefetch requests
Sourcepub fn record_hit(&self)
pub fn record_hit(&self)
Record prefetch hit
Sourcepub fn record_miss(&self)
pub fn record_miss(&self)
Record prefetch miss
Sourcepub fn stats(&self) -> PrefetchStats
pub fn stats(&self) -> PrefetchStats
Get prefetch statistics
Sourcepub fn cleanup_old_sessions(&self, _max_age: Duration)
pub fn cleanup_old_sessions(&self, _max_age: Duration)
Clean up old sessions
Auto Trait Implementations§
impl !Freeze for PredictivePrefetcher
impl !RefUnwindSafe for PredictivePrefetcher
impl Send for PredictivePrefetcher
impl Sync for PredictivePrefetcher
impl Unpin for PredictivePrefetcher
impl UnsafeUnpin for PredictivePrefetcher
impl UnwindSafe for PredictivePrefetcher
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