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

§

type SnapshotDb = SnapshotDbSqlite

§

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

§

type Output = T

Should always be Self
source§

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

§

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

§

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