pub struct OptimisticTransactionDBCheckpoint<'db> { /* private fields */ }Expand description
OptimisticTransactionDB’s checkpoint object.
Used to create checkpoints of the specified OptimisticTransactionDB from
time to time.
An OptimisticTransactionDBCheckpoint must not outlive the
OptimisticTransactionDB it was created from:
use rust_rocksdb::{
checkpoint::OptimisticTransactionDBCheckpoint, OptimisticTransactionDB, SingleThreaded,
};
let _checkpoint = {
let db = OptimisticTransactionDB::<SingleThreaded>::open_default("foo").unwrap();
OptimisticTransactionDBCheckpoint::new(&db)
};Implementations§
Source§impl<'db> OptimisticTransactionDBCheckpoint<'db>
impl<'db> OptimisticTransactionDBCheckpoint<'db>
Sourcepub fn new<T: ThreadMode>(
db: &'db OptimisticTransactionDB<T>,
) -> Result<Self, Error>
pub fn new<T: ThreadMode>( db: &'db OptimisticTransactionDB<T>, ) -> Result<Self, Error>
Creates new checkpoint object for a specific OptimisticTransactionDB.
Does not actually produce checkpoints, call .create_checkpoint() to
produce one.
Sourcepub fn create_checkpoint<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>
pub fn create_checkpoint<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>
Creates a new physical RocksDB checkpoint in the directory specified by path.
This method uses the default log_size_for_flush value (0), which instructs
RocksDB to flush memtables as needed before creating the checkpoint.
Sourcepub fn create_checkpoint_with_log_size<P: AsRef<Path>>(
&self,
path: P,
log_size_for_flush: u64,
) -> Result<(), Error>
pub fn create_checkpoint_with_log_size<P: AsRef<Path>>( &self, path: P, log_size_for_flush: u64, ) -> Result<(), Error>
Creates a new physical RocksDB checkpoint in path, allowing the caller to
control log_size_for_flush.
Sourcepub fn export_column_family<P: AsRef<Path>>(
&self,
column_family: &impl AsColumnFamilyRef,
path: P,
) -> Result<ExportImportFilesMetaData, Error>
pub fn export_column_family<P: AsRef<Path>>( &self, column_family: &impl AsColumnFamilyRef, path: P, ) -> Result<ExportImportFilesMetaData, Error>
Export a specified Column Family.
Creates copies of the live SST files at the specified export path.
- SST files will be created as hard links when the directory specified is in the same partition as the db directory, copied otherwise.
- the path must not yet exist, a new directory is created as part of the export.
- Always triggers a flush.
See also: DB::create_column_family_with_import.