Skip to content

Commit

Permalink
Rename open_with_access_type() to open_with_options() (#22123)
Browse files Browse the repository at this point in the history
  • Loading branch information
yhchiang-sol committed Jan 7, 2022
1 parent b11d3b5 commit 5771c36
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
4 changes: 3 additions & 1 deletion core/tests/ledger_cleanup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ mod tests {
solana_core::ledger_cleanup_service::LedgerCleanupService,
solana_ledger::{
blockstore::{make_many_slot_shreds, Blockstore},
blockstore_db::BlockstoreOptions,
get_tmp_ledger_path,
},
solana_measure::measure::Measure,
Expand Down Expand Up @@ -283,7 +284,8 @@ mod tests {
solana_logger::setup_with("error,ledger_cleanup::tests=info");

let ledger_path = get_tmp_ledger_path!();
let mut blockstore = Blockstore::open(&ledger_path).unwrap();
let mut blockstore =
Blockstore::open_with_options(&ledger_path, BlockstoreOptions::default()).unwrap();
let config = get_benchmark_config();
if config.no_compaction {
blockstore.set_no_compaction(true);
Expand Down
2 changes: 1 addition & 1 deletion ledger-tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ fn open_blockstore(
access_type: AccessType,
wal_recovery_mode: Option<BlockstoreRecoveryMode>,
) -> Blockstore {
match Blockstore::open_with_access_type(
match Blockstore::open_with_options(
ledger_path,
BlockstoreOptions {
access_type,
Expand Down
9 changes: 3 additions & 6 deletions ledger/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,7 @@ impl Blockstore {
Self::do_open(ledger_path, BlockstoreOptions::default())
}

pub fn open_with_access_type(
ledger_path: &Path,
options: BlockstoreOptions,
) -> Result<Blockstore> {
pub fn open_with_options(ledger_path: &Path, options: BlockstoreOptions) -> Result<Blockstore> {
Self::do_open(ledger_path, options)
}

Expand Down Expand Up @@ -457,7 +454,7 @@ impl Blockstore {
ledger_path: &Path,
options: BlockstoreOptions,
) -> Result<BlockstoreSignals> {
let mut blockstore = Self::open_with_access_type(ledger_path, options)?;
let mut blockstore = Self::open_with_options(ledger_path, options)?;
let (ledger_signal_sender, ledger_signal_receiver) = sync_channel(1);
let (completed_slots_sender, completed_slots_receiver) =
sync_channel(MAX_COMPLETED_SLOTS_IN_CHANNEL);
Expand Down Expand Up @@ -3755,7 +3752,7 @@ pub fn create_new_ledger(
genesis_config.write(ledger_path)?;

// Fill slot 0 with ticks that link back to the genesis_config to bootstrap the ledger.
let blockstore = Blockstore::open_with_access_type(
let blockstore = Blockstore::open_with_options(
ledger_path,
BlockstoreOptions {
access_type,
Expand Down
2 changes: 1 addition & 1 deletion local-cluster/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub fn remove_tower(tower_path: &Path, node_pubkey: &Pubkey) {
}

pub fn open_blockstore(ledger_path: &Path) -> Blockstore {
Blockstore::open_with_access_type(
Blockstore::open_with_options(
ledger_path,
BlockstoreOptions {
access_type: AccessType::TryPrimaryThenSecondary,
Expand Down
2 changes: 1 addition & 1 deletion local-cluster/tests/local_cluster_flakey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ fn do_test_optimistic_confirmation_violation_with_or_without_tower(with_tower: b

if let Some((last_vote, _)) = last_vote_in_tower(&val_a_ledger_path, &validator_a_pubkey) {
a_votes.push(last_vote);
let blockstore = Blockstore::open_with_access_type(
let blockstore = Blockstore::open_with_options(
&val_a_ledger_path,
BlockstoreOptions {
access_type: AccessType::TryPrimaryThenSecondary,
Expand Down
2 changes: 1 addition & 1 deletion replica-node/src/replica_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ fn start_client_rpc_services(
block_commitment_cache,
} = bank_info;
let blockstore = Arc::new(
Blockstore::open_with_access_type(
Blockstore::open_with_options(
&replica_config.ledger_path,
BlockstoreOptions {
enforce_ulimit_nofile: false,
Expand Down

0 comments on commit 5771c36

Please sign in to comment.