[][src]Struct solana_runtime::accounts_db::AccountsDB

pub struct AccountsDB {
    pub accounts_index: RwLock<AccountsIndex<AccountInfo>>,
    pub storage: RwLock<AccountStorage>,
    pub next_id: AtomicUsize,
    pub shrink_candidate_slots: Mutex<Vec<Slot>>,
    pub thread_pool: ThreadPool,
    pub thread_pool_clean: ThreadPool,
    pub bank_hashes: RwLock<HashMap<Slot, BankHashInfo>>,
    pub cluster_type: Option<ClusterType>,
    // some fields omitted
}

Fields

accounts_index: RwLock<AccountsIndex<AccountInfo>>

Keeps tracks of index into AppendVec on a per slot basis

storage: RwLock<AccountStorage>next_id: AtomicUsize

distribute the accounts across storage lists

shrink_candidate_slots: Mutex<Vec<Slot>>thread_pool: ThreadPool

Thread pool used for par_iter

thread_pool_clean: ThreadPoolbank_hashes: RwLock<HashMap<Slot, BankHashInfo>>cluster_type: Option<ClusterType>

Implementations

impl AccountsDB[src]

pub fn new(paths: Vec<PathBuf>, cluster_type: &ClusterType) -> Self[src]

pub fn clean_accounts(&self)[src]

pub fn process_dead_slots<'a>(
    &'a self,
    dead_slots_w: Option<RwLockWriteGuard<'a, HashSet<Slot>>>
)
[src]

pub fn process_stale_slot(&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 range_scan_accounts<F, A, R>(
    &self,
    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 scan_account_storage<F, B>(&self, slot: Slot, scan_func: F) -> Vec<B> where
    F: Fn(&StoredAccount<'_>, AppendVecId, &mut B) + Send + Sync,
    B: Send + Default
[src]

Scan a specific slot through all the account storage in parallel with sequential read

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

pub fn load(
    storage: &AccountStorage,
    ancestors: &Ancestors,
    accounts_index: &AccountsIndex<AccountInfo>,
    pubkey: &Pubkey
) -> Option<(Account, Slot)>
[src]

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

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

pub fn purge_slots(&self, slots: &HashSet<Slot>)[src]

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

pub fn hash_stored_account(
    slot: Slot,
    account: &StoredAccount<'_>,
    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 compute_merkle_root(
    hashes: Vec<(Pubkey, Hash, u64)>,
    fanout: usize
) -> Hash
[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
) -> u64
[src]

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

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

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

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

pub fn clean_dead_slots(&self, dead_slots: &HashSet<Slot>)[src]

pub fn store(&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]

Trait Implementations

impl Debug for AccountsDB[src]

impl Default for AccountsDB[src]

Auto Trait Implementations

Blanket Implementations

impl<T> AbiExample for T[src]

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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

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<V, T> VZip<V> for T where
    V: MultiLane<T>,