@ -17,6 +17,7 @@
# include <vector>
# include "rocksdb/env.h"
# include "rocksdb/io_status.h"
# include "rocksdb/options.h"
# include "rocksdb/status.h"
@ -406,25 +407,25 @@ class BackupEngineReadOnlyBase {
std : : vector < BackupID > * corrupt_backup_ids ) const = 0 ;
// Restore to specified db_dir and wal_dir from backup_id.
virtual Status RestoreDBFromBackup ( const RestoreOptions & options ,
BackupID backup_id ,
const std : : string & db_dir ,
const std : : string & wal_dir ) const = 0 ;
virtual IO Status RestoreDBFromBackup ( const RestoreOptions & options ,
BackupID backup_id ,
const std : : string & db_dir ,
const std : : string & wal_dir ) const = 0 ;
// keep for backward compatibility.
virtual Status RestoreDBFromBackup (
virtual IO Status RestoreDBFromBackup (
BackupID backup_id , const std : : string & db_dir , const std : : string & wal_dir ,
const RestoreOptions & options = RestoreOptions ( ) ) const {
return RestoreDBFromBackup ( options , backup_id , db_dir , wal_dir ) ;
}
// Like RestoreDBFromBackup but restores from latest non-corrupt backup_id
virtual Status RestoreDBFromLatestBackup (
virtual IO Status RestoreDBFromLatestBackup (
const RestoreOptions & options , const std : : string & db_dir ,
const std : : string & wal_dir ) const = 0 ;
// keep for backward compatibility.
virtual Status RestoreDBFromLatestBackup (
virtual IO Status RestoreDBFromLatestBackup (
const std : : string & db_dir , const std : : string & wal_dir ,
const RestoreOptions & options = RestoreOptions ( ) ) const {
return RestoreDBFromLatestBackup ( options , db_dir , wal_dir ) ;
@ -445,8 +446,8 @@ class BackupEngineReadOnlyBase {
// their sizes (and checksums) when the BackupEngine was opened.
//
// Returns Status::OK() if all checks are good
virtual Status VerifyBackup ( BackupID backup_id ,
bool verify_with_checksum = false ) const = 0 ;
virtual IO Status VerifyBackup ( BackupID backup_id ,
bool verify_with_checksum = false ) const = 0 ;
} ;
// Append-only functions of a BackupEngine. See BackupEngine comment for
@ -457,12 +458,12 @@ class BackupEngineAppendOnlyBase {
virtual ~ BackupEngineAppendOnlyBase ( ) { }
// same as CreateNewBackup, but stores extra application metadata.
virtual Status CreateNewBackupWithMetadata (
virtual IO Status CreateNewBackupWithMetadata (
const CreateBackupOptions & options , DB * db ,
const std : : string & app_metadata , BackupID * new_backup_id = nullptr ) = 0 ;
// keep here for backward compatibility.
virtual Status CreateNewBackupWithMetadata (
virtual IO Status CreateNewBackupWithMetadata (
DB * db , const std : : string & app_metadata , bool flush_before_backup = false ,
std : : function < void ( ) > progress_callback = [ ] ( ) { } ) {
CreateBackupOptions options ;
@ -514,7 +515,7 @@ class BackupEngineAppendOnlyBase {
// with Append or Write operations in another BackupEngine on the same
// backup_dir, because temporary files will be treated as obsolete and
// deleted.
virtual Status GarbageCollect ( ) = 0 ;
virtual IO Status GarbageCollect ( ) = 0 ;
} ;
// A backup engine for organizing and managing backups.
@ -585,13 +586,13 @@ class BackupEngine : public BackupEngineReadOnlyBase,
// Deletes old backups, keeping latest num_backups_to_keep alive.
// See also DeleteBackup.
virtual Status PurgeOldBackups ( uint32_t num_backups_to_keep ) = 0 ;
virtual IO Status PurgeOldBackups ( uint32_t num_backups_to_keep ) = 0 ;
// Deletes a specific backup. If this operation (or PurgeOldBackups)
// is not completed due to crash, power failure, etc. the state
// will be cleaned up the next time you call DeleteBackup,
// PurgeOldBackups, or GarbageCollect.
virtual Status DeleteBackup ( BackupID backup_id ) = 0 ;
virtual IO Status DeleteBackup ( BackupID backup_id ) = 0 ;
} ;
// A variant of BackupEngine that only allows "Read" operations. See