Struct solana_runtime::accounts_db::AccountsDb [−][src]
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]
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 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]
F: Fn(&mut A, Option<(&Pubkey, Account, 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, Account, 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, Account, 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, Account, Slot)>),
A: Default,
[src]
&self,
ancestors: &Ancestors,
index_key: IndexKey,
scan_func: F
) -> A where
F: Fn(&mut A, Option<(&Pubkey, Account, 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<(Account, Slot)>
[src]
&self,
ancestors: &Ancestors,
pubkey: &Pubkey
) -> Option<(Account, Slot)>
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]
&self,
ancestors: &Ancestors,
pubkey: &Pubkey
) -> Option<(Account, 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: &Account,
pubkey: &Pubkey,
cluster_type: &ClusterType
) -> Hash
[src]
slot: Slot,
account: &Account,
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 compute_merkle_root_and_capitalization(
hashes: Vec<(Pubkey, Hash, u64)>,
fanout: usize
) -> (Hash, u64)
[src]
hashes: Vec<(Pubkey, Hash, u64)>,
fanout: usize
) -> (Hash, u64)
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]
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,
simple_capitalization_enabled: bool
) -> u64
[src]
lamports: u64,
owner: &Pubkey,
executable: bool,
simple_capitalization_enabled: bool
) -> u64
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]
&self,
slot: Slot,
ancestors: &Ancestors,
simple_capitalization_enabled: bool
) -> (Hash, u64)
pub fn update_accounts_hash_test(
&self,
slot: Slot,
ancestors: &Ancestors,
simple_capitalization_enabled: bool
) -> (Hash, u64)
[src]
&self,
slot: Slot,
ancestors: &Ancestors,
simple_capitalization_enabled: bool
) -> (Hash, u64)
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]
&self,
use_index: bool,
debug_verify: bool,
slot: Slot,
ancestors: &Ancestors,
simple_capitalization_enabled: bool,
expected_capitalization: Option<u64>
) -> (Hash, u64)
pub fn calculate_accounts_hash_without_index(
storages: &[SnapshotStorage],
simple_capitalization_enabled: bool,
thread_pool: Option<&ThreadPool>
) -> (Hash, u64)
[src]
storages: &[SnapshotStorage],
simple_capitalization_enabled: bool,
thread_pool: Option<&ThreadPool>
) -> (Hash, u64)
pub fn verify_bank_hash_and_lamports(
&self,
slot: Slot,
ancestors: &Ancestors,
total_lamports: u64,
simple_capitalization_enabled: bool
) -> Result<(), BankHashVerificationError>
[src]
&self,
slot: Slot,
ancestors: &Ancestors,
total_lamports: u64,
simple_capitalization_enabled: bool
) -> Result<(), BankHashVerificationError>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> 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> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> MaybeDebug for T where
T: Debug,
[src]
T: Debug,
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
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]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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]
impl<T> Typeable for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,