Files
solana/ledger/src/snapshot_package.rs

43 lines
1.0 KiB
Rust
Raw Normal View History

use solana_runtime::{accounts_db::SnapshotStorages, bank::BankSlotDelta};
use solana_sdk::clock::Slot;
2020-02-20 11:46:13 -08:00
use solana_sdk::hash::Hash;
2020-02-18 10:02:29 -07:00
use std::{
path::PathBuf,
sync::mpsc::{Receiver, SendError, Sender},
2020-02-18 10:02:29 -07:00
};
use tempfile::TempDir;
pub type SnapshotPackageSender = Sender<SnapshotPackage>;
pub type SnapshotPackageReceiver = Receiver<SnapshotPackage>;
pub type SnapshotPackageSendError = SendError<SnapshotPackage>;
#[derive(Debug)]
pub struct SnapshotPackage {
2020-01-23 10:20:34 -07:00
pub root: Slot,
pub slot_deltas: Vec<BankSlotDelta>,
pub snapshot_links: TempDir,
pub storages: SnapshotStorages,
pub tar_output_file: PathBuf,
2020-02-20 11:46:13 -08:00
pub hash: Hash,
}
impl SnapshotPackage {
pub fn new(
2020-01-23 10:20:34 -07:00
root: Slot,
slot_deltas: Vec<BankSlotDelta>,
snapshot_links: TempDir,
storages: SnapshotStorages,
tar_output_file: PathBuf,
2020-02-20 11:46:13 -08:00
hash: Hash,
) -> Self {
Self {
root,
slot_deltas,
snapshot_links,
storages,
tar_output_file,
2020-02-20 11:46:13 -08:00
hash,
}
}
}