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 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 expected_cluster_type(&self) -> ClusterType[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, 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 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]

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

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

pub fn load_slow(
    &self,
    ancestors: &Ancestors,
    pubkey: &Pubkey
) -> Option<(AccountSharedData, 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: &AccountSharedData,
    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 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
) -> 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 update_accounts_hash_test(
    &self,
    slot: Slot,
    ancestors: &Ancestors
) -> (Hash, u64)
[src]

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

pub fn calculate_accounts_hash_without_index(
    storages: &[SnapshotStorage],
    thread_pool: Option<&ThreadPool>
) -> (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 store_cached(
    &self,
    slot: Slot,
    accounts: &[(&Pubkey, &AccountSharedData)]
)
[src]

pub fn store_uncached(
    &self,
    slot: Slot,
    accounts: &[(&Pubkey, &AccountSharedData)]
)
[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.

Trait Implementations

impl Debug for AccountsDb[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for AccountsDb[src]

fn default() -> Self[src]

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

Auto Trait Implementations

Blanket Implementations

impl<T> AbiExample for T[src]

pub default fn example() -> T[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

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

fn in_current_span(self) -> Instrumented<Self>[src]

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

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

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

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V