Move PurgeType enum to blockstore_purge.rs (#24185)

This commit is contained in:
steviez 2022-04-08 11:46:12 -05:00 committed by GitHub
parent d2702201ca
commit 6ca84f8a40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 16 deletions

View File

@ -68,13 +68,13 @@ use {
thiserror::Error,
trees::{Tree, TreeWalk},
};
pub mod blockstore_purge;
pub use {
crate::{blockstore_db::BlockstoreError, blockstore_meta::SlotMeta},
blockstore_purge::PurgeType,
rocksdb::properties as RocksProperties,
};
pub mod blockstore_purge;
pub const BLOCKSTORE_DIRECTORY_ROCKS_LEVEL: &str = "rocksdb";
pub const BLOCKSTORE_DIRECTORY_ROCKS_FIFO: &str = "rocksdb_fifo";
@ -110,20 +110,6 @@ pub struct SignatureInfosForAddress {
pub found_before: bool,
}
#[derive(Clone, Copy)]
/// Controls how `blockstore::purge_slots` purges the data.
pub enum PurgeType {
/// A slower but more accurate way to purge slots by also ensuring higher
/// level of consistency between data during the clean up process.
Exact,
/// A faster approximation of `Exact` where the purge process only takes
/// care of the primary index and does not update the associated entries.
PrimaryIndex,
/// The fastest purge mode that relies on the slot-id based TTL
/// compaction filter to do the cleanup.
CompactionFilter,
}
#[derive(Error, Debug)]
pub enum InsertDataShredError {
Exists,

View File

@ -6,6 +6,20 @@ pub struct PurgeStats {
write_batch: u64,
}
#[derive(Clone, Copy)]
/// Controls how `blockstore::purge_slots` purges the data.
pub enum PurgeType {
/// A slower but more accurate way to purge slots by also ensuring higher
/// level of consistency between data during the clean up process.
Exact,
/// A faster approximation of `Exact` where the purge process only takes
/// care of the primary index and does not update the associated entries.
PrimaryIndex,
/// The fastest purge mode that relies on the slot-id based TTL
/// compaction filter to do the cleanup.
CompactionFilter,
}
impl Blockstore {
/// Performs cleanup based on the specified deletion range. After this
/// function call, entries within \[`from_slot`, `to_slot`\] will become