Struct solana_runtime::accounts_db::AccountsDb[][src]

pub struct AccountsDb {
Show 14 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: AccountStorageaccounts_cache: AccountsCacheread_only_accounts_cache: ReadOnlyAccountsCachenext_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: ThreadPoolbank_hashes: RwLock<HashMap<Slot, BankHashInfo>>cluster_type: Option<ClusterType>account_indexes: AccountSecondaryIndexescaching_enabled: bool

Implementations

Notify the plugins of of account data when AccountsDb is restored from a snapshot. The data is streamed in the reverse order of the slots so that an account is only streamed once. At a slot, if the accounts is updated multiple times only the last write (with highest write_version) is notified.

Scan a specific slot through all the account storage in parallel

This should only be called after the Bank::drop() runs in bank.rs, See BANK_DROP_SAFETY comment below for more explanation. is_from_abs is true if the caller is the AccountsBackgroundService

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.

Legacy shrink functions to support non-cached path. Should be able to be deleted after cache path is the only path.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more