add 'drives' to AccountsIndexConfig (#19989)
This commit is contained in:
parent
f500c99a6d
commit
4e038e94fd
|
@ -1912,6 +1912,15 @@ fn main() {
|
||||||
if let Some(bins) = value_t!(matches, "accounts_index_bins", usize).ok() {
|
if let Some(bins) = value_t!(matches, "accounts_index_bins", usize).ok() {
|
||||||
accounts_index_config.bins = Some(bins);
|
accounts_index_config.bins = Some(bins);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
let mut accounts_index_paths = vec![]; // will be option
|
||||||
|
if accounts_index_paths.is_empty() {
|
||||||
|
accounts_index_paths = vec![ledger_path.join("accounts_index")];
|
||||||
|
}
|
||||||
|
accounts_index_config.drives = Some(accounts_index_paths);
|
||||||
|
}
|
||||||
|
|
||||||
let accounts_db_config = Some(AccountsDbConfig {
|
let accounts_db_config = Some(AccountsDbConfig {
|
||||||
index: Some(accounts_index_config),
|
index: Some(accounts_index_config),
|
||||||
accounts_hash_cache_path: Some(ledger_path.clone()),
|
accounts_hash_cache_path: Some(ledger_path.clone()),
|
||||||
|
|
|
@ -23,6 +23,7 @@ use std::{
|
||||||
Bound::{Excluded, Included, Unbounded},
|
Bound::{Excluded, Included, Unbounded},
|
||||||
Range, RangeBounds,
|
Range, RangeBounds,
|
||||||
},
|
},
|
||||||
|
path::PathBuf,
|
||||||
sync::{
|
sync::{
|
||||||
atomic::{AtomicBool, AtomicU64, Ordering},
|
atomic::{AtomicBool, AtomicU64, Ordering},
|
||||||
Arc, Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard,
|
Arc, Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard,
|
||||||
|
@ -38,10 +39,12 @@ pub const FLUSH_THREADS_TESTING: usize = 1;
|
||||||
pub const ACCOUNTS_INDEX_CONFIG_FOR_TESTING: AccountsIndexConfig = AccountsIndexConfig {
|
pub const ACCOUNTS_INDEX_CONFIG_FOR_TESTING: AccountsIndexConfig = AccountsIndexConfig {
|
||||||
bins: Some(BINS_FOR_TESTING),
|
bins: Some(BINS_FOR_TESTING),
|
||||||
flush_threads: Some(FLUSH_THREADS_TESTING),
|
flush_threads: Some(FLUSH_THREADS_TESTING),
|
||||||
|
drives: None,
|
||||||
};
|
};
|
||||||
pub const ACCOUNTS_INDEX_CONFIG_FOR_BENCHMARKS: AccountsIndexConfig = AccountsIndexConfig {
|
pub const ACCOUNTS_INDEX_CONFIG_FOR_BENCHMARKS: AccountsIndexConfig = AccountsIndexConfig {
|
||||||
bins: Some(BINS_FOR_BENCHMARKS),
|
bins: Some(BINS_FOR_BENCHMARKS),
|
||||||
flush_threads: Some(FLUSH_THREADS_TESTING),
|
flush_threads: Some(FLUSH_THREADS_TESTING),
|
||||||
|
drives: None,
|
||||||
};
|
};
|
||||||
pub type ScanResult<T> = Result<T, ScanError>;
|
pub type ScanResult<T> = Result<T, ScanError>;
|
||||||
pub type SlotList<T> = Vec<(Slot, T)>;
|
pub type SlotList<T> = Vec<(Slot, T)>;
|
||||||
|
@ -97,6 +100,7 @@ pub struct AccountSecondaryIndexesIncludeExclude {
|
||||||
pub struct AccountsIndexConfig {
|
pub struct AccountsIndexConfig {
|
||||||
pub bins: Option<usize>,
|
pub bins: Option<usize>,
|
||||||
pub flush_threads: Option<usize>,
|
pub flush_threads: Option<usize>,
|
||||||
|
pub drives: Option<Vec<PathBuf>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone)]
|
#[derive(Debug, Default, Clone)]
|
||||||
|
|
|
@ -2512,6 +2512,14 @@ pub fn main() {
|
||||||
accounts_index_config.bins = Some(bins);
|
accounts_index_config.bins = Some(bins);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
let mut accounts_index_paths = vec![]; // will be option soon
|
||||||
|
if accounts_index_paths.is_empty() {
|
||||||
|
accounts_index_paths = vec![ledger_path.join("accounts_index")];
|
||||||
|
}
|
||||||
|
accounts_index_config.drives = Some(accounts_index_paths);
|
||||||
|
}
|
||||||
|
|
||||||
let accounts_db_config = Some(AccountsDbConfig {
|
let accounts_db_config = Some(AccountsDbConfig {
|
||||||
index: Some(accounts_index_config),
|
index: Some(accounts_index_config),
|
||||||
accounts_hash_cache_path: Some(ledger_path.clone()),
|
accounts_hash_cache_path: Some(ledger_path.clone()),
|
||||||
|
|
Loading…
Reference in New Issue