pub struct AccountsIndexStorage<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> {
_bg_threads: BgThreads,
pub storage: Arc<BucketMapHolder<T, U>>,
pub in_mem: Vec<Arc<InMemAccountsIndex<T, U>>>,
exit: Arc<AtomicBool>,
startup_worker_threads: Mutex<Option<BgThreads>>,
}
Expand description
Manages the lifetime of the background processing threads.
Fields§
§_bg_threads: BgThreads
§storage: Arc<BucketMapHolder<T, U>>
§in_mem: Vec<Arc<InMemAccountsIndex<T, U>>>
§exit: Arc<AtomicBool>
§startup_worker_threads: Mutex<Option<BgThreads>>
set_startup(true) creates bg threads which are kept alive until set_startup(false)
Implementations§
source§impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> AccountsIndexStorage<T, U>
impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> AccountsIndexStorage<T, U>
sourcepub fn set_startup(&self, startup: Startup)
pub fn set_startup(&self, startup: Startup)
startup=true causes: in mem to act in a way that flushes to disk asap also creates some additional bg threads to facilitate flushing to disk asap startup=false is ‘normal’ operation
sourcepub fn get_startup_remaining_items_to_flush_estimate(&self) -> usize
pub fn get_startup_remaining_items_to_flush_estimate(&self) -> usize
estimate how many items are still needing to be flushed to the disk cache.
fn shrink_to_fit(&self)
fn num_threads() -> usize
sourcepub fn new(
bins: usize,
config: &Option<AccountsIndexConfig>,
exit: &Arc<AtomicBool>
) -> Self
pub fn new( bins: usize, config: &Option<AccountsIndexConfig>, exit: &Arc<AtomicBool> ) -> Self
allocate BucketMapHolder and InMemAccountsIndex[]
Trait Implementations§
source§impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> Debug for AccountsIndexStorage<T, U>
impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> Debug for AccountsIndexStorage<T, U>
Auto Trait Implementations§
impl<T, U> !RefUnwindSafe for AccountsIndexStorage<T, U>
impl<T, U> Send for AccountsIndexStorage<T, U>
impl<T, U> Sync for AccountsIndexStorage<T, U>
impl<T, U> Unpin for AccountsIndexStorage<T, U>
impl<T, U> !UnwindSafe for AccountsIndexStorage<T, U>
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