pub struct AccountsIndex<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> {
pub account_maps: Box<[Arc<InMemAccountsIndex<T, U>>]>,
pub bin_calculator: PubkeyBinCalculator24,
pub roots_tracker: RwLock<RootsTracker>,
pub removed_bank_ids: Mutex<HashSet<BankId>>,
pub scan_results_limit_bytes: Option<usize>,
pub purge_older_root_entries_one_slot_list: AtomicUsize,
pub roots_added: AtomicUsize,
pub roots_removed: AtomicUsize,
pub active_scans: AtomicUsize,
pub max_distance_to_min_scan_slot: AtomicU64,
/* private fields */
}agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Expand description
T: account info type to interact in in-memory items U: account info type to be persisted to disk
Fields§
§account_maps: Box<[Arc<InMemAccountsIndex<T, U>>]>agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.bin_calculator: PubkeyBinCalculator24agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.roots_tracker: RwLock<RootsTracker>agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.removed_bank_ids: Mutex<HashSet<BankId>>agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.scan_results_limit_bytes: Option<usize>agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.when a scan’s accumulated data exceeds this limit, abort the scan
purge_older_root_entries_one_slot_list: AtomicUsizeagave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.roots_added: AtomicUsizeagave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.§roots added since last check
roots_removed: AtomicUsizeagave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.§roots removed since last check
active_scans: AtomicUsizeagave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.§scans active currently
max_distance_to_min_scan_slot: AtomicU64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.§of slots between latest max and latest scan
Implementations§
Source§impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> AccountsIndex<T, U>
impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> AccountsIndex<T, U>
pub fn default_for_tests() -> Self
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn new(config: &AccountsIndexConfig, exit: Arc<AtomicBool>) -> Self
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Sourcepub fn is_disk_index_enabled(&self) -> bool
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn is_disk_index_enabled(&self) -> bool
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.is the accounts index using disk as a backing store
Sourcepub fn get_and_then<R>(
&self,
pubkey: &Pubkey,
callback: impl FnOnce(Option<&AccountMapEntry<T>>) -> (bool, R),
) -> R
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn get_and_then<R>( &self, pubkey: &Pubkey, callback: impl FnOnce(Option<&AccountMapEntry<T>>) -> (bool, R), ) -> R
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Gets the index’s entry for pubkey and applies callback to it
If callback’s boolean return value is true, add this entry to the in-mem cache.
Sourcepub fn contains(&self, pubkey: &Pubkey) -> bool
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn contains(&self, pubkey: &Pubkey) -> bool
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Is pubkey in the index?
Sourcepub fn handle_dead_keys(
&self,
dead_keys: &[Pubkey],
account_indexes: &AccountSecondaryIndexes,
) -> HashSet<Pubkey>
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn handle_dead_keys( &self, dead_keys: &[Pubkey], account_indexes: &AccountSecondaryIndexes, ) -> HashSet<Pubkey>
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Remove keys from the account index if the key’s slot list is empty. Returns the keys that were removed from the index. These keys should not be accessed again in the current code path.
pub fn get_rooted_entries( &self, slot_list: &[(Slot, T)], max_inclusive: Option<Slot>, ) -> SlotList<T>
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn min_ongoing_scan_root(&self) -> Option<Slot>
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn get_startup_remaining_items_to_flush_estimate(&self) -> usize
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn get_index_key_size( &self, index: &AccountIndex, index_key: &Pubkey, ) -> Option<usize>
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn bins(&self) -> usize
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Sourcepub fn upsert(
&self,
new_slot: Slot,
old_slot: Slot,
pubkey: &Pubkey,
account: &impl ReadableAccount,
account_indexes: &AccountSecondaryIndexes,
account_info: T,
reclaims: &mut ReclaimsSlotList<T>,
reclaim: UpsertReclaim,
)
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn upsert( &self, new_slot: Slot, old_slot: Slot, pubkey: &Pubkey, account: &impl ReadableAccount, account_indexes: &AccountSecondaryIndexes, account_info: T, reclaims: &mut ReclaimsSlotList<T>, reclaim: UpsertReclaim, )
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Updates the given pubkey at the given slot with the new account information. on return, the index’s previous account info may be returned in ‘reclaims’ depending on ‘previous_slot_entry_was_cached’
pub fn ref_count_from_storage(&self, pubkey: &Pubkey) -> RefCount
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Sourcepub fn clean_rooted_entries(
&self,
pubkey: &Pubkey,
reclaims: &mut ReclaimsSlotList<T>,
max_clean_root_inclusive: Option<Slot>,
) -> bool
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn clean_rooted_entries( &self, pubkey: &Pubkey, reclaims: &mut ReclaimsSlotList<T>, max_clean_root_inclusive: Option<Slot>, ) -> bool
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.return true if pubkey was removed from the accounts index or does not exist in the accounts index This means it should NOT be unref’d later.
Sourcepub fn clean_and_unref_rooted_entries_by_bin(
&self,
pubkeys_by_bin: &[Pubkey],
) -> ReclaimsSlotList<T>
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn clean_and_unref_rooted_entries_by_bin( &self, pubkeys_by_bin: &[Pubkey], ) -> ReclaimsSlotList<T>
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Cleans and unrefs all older rooted entries for each pubkey in the accounts index. Calls passed in callback on the remaining slot entry All pubkeys must be from a single bin
Sourcepub fn get_rooted_from_list<'a>(
&self,
slots: impl Iterator<Item = &'a Slot>,
) -> Vec<Slot> ⓘ
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn get_rooted_from_list<'a>( &self, slots: impl Iterator<Item = &'a Slot>, ) -> Vec<Slot> ⓘ
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Given a list of slots, return a new list of only the slots that are rooted
pub fn is_alive_root(&self, slot: Slot) -> bool
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn add_root(&self, slot: Slot)
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn max_root_inclusive(&self) -> Slot
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Sourcepub fn clean_dead_slot(&self, slot: Slot) -> bool
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn clean_dead_slot(&self, slot: Slot) -> bool
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Remove the slot when the storage for the slot is freed Accounts no longer reference this slot. return true if slot was a root
pub fn all_alive_roots(&self) -> Vec<Slot> ⓘ
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Trait Implementations§
Auto Trait Implementations§
impl<T, U> !Freeze for AccountsIndex<T, U>
impl<T, U> !RefUnwindSafe for AccountsIndex<T, U>
impl<T, U> Send for AccountsIndex<T, U>
impl<T, U> Sync for AccountsIndex<T, U>
impl<T, U> Unpin for AccountsIndex<T, U>
impl<T, U> !UnwindSafe for AccountsIndex<T, U>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more