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
pub fn new_with_config(
paths: Vec<PathBuf>,
cluster_type: &ClusterType,
account_indexes: AccountSecondaryIndexes,
caching_enabled: bool,
shrink_ratio: AccountShrinkThreshold
) -> Self
[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]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]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]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]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 load(
&self,
ancestors: &Ancestors,
pubkey: &Pubkey,
load_hint: LoadHint
) -> Option<(AccountSharedData, Slot)>
[src]pub fn load_with_fixed_root(
&self,
ancestors: &Ancestors,
pubkey: &Pubkey
) -> Option<(AccountSharedData, Slot)>
[src]pub fn load_without_fixed_root(
&self,
ancestors: &Ancestors,
pubkey: &Pubkey
) -> Option<(AccountSharedData, Slot)>
[src]pub fn load_account_hash(
&self,
ancestors: &Ancestors,
pubkey: &Pubkey,
max_root: Option<Slot>,
load_hint: LoadHint
) -> Option<Hash>
[src]pub fn create_drop_bank_callback(
&self,
pruned_banks_sender: DroppedSlotsSender
) -> SendDroppedBankCallback
[src]is_from_abs
is true if the caller is the AccountsBackgroundService
Remove the set of slots in remove_slots
from both the cache and storage. This requires
we know the contents of the slot are either:
- Completely in the cache
- Have been completely flushed from the cache
in order to guarantee that when this function returns, the contents of the slot have
been completely and not only partially removed. Thus synchronization with flush_slot_cache()
through self.remove_unrooted_slots_synchronization
is necessary.
pub fn update_accounts_hash_with_index_option(
&self,
use_index: bool,
debug_verify: bool,
slot: Slot,
ancestors: &Ancestors,
expected_capitalization: Option<u64>,
can_cached_slot_be_unflushed: bool
) -> (Hash, u64)
[src]pub fn calculate_accounts_hash_without_index(
storages: &SortedStorages<'_>,
thread_pool: Option<&ThreadPool>,
stats: HashStats,
check_hash: bool,
accounts_cache_and_ancestors: Option<(&AccountsCache, &Ancestors, &AccountsIndex<AccountInfo>)>
) -> Result<(Hash, u64), BankHashVerificationError>
[src]pub fn verify_bank_hash_and_lamports(
&self,
slot: Slot,
ancestors: &Ancestors,
total_lamports: u64,
test_hash_calculation: bool
) -> Result<(), BankHashVerificationError>
[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.
Store the account update.
pub fn get_snapshot_storages(
&self,
snapshot_slot: Slot,
ancestors: Option<&Ancestors>
) -> (SnapshotStorages, Vec<Slot>)
[src]Legacy shrink functions to support non-cached path. Should be able to be deleted after cache path is the only path.
Trait Implementations
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
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V