Struct cfx_storage::SnapshotDbManagerSqlite
source · pub struct SnapshotDbManagerSqlite { /* private fields */ }
Implementations§
source§impl SnapshotDbManagerSqlite
impl SnapshotDbManagerSqlite
pub const LATEST_MPT_SNAPSHOT_DIR: &'static str = "latest"
pub fn new( snapshot_path: PathBuf, max_open_snapshots: u16, use_isolated_db_for_mpt_table: bool, use_isolated_db_for_mpt_table_height: Option<u64>, era_epoch_count: u64 ) -> Result<Self>
pub fn update_latest_snapshot_id(&self, snapshot_id: EpochId, height: u64)
pub fn clean_snapshot_epoch_id_before_recovered(&self)
pub fn set_reconstruct_snapshot_id(&self, reconstruct_pivot: Option<EpochId>)
pub fn recreate_latest_mpt_snapshot(&self) -> Result<()>
pub fn on_close( already_open_snapshots: &Arc<RwLock<HashMap<PathBuf, Option<Weak<SnapshotKvDbSqlite>>>>>, open_semaphore: &Arc<Semaphore>, path: &Path, remove_on_close: bool )
pub fn on_close_mpt_snapshot( already_open_snapshots: &Arc<RwLock<HashMap<PathBuf, Option<Weak<SnapshotMptDbSqlite>>>>>, open_semaphore: &Arc<Semaphore>, path: &Path, remove_on_close: bool, latest_mpt_snapshot_semaphore: &Option<Arc<Semaphore>> )
Trait Implementations§
source§impl SnapshotDbManagerTrait for SnapshotDbManagerSqlite
impl SnapshotDbManagerTrait for SnapshotDbManagerSqlite
type SnapshotDb = SnapshotDbSqlite
type SnapshotDbWrite = SnapshotDbWriteable
fn get_snapshot_dir(&self) -> &Path
fn get_mpt_snapshot_dir(&self) -> &Path
fn get_latest_mpt_snapshot_db_name(&self) -> String
fn get_snapshot_db_name(&self, snapshot_epoch_id: &EpochId) -> String
fn get_snapshot_db_path(&self, snapshot_epoch_id: &EpochId) -> PathBuf
fn get_epoch_id_from_snapshot_db_name( &self, snapshot_db_name: &str ) -> Result<EpochId>
fn new_snapshot_by_merging<'m>( &self, old_snapshot_epoch_id: &EpochId, snapshot_epoch_id: EpochId, delta_mpt: DeltaMptIterator, in_progress_snapshot_info: SnapshotInfo, snapshot_info_map_rwlock: &'m RwLock<PersistedSnapshotInfoMap>, new_epoch_height: u64, recover_mpt_with_kv_snapshot_exist: bool ) -> Result<(RwLockWriteGuard<'m, PersistedSnapshotInfoMap>, SnapshotInfo)>
fn get_snapshot_by_epoch_id( &self, snapshot_epoch_id: &EpochId, try_open: bool, open_mpt_snapshot: bool ) -> Result<Option<Self::SnapshotDb>>
fn destroy_snapshot(&self, snapshot_epoch_id: &EpochId) -> Result<()>
fn new_temp_snapshot_for_full_sync( &self, snapshot_epoch_id: &EpochId, merkle_root: &MerkleHash, epoch_height: u64 ) -> Result<Self::SnapshotDbWrite>
fn finalize_full_sync_snapshot<'m>( &self, snapshot_epoch_id: &EpochId, merkle_root: &MerkleHash, snapshot_info_map_rwlock: &'m RwLock<PersistedSnapshotInfoMap> ) -> Result<RwLockWriteGuard<'m, PersistedSnapshotInfoMap>>
fn recovery_latest_mpt_snapshot_from_checkpoint( &self, snapshot_epoch_id: &EpochId, snapshot_epoch_id_before_recovered: Option<EpochId> ) -> Result<()>
fn create_mpt_snapshot_from_latest( &self, new_snapshot_epoch_id: &EpochId ) -> Result<()>
fn try_get_new_snapshot_epoch_from_temp_path( &self, dir_name: &str ) -> Option<EpochId>
fn try_get_new_snapshot_epoch_from_mpt_temp_path( &self, dir_name: &str ) -> Option<EpochId>
fn scan_persist_state( &self, snapshot_info_map: &HashMap<EpochId, SnapshotInfo> ) -> Result<SnapshotPersistState>
Auto Trait Implementations§
impl !RefUnwindSafe for SnapshotDbManagerSqlite
impl Send for SnapshotDbManagerSqlite
impl Sync for SnapshotDbManagerSqlite
impl Unpin for SnapshotDbManagerSqlite
impl !UnwindSafe for SnapshotDbManagerSqlite
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more