Skip to content

Commit

Permalink
Moves in_mem_accounts_index.rs into accounts_index directory (#35360)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Feb 29, 2024
1 parent c9c2fbb commit 83de6a5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 14 deletions.
10 changes: 5 additions & 5 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ use {
ZeroLamportAccounts,
},
accounts_index::{
AccountMapEntry, AccountSecondaryIndexes, AccountsIndex, AccountsIndexConfig,
AccountsIndexRootsStats, AccountsIndexScanResult, DiskIndexValue, IndexKey, IndexValue,
IsCached, RefCount, ScanConfig, ScanResult, SlotList, UpsertReclaim, ZeroLamport,
ACCOUNTS_INDEX_CONFIG_FOR_BENCHMARKS, ACCOUNTS_INDEX_CONFIG_FOR_TESTING,
in_mem_accounts_index::StartupStats, AccountMapEntry, AccountSecondaryIndexes,
AccountsIndex, AccountsIndexConfig, AccountsIndexRootsStats, AccountsIndexScanResult,
DiskIndexValue, IndexKey, IndexValue, IsCached, RefCount, ScanConfig, ScanResult,
SlotList, UpsertReclaim, ZeroLamport, ACCOUNTS_INDEX_CONFIG_FOR_BENCHMARKS,
ACCOUNTS_INDEX_CONFIG_FOR_TESTING,
},
accounts_index_storage::Startup,
accounts_partition::RentPayingAccountsByPartition,
Expand All @@ -62,7 +63,6 @@ use {
},
contains::Contains,
epoch_accounts_hash::EpochAccountsHashManager,
in_mem_accounts_index::StartupStats,
partitioned_rewards::{PartitionedEpochRewardsConfig, TestPartitionedEpochRewards},
pubkey_bins::PubkeyBinCalculator24,
read_only_accounts_cache::ReadOnlyAccountsCache,
Expand Down
3 changes: 2 additions & 1 deletion accounts-db/src/accounts_index.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
pub(crate) mod in_mem_accounts_index;
use {
crate::{
accounts_index_storage::{AccountsIndexStorage, Startup},
accounts_partition::RentPayingAccountsByPartition,
ancestors::Ancestors,
bucket_map_holder::{Age, AtomicAge, BucketMapHolder},
contains::Contains,
in_mem_accounts_index::{InMemAccountsIndex, InsertNewEntryResults, StartupStats},
inline_spl_token::{self, GenericTokenAccount},
inline_spl_token_2022,
pubkey_bins::PubkeyBinCalculator24,
rolling_bit_field::RollingBitField,
secondary_index::*,
},
in_mem_accounts_index::{InMemAccountsIndex, InsertNewEntryResults, StartupStats},
log::*,
rand::{thread_rng, Rng},
rayon::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> InMemAccountsIndex<T,

/// lookup 'pubkey' in index (in_mem or disk).
/// call 'callback' whether found or not
pub(crate) fn get_internal_inner<RT>(
pub(super) fn get_internal_inner<RT>(
&self,
pubkey: &K,
// return true if item should be added to in_mem cache
Expand All @@ -339,7 +339,7 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> InMemAccountsIndex<T,

/// lookup 'pubkey' in the index (in_mem or disk).
/// call 'callback' whether found or not
pub(crate) fn get_internal_cloned<RT>(
pub(super) fn get_internal_cloned<RT>(
&self,
pubkey: &K,
callback: impl for<'a> FnOnce(Option<AccountMapEntry<T>>) -> RT,
Expand All @@ -359,7 +359,7 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> InMemAccountsIndex<T,
/// then the disk entry *must* also be added to the in-mem cache.
///
/// Prefer `get_internal_inner()` or `get_internal_cloned()` for safe alternatives.
pub(crate) fn get_internal<RT>(
pub(super) fn get_internal<RT>(
&self,
pubkey: &K,
// return true if item should be added to in_mem cache
Expand Down
6 changes: 4 additions & 2 deletions accounts-db/src/accounts_index_storage.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use {
crate::{
accounts_index::{AccountsIndexConfig, DiskIndexValue, IndexValue},
accounts_index::{
in_mem_accounts_index::InMemAccountsIndex, AccountsIndexConfig, DiskIndexValue,
IndexValue,
},
bucket_map_holder::BucketMapHolder,
in_mem_accounts_index::InMemAccountsIndex,
waitable_condvar::WaitableCondvar,
},
std::{
Expand Down
6 changes: 4 additions & 2 deletions accounts-db/src/bucket_map_holder.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use {
crate::{
accounts_index::{AccountsIndexConfig, DiskIndexValue, IndexLimitMb, IndexValue},
accounts_index::{
in_mem_accounts_index::{InMemAccountsIndex, StartupStats},
AccountsIndexConfig, DiskIndexValue, IndexLimitMb, IndexValue,
},
bucket_map_holder_stats::BucketMapHolderStats,
in_mem_accounts_index::{InMemAccountsIndex, StartupStats},
waitable_condvar::WaitableCondvar,
},
solana_bucket_map::bucket_map::{BucketMap, BucketMapConfig},
Expand Down
1 change: 0 additions & 1 deletion accounts-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub mod cache_hash_data_stats;
pub mod contains;
pub mod epoch_accounts_hash;
pub mod hardened_unpack;
pub mod in_mem_accounts_index;
pub mod inline_spl_token;
pub mod inline_spl_token_2022;
pub mod partitioned_rewards;
Expand Down

0 comments on commit 83de6a5

Please sign in to comment.