pub struct BucketMapHolder<T: IndexValue> {
pub disk: Option<BucketMap<(Slot, T)>>,
pub count_buckets_flushed: AtomicUsize,
pub age: AtomicU8,
pub stats: BucketMapHolderStats,
pub wait_dirty_or_aged: Arc<WaitableCondvar>,
pub threads: usize,
pub mem_budget_mb: Option<usize>,
pub ages_to_stay_in_cache: Age,
/* private fields */
}
Fields§
§disk: Option<BucketMap<(Slot, T)>>
§count_buckets_flushed: AtomicUsize
§age: AtomicU8
§stats: BucketMapHolderStats
§wait_dirty_or_aged: Arc<WaitableCondvar>
§threads: usize
§mem_budget_mb: Option<usize>
§ages_to_stay_in_cache: Age
how many ages should elapse from the last time an item is used where the item will remain in the cache
Implementations§
Source§impl<T: IndexValue> BucketMapHolder<T>
impl<T: IndexValue> BucketMapHolder<T>
Sourcepub fn is_disk_index_enabled(&self) -> bool
pub fn is_disk_index_enabled(&self) -> bool
is the accounts index using disk as a backing store
pub fn increment_age(&self)
pub fn future_age_to_flush(&self) -> Age
Sourcepub fn get_startup(&self) -> bool
pub fn get_startup(&self) -> bool
used by bg processes to determine # active threads and how aggressively to flush
Sourcepub fn set_startup(&self, value: bool)
pub fn set_startup(&self, value: bool)
startup=true causes: in mem to act in a way that flushes to disk asap startup=false is ‘normal’ operation
pub fn current_age(&self) -> Age
pub fn bucket_flushed_at_current_age(&self, can_advance_age: bool)
Sourcepub fn all_buckets_flushed_at_current_age(&self) -> bool
pub fn all_buckets_flushed_at_current_age(&self) -> bool
have all buckets been flushed at the current age?
pub fn count_buckets_flushed(&self) -> usize
Sourcepub fn maybe_advance_age(&self) -> bool
pub fn maybe_advance_age(&self) -> bool
if all buckets are flushed at the current age and time has elapsed, then advance age
pub fn new( bins: usize, config: &Option<AccountsIndexConfig>, threads: usize, ) -> Self
pub fn next_bucket_to_flush(&self) -> usize
pub fn background( &self, exit: Arc<AtomicBool>, in_mem: Vec<Arc<InMemAccountsIndex<T>>>, can_advance_age: bool, )
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for BucketMapHolder<T>
impl<T> RefUnwindSafe for BucketMapHolder<T>
impl<T> Send for BucketMapHolder<T>
impl<T> Sync for BucketMapHolder<T>
impl<T> Unpin for BucketMapHolder<T>
impl<T> UnwindSafe for BucketMapHolder<T>
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