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: AccountStorage
accounts_cache: AccountsCache
next_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: ThreadPool
bank_hashes: RwLock<HashMap<Slot, BankHashInfo>>
cluster_type: Option<ClusterType>
account_indexes: HashSet<AccountIndex>
caching_enabled: bool
Implementations
impl AccountsDb
[src]
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]
paths: Vec<PathBuf>,
cluster_type: &ClusterType,
account_indexes: HashSet<AccountIndex>,
caching_enabled: bool
) -> Self
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]
F: Fn(&mut A, Option<(&Pubkey, AccountSharedData, Slot)>),
A: Default,
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]
&self,
metric_name: &'static str,
ancestors: &Ancestors,
scan_func: F
) -> A where
F: Fn(&mut A, (&Pubkey, LoadedAccount<'_>, Slot)),
A: Default,
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]
&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>,
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]
&self,
ancestors: &Ancestors,
index_key: IndexKey,
scan_func: F
) -> A where
F: Fn(&mut A, Option<(&Pubkey, AccountSharedData, Slot)>),
A: Default,
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]
&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,
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]
&self,
ancestors: &Ancestors,
pubkey: &Pubkey
) -> Option<(AccountSharedData, Slot)>
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]
&self,
ancestors: &Ancestors,
pubkey: &Pubkey
) -> Option<(AccountSharedData, Slot)>
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]
slot: Slot,
account: &StoredAccountMeta<'_>,
cluster_type: &ClusterType
) -> Hash
pub fn hash_account(
slot: Slot,
account: &AccountSharedData,
pubkey: &Pubkey,
cluster_type: &ClusterType
) -> Hash
[src]
slot: Slot,
account: &AccountSharedData,
pubkey: &Pubkey,
cluster_type: &ClusterType
) -> Hash
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]
slot: Slot,
lamports: u64,
owner: &Pubkey,
executable: bool,
rent_epoch: Epoch,
data: &[u8],
pubkey: &Pubkey,
include_owner: bool
) -> Hash
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]
slot: Slot,
lamports: u64,
owner: &Pubkey,
executable: bool,
rent_epoch: Epoch,
data: &[u8],
pubkey: &Pubkey,
include_owner: bool
) -> Hash
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]
&self,
force_flush: bool,
requested_flush_root: Option<Slot>
)
pub fn checked_iterative_sum_for_capitalization(
total_cap: u64,
new_cap: u64
) -> u64
[src]
total_cap: u64,
new_cap: u64
) -> u64
pub fn checked_sum_for_capitalization<T: Iterator<Item = u64>>(
balances: T
) -> u64
[src]
balances: T
) -> u64
pub fn account_balance_for_capitalization(
lamports: u64,
_owner: &Pubkey,
_executable: bool
) -> u64
[src]
lamports: u64,
_owner: &Pubkey,
_executable: bool
) -> u64
pub fn get_accounts_hash(&self, slot: Slot) -> Hash
[src]
pub fn update_accounts_hash(
&self,
slot: Slot,
ancestors: &Ancestors
) -> (Hash, u64)
[src]
&self,
slot: Slot,
ancestors: &Ancestors
) -> (Hash, u64)
pub fn update_accounts_hash_test(
&self,
slot: Slot,
ancestors: &Ancestors
) -> (Hash, u64)
[src]
&self,
slot: Slot,
ancestors: &Ancestors
) -> (Hash, u64)
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]
&self,
use_index: bool,
debug_verify: bool,
slot: Slot,
ancestors: &Ancestors,
expected_capitalization: Option<u64>
) -> (Hash, u64)
pub fn calculate_accounts_hash_without_index(
storages: &[SnapshotStorage],
thread_pool: Option<&ThreadPool>
) -> (Hash, u64)
[src]
storages: &[SnapshotStorage],
thread_pool: Option<&ThreadPool>
) -> (Hash, u64)
pub fn verify_bank_hash_and_lamports(
&self,
slot: Slot,
ancestors: &Ancestors,
total_lamports: u64
) -> Result<(), BankHashVerificationError>
[src]
&self,
slot: Slot,
ancestors: &Ancestors,
total_lamports: u64
) -> Result<(), BankHashVerificationError>
pub fn get_accounts_delta_hash(&self, slot: Slot) -> Hash
[src]
pub fn store_cached(
&self,
slot: Slot,
accounts: &[(&Pubkey, &AccountSharedData)]
)
[src]
&self,
slot: Slot,
accounts: &[(&Pubkey, &AccountSharedData)]
)
pub fn store_uncached(
&self,
slot: Slot,
accounts: &[(&Pubkey, &AccountSharedData)]
)
[src]
&self,
slot: Slot,
accounts: &[(&Pubkey, &AccountSharedData)]
)
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]
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 Default for AccountsDb
[src]
impl Default for AccountsDb
[src]Auto Trait Implementations
impl !RefUnwindSafe for AccountsDb
impl !RefUnwindSafe for AccountsDb
impl Send for AccountsDb
impl Send for AccountsDb
impl Sync for AccountsDb
impl Sync for AccountsDb
impl Unpin for AccountsDb
impl Unpin for AccountsDb
impl !UnwindSafe for AccountsDb
impl !UnwindSafe for AccountsDb
Blanket Implementations
impl<T> AbiExample for T
[src]
impl<T> AbiExample for T
[src]impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,