2020-04-03 13:13:49 -07:00
|
|
|
use crate::bank_forks::CompressionType;
|
2020-06-17 08:27:03 -07:00
|
|
|
use crate::{accounts_db::SnapshotStorages, bank::BankSlotDelta};
|
2020-02-10 03:11:37 -08:00
|
|
|
use solana_sdk::clock::Slot;
|
2020-02-20 11:46:13 -08:00
|
|
|
use solana_sdk::hash::Hash;
|
2020-02-18 09:02:29 -08:00
|
|
|
use std::{
|
|
|
|
path::PathBuf,
|
2020-02-20 22:27:55 -08:00
|
|
|
sync::mpsc::{Receiver, SendError, Sender},
|
2020-02-18 09:02:29 -08:00
|
|
|
};
|
2019-08-07 13:12:53 -07:00
|
|
|
use tempfile::TempDir;
|
2019-07-31 17:58:10 -07:00
|
|
|
|
2020-04-16 15:12:20 -07:00
|
|
|
pub type AccountsPackageSender = Sender<AccountsPackage>;
|
|
|
|
pub type AccountsPackageReceiver = Receiver<AccountsPackage>;
|
|
|
|
pub type AccountsPackageSendError = SendError<AccountsPackage>;
|
2019-07-31 17:58:10 -07:00
|
|
|
|
2020-01-23 08:46:30 -08:00
|
|
|
#[derive(Debug)]
|
2020-04-16 15:12:20 -07:00
|
|
|
pub struct AccountsPackage {
|
2020-01-23 09:20:34 -08:00
|
|
|
pub root: Slot,
|
2020-04-16 15:12:20 -07:00
|
|
|
pub block_height: Slot,
|
2020-02-10 03:11:37 -08:00
|
|
|
pub slot_deltas: Vec<BankSlotDelta>,
|
2019-10-18 14:58:16 -07:00
|
|
|
pub snapshot_links: TempDir,
|
2020-02-20 22:27:55 -08:00
|
|
|
pub storages: SnapshotStorages,
|
2019-10-18 14:58:16 -07:00
|
|
|
pub tar_output_file: PathBuf,
|
2020-02-20 11:46:13 -08:00
|
|
|
pub hash: Hash,
|
2020-04-03 13:13:49 -07:00
|
|
|
pub compression: CompressionType,
|
2019-07-31 17:58:10 -07:00
|
|
|
}
|
|
|
|
|
2020-04-16 15:12:20 -07:00
|
|
|
impl AccountsPackage {
|
2019-07-31 17:58:10 -07:00
|
|
|
pub fn new(
|
2020-01-23 09:20:34 -08:00
|
|
|
root: Slot,
|
2020-04-16 15:12:20 -07:00
|
|
|
block_height: u64,
|
2020-02-10 03:11:37 -08:00
|
|
|
slot_deltas: Vec<BankSlotDelta>,
|
2019-08-07 13:12:53 -07:00
|
|
|
snapshot_links: TempDir,
|
2020-02-20 22:27:55 -08:00
|
|
|
storages: SnapshotStorages,
|
2019-07-31 17:58:10 -07:00
|
|
|
tar_output_file: PathBuf,
|
2020-02-20 11:46:13 -08:00
|
|
|
hash: Hash,
|
2020-04-03 13:13:49 -07:00
|
|
|
compression: CompressionType,
|
2019-07-31 17:58:10 -07:00
|
|
|
) -> Self {
|
|
|
|
Self {
|
2019-08-21 16:36:21 -07:00
|
|
|
root,
|
2020-04-16 15:12:20 -07:00
|
|
|
block_height,
|
2019-09-25 13:42:19 -07:00
|
|
|
slot_deltas,
|
2019-08-07 13:12:53 -07:00
|
|
|
snapshot_links,
|
2020-02-20 22:27:55 -08:00
|
|
|
storages,
|
2019-07-31 17:58:10 -07:00
|
|
|
tar_output_file,
|
2020-02-20 11:46:13 -08:00
|
|
|
hash,
|
2020-04-03 13:13:49 -07:00
|
|
|
compression,
|
2019-07-31 17:58:10 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|