From 6ca84f8a40eca6a578cc2e09b7de888bd105f1c5 Mon Sep 17 00:00:00 2001 From: steviez Date: Fri, 8 Apr 2022 11:46:12 -0500 Subject: [PATCH] Move PurgeType enum to blockstore_purge.rs (#24185) --- ledger/src/blockstore.rs | 18 ++---------------- ledger/src/blockstore/blockstore_purge.rs | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ledger/src/blockstore.rs b/ledger/src/blockstore.rs index 73ba2061a..964e85c12 100644 --- a/ledger/src/blockstore.rs +++ b/ledger/src/blockstore.rs @@ -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, diff --git a/ledger/src/blockstore/blockstore_purge.rs b/ledger/src/blockstore/blockstore_purge.rs index 5b53dcdbe..fad534cef 100644 --- a/ledger/src/blockstore/blockstore_purge.rs +++ b/ledger/src/blockstore/blockstore_purge.rs @@ -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