Rename AccountsPacakge to SnapshotPackage and AccountsPackagePre to AccountsPackage (#19231)

Renaming these types to better communicate their usages, which will
further diverge as incremental snapshot support is added.

With the new names, AccountsPacakge now refers to the type between
AccountsBackgroundProcess and AccountsHashVerifier, and SnapshotPackage
refers to the type between AccountsHashVerifier and
SnapshotPackagerService.
This commit is contained in:
Brooks Prumo
2021-08-13 16:08:09 -05:00
committed by GitHub
parent 32501866b7
commit 176036aa58
5 changed files with 78 additions and 76 deletions

View File

@ -66,7 +66,7 @@ mod tests {
genesis_utils::{create_genesis_config, GenesisConfigInfo},
snapshot_archive_info::FullSnapshotArchiveInfo,
snapshot_config::SnapshotConfig,
snapshot_package::AccountsPackagePre,
snapshot_package::AccountsPackage,
snapshot_utils::{
self, ArchiveFormat, SnapshotVersion, DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
},
@ -275,7 +275,7 @@ mod tests {
let snapshot_path = &snapshot_config.snapshot_path;
let last_bank_snapshot_info = snapshot_utils::get_highest_bank_snapshot_info(snapshot_path)
.expect("no snapshots found in path");
let snapshot_package = AccountsPackagePre::new_full_snapshot_package(
let accounts_package = AccountsPackage::new_for_full_snapshot(
last_bank,
&last_bank_snapshot_info,
snapshot_path,
@ -287,8 +287,8 @@ mod tests {
None,
)
.unwrap();
let snapshot_package = snapshot_utils::process_accounts_package_pre(
snapshot_package,
let snapshot_package = snapshot_utils::process_accounts_package(
accounts_package,
Some(last_bank.get_thread_pool()),
None,
);
@ -508,18 +508,17 @@ mod tests {
let _package_receiver = std::thread::Builder::new()
.name("package-receiver".to_string())
.spawn(move || {
while let Ok(mut snapshot_package) = receiver.recv() {
while let Ok(mut accounts_package) = receiver.recv() {
// Only package the latest
while let Ok(new_snapshot_package) = receiver.try_recv() {
snapshot_package = new_snapshot_package;
while let Ok(new_accounts_package) = receiver.try_recv() {
accounts_package = new_accounts_package;
}
let snapshot_package =
solana_runtime::snapshot_utils::process_accounts_package_pre(
snapshot_package,
Some(&thread_pool),
None,
);
let snapshot_package = solana_runtime::snapshot_utils::process_accounts_package(
accounts_package,
Some(&thread_pool),
None,
);
*pending_snapshot_package.lock().unwrap() = Some(snapshot_package);
}