Struct SnapshotDbManagerSqlite

Source
pub struct SnapshotDbManagerSqlite { /* private fields */ }

Implementations§

Source§

impl SnapshotDbManagerSqlite

Source

pub const LATEST_MPT_SNAPSHOT_DIR: &'static str = "latest"

Source

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, backup_mpt_snapshot: bool, ) -> Result<Self>

Source

pub fn update_latest_snapshot_id(&self, snapshot_id: EpochId, height: u64)

Source

pub fn clean_snapshot_epoch_id_before_recovered(&self)

Source

pub fn set_reconstruct_snapshot_id(&self, reconstruct_pivot: Option<EpochId>)

Source

pub fn recreate_latest_mpt_snapshot(&self) -> Result<()>

Source

pub fn on_close( already_open_snapshots: &Arc<RwLock<HashMap<PathBuf, Option<Weak<SnapshotKvDbSqlite>>>>>, open_semaphore: &Arc<Semaphore>, path: &Path, remove_on_close: bool, )

Source

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

Source§

type SnapshotDb = SnapshotDbSqlite

Source§

type SnapshotDbWrite = SnapshotDbWriteable

Source§

fn get_snapshot_dir(&self) -> &Path

Source§

fn get_mpt_snapshot_dir(&self) -> &Path

Source§

fn get_latest_mpt_snapshot_db_name(&self) -> String

Source§

fn get_snapshot_db_name(&self, snapshot_epoch_id: &EpochId) -> String

Source§

fn get_snapshot_db_path(&self, snapshot_epoch_id: &EpochId) -> PathBuf

Source§

fn get_epoch_id_from_snapshot_db_name( &self, snapshot_db_name: &str, ) -> Result<EpochId>

Source§

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)>

Source§

fn get_snapshot_by_epoch_id( &self, snapshot_epoch_id: &EpochId, try_open: bool, open_mpt_snapshot: bool, ) -> Result<Option<Self::SnapshotDb>>

Source§

fn destroy_snapshot(&self, snapshot_epoch_id: &EpochId) -> Result<()>

Source§

fn new_temp_snapshot_for_full_sync( &self, snapshot_epoch_id: &EpochId, merkle_root: &MerkleHash, epoch_height: u64, ) -> Result<Self::SnapshotDbWrite>

Source§

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>>

Source§

fn recovery_latest_mpt_snapshot_from_checkpoint( &self, snapshot_epoch_id: &EpochId, snapshot_epoch_id_before_recovered: Option<EpochId>, ) -> Result<()>

Source§

fn create_mpt_snapshot_from_latest( &self, new_snapshot_epoch_id: &EpochId, ) -> Result<()>

Source§

fn try_get_new_snapshot_epoch_from_temp_path( &self, dir_name: &str, ) -> Option<EpochId>

Source§

fn try_get_new_snapshot_epoch_from_mpt_temp_path( &self, dir_name: &str, ) -> Option<EpochId>

Source§

fn scan_persist_state( &self, snapshot_info_map: &HashMap<EpochId, SnapshotInfo>, ) -> Result<SnapshotPersistState>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ElementSatisfy<ElementNoConstrain> for T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V