From 83de6a5930dc507d8db703033dc6280f4758118f Mon Sep 17 00:00:00 2001 From: Brooks Date: Thu, 29 Feb 2024 06:51:18 -0500 Subject: [PATCH] Moves in_mem_accounts_index.rs into accounts_index directory (#35360) --- accounts-db/src/accounts_db.rs | 10 +++++----- accounts-db/src/accounts_index.rs | 3 ++- .../src/{ => accounts_index}/in_mem_accounts_index.rs | 6 +++--- accounts-db/src/accounts_index_storage.rs | 6 ++++-- accounts-db/src/bucket_map_holder.rs | 6 ++++-- accounts-db/src/lib.rs | 1 - 6 files changed, 18 insertions(+), 14 deletions(-) rename accounts-db/src/{ => accounts_index}/in_mem_accounts_index.rs (99%) diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index f077f7a41..2909def64 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -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, @@ -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, diff --git a/accounts-db/src/accounts_index.rs b/accounts-db/src/accounts_index.rs index 7c4baf1ee..bd57e0803 100644 --- a/accounts-db/src/accounts_index.rs +++ b/accounts-db/src/accounts_index.rs @@ -1,3 +1,4 @@ +pub(crate) mod in_mem_accounts_index; use { crate::{ accounts_index_storage::{AccountsIndexStorage, Startup}, @@ -5,13 +6,13 @@ use { 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::{ diff --git a/accounts-db/src/in_mem_accounts_index.rs b/accounts-db/src/accounts_index/in_mem_accounts_index.rs similarity index 99% rename from accounts-db/src/in_mem_accounts_index.rs rename to accounts-db/src/accounts_index/in_mem_accounts_index.rs index 918a5c41f..3df05ee5a 100644 --- a/accounts-db/src/in_mem_accounts_index.rs +++ b/accounts-db/src/accounts_index/in_mem_accounts_index.rs @@ -326,7 +326,7 @@ impl + Into> InMemAccountsIndex( + pub(super) fn get_internal_inner( &self, pubkey: &K, // return true if item should be added to in_mem cache @@ -339,7 +339,7 @@ impl + Into> InMemAccountsIndex( + pub(super) fn get_internal_cloned( &self, pubkey: &K, callback: impl for<'a> FnOnce(Option>) -> RT, @@ -359,7 +359,7 @@ impl + Into> InMemAccountsIndex( + pub(super) fn get_internal( &self, pubkey: &K, // return true if item should be added to in_mem cache diff --git a/accounts-db/src/accounts_index_storage.rs b/accounts-db/src/accounts_index_storage.rs index db5ae2b35..3a654c84c 100644 --- a/accounts-db/src/accounts_index_storage.rs +++ b/accounts-db/src/accounts_index_storage.rs @@ -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::{ diff --git a/accounts-db/src/bucket_map_holder.rs b/accounts-db/src/bucket_map_holder.rs index fc7bf3ba4..bc7e19112 100644 --- a/accounts-db/src/bucket_map_holder.rs +++ b/accounts-db/src/bucket_map_holder.rs @@ -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}, diff --git a/accounts-db/src/lib.rs b/accounts-db/src/lib.rs index 792de99c4..7883f852d 100644 --- a/accounts-db/src/lib.rs +++ b/accounts-db/src/lib.rs @@ -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;