[][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 thread_pool: ThreadPool,
    pub bank_hashes: RwLock<HashMap<Slot, BankHashInfo>>,
    // 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

thread_pool: ThreadPool

Thread pool used for par_iter

bank_hashes: RwLock<HashMap<Slot, BankHashInfo>>

Methods

impl AccountsDB[src]

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

pub fn accounts_from_stream<R: Read, P: AsRef<Path>>(
    &self,
    stream: &mut BufReader<R>,
    stream_append_vecs_path: P
) -> Result<(), IOError>
[src]

pub fn clean_accounts(&self)[src]

pub fn scan_accounts<F, A>(
    &self,
    ancestors: &HashMap<Slot, usize>,
    scan_func: F
) -> A where
    F: Fn(&mut A, Option<(&Pubkey, Account, Slot)>),
    A: Default
[src]

pub fn scan_account_storage<F, B>(&self, slot_id: 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: &HashMap<Slot, usize>,
    accounts_index: &AccountsIndex<AccountInfo>,
    pubkey: &Pubkey
) -> Option<(Account, Slot)>
[src]

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

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

pub fn hash_stored_account(slot: Slot, account: &StoredAccount) -> Hash[src]

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

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

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

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

pub fn update_accounts_hash(
    &self,
    slot: Slot,
    ancestors: &HashMap<Slot, usize>
) -> Hash
[src]

pub fn verify_bank_hash(
    &self,
    slot: Slot,
    ancestors: &HashMap<Slot, usize>
) -> Result<(), BankHashVerificationError>
[src]

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

pub fn freeze_accounts(
    &mut self,
    ancestors: &HashMap<Slot, usize>,
    account_pubkeys: &[Pubkey]
)
[src]

pub fn store(&self, slot_id: 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]

Trait Implementations

impl Debug for AccountsDB[src]

impl Default for AccountsDB[src]

Auto Trait Implementations

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> Clear for T where
    T: InitializableFromZeroed + ?Sized

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

impl<T> InitializableFromZeroed for T where
    T: Default

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>,