store_api::manifest::storage

Trait ManifestLogStorage

source
pub trait ManifestLogStorage {
    type Error: ErrorExt + Send + Sync;
    type Iter: LogIterator<Error = Self::Error>;

    // Required methods
    fn scan<'life0, 'async_trait>(
        &'life0 self,
        start: ManifestVersion,
        end: ManifestVersion,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Iter, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_until<'life0, 'async_trait>(
        &'life0 self,
        end: ManifestVersion,
        keep_last_checkpoint: bool,
    ) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_all<'life0, 'async_trait>(
        &'life0 self,
        remove_action_version: ManifestVersion,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        version: ManifestVersion,
        bytes: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete<'life0, 'async_trait>(
        &'life0 self,
        start: ManifestVersion,
        end: ManifestVersion,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn save_checkpoint<'life0, 'life1, 'async_trait>(
        &'life0 self,
        version: ManifestVersion,
        bytes: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn load_last_checkpoint<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<(ManifestVersion, Vec<u8>)>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_checkpoint<'life0, 'async_trait>(
        &'life0 self,
        version: ManifestVersion,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn load_checkpoint<'life0, 'async_trait>(
        &'life0 self,
        version: ManifestVersion,
    ) -> Pin<Box<dyn Future<Output = Result<Option<(ManifestVersion, Vec<u8>)>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Associated Types§

source

type Error: ErrorExt + Send + Sync

source

type Iter: LogIterator<Error = Self::Error>

Required Methods§

source

fn scan<'life0, 'async_trait>( &'life0 self, start: ManifestVersion, end: ManifestVersion, ) -> Pin<Box<dyn Future<Output = Result<Self::Iter, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Scan the logs in [start, end)

source

fn delete_until<'life0, 'async_trait>( &'life0 self, end: ManifestVersion, keep_last_checkpoint: bool, ) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete logs and checkpoints which version is less than specified end. Keep the last checkpoint and remaining logs if keep_last_checkpoint is true.

Returns the delete logs number.

source

fn delete_all<'life0, 'async_trait>( &'life0 self, remove_action_version: ManifestVersion, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete all logs and checkpoints, and remove the manifest directory. The delta file corresponding to the remove_action_version will be deleted along with the manifest directory at the end.

source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, version: ManifestVersion, bytes: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save a log

source

fn delete<'life0, 'async_trait>( &'life0 self, start: ManifestVersion, end: ManifestVersion, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete logs in [start, end) and ignore checkpoints.

source

fn save_checkpoint<'life0, 'life1, 'async_trait>( &'life0 self, version: ManifestVersion, bytes: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save a checkpoint.

source

fn load_last_checkpoint<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<(ManifestVersion, Vec<u8>)>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load the latest checkpoint

source

fn delete_checkpoint<'life0, 'async_trait>( &'life0 self, version: ManifestVersion, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete the checkpoint by version

source

fn load_checkpoint<'life0, 'async_trait>( &'life0 self, version: ManifestVersion, ) -> Pin<Box<dyn Future<Output = Result<Option<(ManifestVersion, Vec<u8>)>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load the checkpoint by version

Implementors§