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

pub struct AccountsDb {
    pub accounts_index: AccountsIndex<AccountInfo>,
    pub storage: AccountStorage,
    pub accounts_cache: AccountsCache,
    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: HashSet<AccountIndex>,
    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: AccountsCachenext_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: HashSet<AccountIndex>caching_enabled: bool

Implementations

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: HashSet<AccountIndex>,
    caching_enabled: bool
) -> Self
[src]

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 clean_accounts(&self, max_clean_root: Option<Slot>)[src]

pub fn shrink_candidate_slots(&self) -> usize[src]

pub fn shrink_all_slots(&self)[src]

pub fn scan_accounts<F, A>(&self, ancestors: &Ancestors, scan_func: F) -> A where
    F: Fn(&mut A, Option<(&Pubkey, Account, 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, Account, Slot)>),
    A: Default,
    R: RangeBounds<Pubkey>, 
[src]

pub fn index_scan_accounts<F, A>(
    &self,
    ancestors: &Ancestors,
    index_key: IndexKey,
    scan_func: F
) -> A where
    F: Fn(&mut A, Option<(&Pubkey, Account, 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]

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
) -> Option<(Account, Slot)>
[src]

pub fn load_account_hash(&self, ancestors: &Ancestors, pubkey: &Pubkey) -> Hash[src]

pub fn load_slow(
    &self,
    ancestors: &Ancestors,
    pubkey: &Pubkey
) -> Option<(Account, Slot)>
[src]

pub fn purge_slot(&self, slot: Slot)[src]

pub fn remove_unrooted_slot(&self, remove_slot: Slot)[src]

pub fn hash_stored_account(
    slot: Slot,
    account: &StoredAccountMeta<'_>,
    cluster_type: &ClusterType
) -> Hash
[src]

pub fn hash_account(
    slot: Slot,
    account: &Account,
    pubkey: &Pubkey,
    cluster_type: &ClusterType
) -> Hash
[src]

pub fn hash_account_data(
    slot: Slot,
    lamports: u64,
    owner: &Pubkey,
    executable: bool,
    rent_epoch: Epoch,
    data: &[u8],
    pubkey: &Pubkey,
    include_owner: bool
) -> Hash
[src]

pub fn blake3_hash_account_data(
    slot: Slot,
    lamports: u64,
    owner: &Pubkey,
    executable: bool,
    rent_epoch: Epoch,
    data: &[u8],
    pubkey: &Pubkey,
    include_owner: bool
) -> Hash
[src]

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]

pub fn compute_merkle_root_and_capitalization(
    hashes: Vec<(Pubkey, Hash, u64)>,
    fanout: usize
) -> (Hash, u64)
[src]

pub fn checked_cast_for_capitalization(balance: u128) -> u64[src]

pub fn checked_iterative_sum_for_capitalization(
    total_cap: u64,
    new_cap: u64
) -> u64
[src]

pub fn checked_sum_for_capitalization<T: Iterator<Item = u64>>(
    balances: T
) -> u64
[src]

pub fn account_balance_for_capitalization(
    lamports: u64,
    owner: &Pubkey,
    executable: bool,
    simple_capitalization_enabled: bool
) -> u64
[src]

pub fn get_accounts_hash(&self, slot: Slot) -> Hash[src]

pub fn update_accounts_hash(
    &self,
    slot: Slot,
    ancestors: &Ancestors,
    simple_capitalization_enabled: bool
) -> (Hash, u64)
[src]

pub fn update_accounts_hash_test(
    &self,
    slot: Slot,
    ancestors: &Ancestors,
    simple_capitalization_enabled: bool
) -> (Hash, u64)
[src]

pub fn update_accounts_hash_with_index_option(
    &self,
    use_index: bool,
    debug_verify: bool,
    slot: Slot,
    ancestors: &Ancestors,
    simple_capitalization_enabled: bool,
    expected_capitalization: Option<u64>
) -> (Hash, u64)
[src]

pub fn calculate_accounts_hash_without_index(
    storages: &[SnapshotStorage],
    simple_capitalization_enabled: bool,
    thread_pool: Option<&ThreadPool>
) -> (Hash, u64)
[src]

pub fn verify_bank_hash_and_lamports(
    &self,
    slot: Slot,
    ancestors: &Ancestors,
    total_lamports: u64,
    simple_capitalization_enabled: bool
) -> Result<(), BankHashVerificationError>
[src]

pub fn get_accounts_delta_hash(&self, slot: Slot) -> Hash[src]

pub fn store_cached(&self, slot: Slot, accounts: &[(&Pubkey, &Account)])[src]

pub fn store_uncached(&self, slot: Slot, accounts: &[(&Pubkey, &Account)])[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)[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 Default 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> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MaybeDebug for T where
    T: Debug
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> WithSubscriber for T[src]