add --accounts-index-path to be used by disk accounts index (#19710)

* add --accounts-index-paths to be used by disk accounts index

* add multiple and default to help
This commit is contained in:
Jeff Washington (jwash) 2021-09-28 11:07:47 -05:00 committed by GitHub
parent 320beb76f6
commit 5810568c65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 2 deletions

View File

@ -891,6 +891,16 @@ fn main() {
.value_name("PATHS")
.takes_value(true)
.help("Comma separated persistent accounts location");
let accounts_index_path_arg = Arg::with_name("accounts_index_path")
.long("accounts-index-path")
.value_name("PATH")
.takes_value(true)
.multiple(true)
.help(
"Persistent accounts-index location. \
May be specified multiple times. \
[default: [ledger]/accounts_index]",
);
let accounts_db_test_hash_calculation_arg = Arg::with_name("accounts_db_test_hash_calculation")
.long("accounts-db-test-hash-calculation")
.help("Enable hash calculation test");
@ -1195,6 +1205,7 @@ fn main() {
.about("Verify the ledger")
.arg(&no_snapshot_arg)
.arg(&account_paths_arg)
.arg(&accounts_index_path_arg)
.arg(&halt_at_slot_arg)
.arg(&limit_load_slot_count_from_snapshot_arg)
.arg(&accounts_index_bins)
@ -1925,7 +1936,15 @@ fn main() {
}
{
let mut accounts_index_paths = vec![]; // will be option
let mut accounts_index_paths: Vec<PathBuf> =
if arg_matches.is_present("accounts_index_path") {
values_t_or_exit!(arg_matches, "accounts_index_path", String)
.into_iter()
.map(PathBuf::from)
.collect()
} else {
vec![]
};
if accounts_index_paths.is_empty() {
accounts_index_paths = vec![ledger_path.join("accounts_index")];
}

View File

@ -2011,6 +2011,16 @@ pub fn main() {
.takes_value(true)
.help("Number of bins to divide the accounts index into"),
)
.arg(
Arg::with_name("accounts_index_path")
.long("accounts-index-path")
.value_name("PATH")
.takes_value(true)
.multiple(true)
.help("Persistent accounts-index location. \
May be specified multiple times. \
[default: [ledger]/accounts_index]"),
)
.arg(
Arg::with_name("accounts_db_test_hash_calculation")
.long("accounts-db-test-hash-calculation")
@ -2530,7 +2540,14 @@ pub fn main() {
}
{
let mut accounts_index_paths = vec![]; // will be option soon
let mut accounts_index_paths: Vec<PathBuf> = if matches.is_present("accounts_index_path") {
values_t_or_exit!(matches, "accounts_index_path", String)
.into_iter()
.map(PathBuf::from)
.collect()
} else {
vec![]
};
if accounts_index_paths.is_empty() {
accounts_index_paths = vec![ledger_path.join("accounts_index")];
}