Struct solana_runtime::accounts_db::AccountsDb [−][src]
pub struct AccountsDb {}Show fields
pub accounts_index: AccountsIndex<AccountInfo>, pub storage: AccountStorage, pub accounts_cache: AccountsCache, pub read_only_accounts_cache: ReadOnlyAccountsCache, pub next_id: AtomicUsize, pub shrink_candidate_slots: Mutex<HashMap<Slot, HashMap<AppendVecId, Arc<AccountStorageEntry>>>>, pub shrink_candidate_slots_v1: Mutex<Vec<Slot>>, pub shrink_paths: RwLock<Option<Vec<PathBuf>>>, pub thread_pool: ThreadPool, pub thread_pool_clean: ThreadPool, pub bank_hashes: RwLock<HashMap<Slot, BankHashInfo>>, pub cluster_type: Option<ClusterType>, pub account_indexes: AccountSecondaryIndexes, pub caching_enabled: bool, // some fields omitted
Fields
accounts_index: AccountsIndex<AccountInfo>
Keeps tracks of index into AppendVec on a per slot basis
storage: AccountStorage
accounts_cache: AccountsCache
read_only_accounts_cache: ReadOnlyAccountsCache
next_id: AtomicUsize
distribute the accounts across storage lists
shrink_candidate_slots: Mutex<HashMap<Slot, HashMap<AppendVecId, Arc<AccountStorageEntry>>>>
Set of shrinkable stores organized by map of slot to append_vec_id
shrink_candidate_slots_v1: Mutex<Vec<Slot>>
Legacy shrink slots to support non-cached code-path.
shrink_paths: RwLock<Option<Vec<PathBuf>>>
thread_pool: ThreadPool
Thread pool used for par_iter
thread_pool_clean: ThreadPool
bank_hashes: RwLock<HashMap<Slot, BankHashInfo>>
cluster_type: Option<ClusterType>
account_indexes: AccountSecondaryIndexes
caching_enabled: bool
Implementations
impl AccountsDb
[src]
impl AccountsDb
[src]pub fn new(paths: Vec<PathBuf>, cluster_type: &ClusterType) -> Self
[src]
pub fn new_with_config(
paths: Vec<PathBuf>,
cluster_type: &ClusterType,
account_indexes: AccountSecondaryIndexes,
caching_enabled: bool
) -> Self
[src]
paths: Vec<PathBuf>,
cluster_type: &ClusterType,
account_indexes: AccountSecondaryIndexes,
caching_enabled: bool
) -> Self
pub fn set_shrink_paths(&self, paths: Vec<PathBuf>)
[src]
pub fn file_size(&self) -> u64
[src]
pub fn new_single() -> Self
[src]
pub fn expected_cluster_type(&self) -> ClusterType
[src]
pub fn clean_accounts(&self, max_clean_root: Option<Slot>, is_startup: bool)
[src]
pub fn shrink_candidate_slots(&self) -> usize
[src]
pub fn shrink_all_slots(&self, is_startup: bool)
[src]
pub fn scan_accounts<F, A>(&self, ancestors: &Ancestors, scan_func: F) -> A where
F: Fn(&mut A, Option<(&Pubkey, AccountSharedData, Slot)>),
A: Default,
[src]
F: Fn(&mut A, Option<(&Pubkey, AccountSharedData, Slot)>),
A: Default,
pub fn unchecked_scan_accounts<F, A>(
&self,
metric_name: &'static str,
ancestors: &Ancestors,
scan_func: F
) -> A where
F: Fn(&mut A, (&Pubkey, LoadedAccount<'_>, Slot)),
A: Default,
[src]
&self,
metric_name: &'static str,
ancestors: &Ancestors,
scan_func: F
) -> A where
F: Fn(&mut A, (&Pubkey, LoadedAccount<'_>, Slot)),
A: Default,
pub fn range_scan_accounts<F, A, R>(
&self,
metric_name: &'static str,
ancestors: &Ancestors,
range: R,
scan_func: F
) -> A where
F: Fn(&mut A, Option<(&Pubkey, AccountSharedData, Slot)>),
A: Default,
R: RangeBounds<Pubkey>,
[src]
&self,
metric_name: &'static str,
ancestors: &Ancestors,
range: R,
scan_func: F
) -> A where
F: Fn(&mut A, Option<(&Pubkey, AccountSharedData, Slot)>),
A: Default,
R: RangeBounds<Pubkey>,
pub fn index_scan_accounts<F, A>(
&self,
ancestors: &Ancestors,
index_key: IndexKey,
scan_func: F
) -> (A, bool) where
F: Fn(&mut A, Option<(&Pubkey, AccountSharedData, Slot)>),
A: Default,
[src]
&self,
ancestors: &Ancestors,
index_key: IndexKey,
scan_func: F
) -> (A, bool) where
F: Fn(&mut A, Option<(&Pubkey, AccountSharedData, Slot)>),
A: Default,
pub fn scan_account_storage<R, B>(
&self,
slot: Slot,
cache_map_func: impl Fn(LoadedAccount<'_>) -> Option<R> + Sync,
storage_scan_func: impl Fn(&B, LoadedAccount<'_>) + Sync
) -> ScanStorageResult<R, B> where
R: Send,
B: Send + Default + Sync,
[src]
pub fn scan_account_storage<R, B>(
&self,
slot: Slot,
cache_map_func: impl Fn(LoadedAccount<'_>) -> Option<R> + Sync,
storage_scan_func: impl Fn(&B, LoadedAccount<'_>) + Sync
) -> ScanStorageResult<R, B> where
R: Send,
B: Send + Default + Sync,
[src]Scan a specific slot through all the account storage in parallel
pub fn set_hash(&self, slot: Slot, parent_slot: Slot)
[src]
pub fn load(
&self,
ancestors: &Ancestors,
pubkey: &Pubkey,
load_hint: LoadHint
) -> Option<(AccountSharedData, Slot)>
[src]
&self,
ancestors: &Ancestors,
pubkey: &Pubkey,
load_hint: LoadHint
) -> Option<(AccountSharedData, Slot)>
pub fn load_with_fixed_root(
&self,
ancestors: &Ancestors,
pubkey: &Pubkey
) -> Option<(AccountSharedData, Slot)>
[src]
&self,
ancestors: &Ancestors,
pubkey: &Pubkey
) -> Option<(AccountSharedData, Slot)>
pub fn load_without_fixed_root(
&self,
ancestors: &Ancestors,
pubkey: &Pubkey
) -> Option<(AccountSharedData, Slot)>
[src]
&self,
ancestors: &Ancestors,
pubkey: &Pubkey
) -> Option<(AccountSharedData, Slot)>
pub fn load_account_hash(
&self,
ancestors: &Ancestors,
pubkey: &Pubkey,
max_root: Option<Slot>,
load_hint: LoadHint
) -> Option<Hash>
[src]
&self,
ancestors: &Ancestors,
pubkey: &Pubkey,
max_root: Option<Slot>,
load_hint: LoadHint
) -> Option<Hash>
pub fn create_drop_bank_callback(
&self,
pruned_banks_sender: DroppedSlotsSender
) -> SendDroppedBankCallback
[src]
&self,
pruned_banks_sender: DroppedSlotsSender
) -> SendDroppedBankCallback
pub fn purge_slot(&self, slot: Slot, is_from_abs: bool)
[src]
pub fn purge_slot(&self, slot: Slot, is_from_abs: bool)
[src]is_from_abs
is true if the caller is the AccountsBackgroundService
pub fn remove_unrooted_slot(&self, remove_slot: Slot)
[src]
pub fn hash_stored_account(slot: Slot, account: &StoredAccountMeta<'_>) -> Hash
[src]
pub fn hash_account<T: ReadableAccount>(
slot: Slot,
account: &T,
pubkey: &Pubkey
) -> Hash
[src]
slot: Slot,
account: &T,
pubkey: &Pubkey
) -> Hash
pub fn mark_slot_frozen(&self, slot: Slot)
[src]
pub fn expire_old_recycle_stores(&self)
[src]
pub fn flush_accounts_cache(
&self,
force_flush: bool,
requested_flush_root: Option<Slot>
)
[src]
&self,
force_flush: bool,
requested_flush_root: Option<Slot>
)
pub fn checked_iterative_sum_for_capitalization(
total_cap: u64,
new_cap: u64
) -> u64
[src]
total_cap: u64,
new_cap: u64
) -> u64
pub fn checked_sum_for_capitalization<T: Iterator<Item = u64>>(
balances: T
) -> u64
[src]
balances: T
) -> u64
pub fn get_accounts_hash(&self, slot: Slot) -> Hash
[src]
pub fn update_accounts_hash(
&self,
slot: Slot,
ancestors: &Ancestors
) -> (Hash, u64)
[src]
&self,
slot: Slot,
ancestors: &Ancestors
) -> (Hash, u64)
pub fn update_accounts_hash_test(
&self,
slot: Slot,
ancestors: &Ancestors
) -> (Hash, u64)
[src]
&self,
slot: Slot,
ancestors: &Ancestors
) -> (Hash, u64)
pub fn update_accounts_hash_with_index_option(
&self,
use_index: bool,
debug_verify: bool,
slot: Slot,
ancestors: &Ancestors,
expected_capitalization: Option<u64>
) -> (Hash, u64)
[src]
&self,
use_index: bool,
debug_verify: bool,
slot: Slot,
ancestors: &Ancestors,
expected_capitalization: Option<u64>
) -> (Hash, u64)
pub fn calculate_accounts_hash_without_index(
storages: &[SnapshotStorage],
thread_pool: Option<&ThreadPool>
) -> (Hash, u64)
[src]
storages: &[SnapshotStorage],
thread_pool: Option<&ThreadPool>
) -> (Hash, u64)
pub fn verify_bank_hash_and_lamports(
&self,
slot: Slot,
ancestors: &Ancestors,
total_lamports: u64
) -> Result<(), BankHashVerificationError>
[src]
&self,
slot: Slot,
ancestors: &Ancestors,
total_lamports: u64
) -> Result<(), BankHashVerificationError>
pub fn scan_slot_and_insert_dirty_pubkeys_into_uncleaned_pubkeys(
&self,
slot: Slot
)
[src]
pub fn scan_slot_and_insert_dirty_pubkeys_into_uncleaned_pubkeys(
&self,
slot: Slot
)
[src]Scan a slot in the account storage for dirty pubkeys and insert them into the list of uncleaned pubkeys
This function is called in Bank::drop() when the bank is not frozen, so that its pubkeys are considered for cleanup.
pub fn get_accounts_delta_hash(&self, slot: Slot) -> Hash
[src]
pub fn store_cached(
&self,
slot: Slot,
accounts: &[(&Pubkey, &AccountSharedData)]
)
[src]
&self,
slot: Slot,
accounts: &[(&Pubkey, &AccountSharedData)]
)
pub fn store_uncached(
&self,
slot: Slot,
accounts: &[(&Pubkey, &AccountSharedData)]
)
[src]
pub fn store_uncached(
&self,
slot: Slot,
accounts: &[(&Pubkey, &AccountSharedData)]
)
[src]Store the account update.
pub fn add_root(&self, slot: Slot)
[src]
pub fn get_snapshot_storages(&self, snapshot_slot: Slot) -> SnapshotStorages
[src]
pub fn generate_index(&self, limit_load_slot_count_from_snapshot: Option<usize>)
[src]
impl AccountsDb
[src]
impl AccountsDb
[src]Legacy shrink functions to support non-cached path. Should be able to be deleted after cache path is the only path.
pub fn process_stale_slot_v1(&self) -> usize
[src]
Trait Implementations
impl Debug for AccountsDb
[src]
impl Debug for AccountsDb
[src]Auto Trait Implementations
impl !RefUnwindSafe for AccountsDb
impl Send for AccountsDb
impl Sync for AccountsDb
impl Unpin for AccountsDb
impl !UnwindSafe for AccountsDb
Blanket Implementations
impl<T> AbiExample for T
[src]
impl<T> AbiExample for T
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,