Skip to content

Commit

Permalink
Expose BackupEngine::CreateNewBackupWithMetadata in C API
Browse files Browse the repository at this point in the history
  • Loading branch information
agreen17 committed Jan 9, 2024
1 parent 6a43615 commit 28c1683
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions db/c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,15 @@ void rocksdb_backup_engine_create_new_backup_flush(
SaveError(errptr, be->rep->CreateNewBackup(db->rep, flush_before_backup));
}


void rocksdb_backup_engine_create_new_backup_with_metadata(
rocksdb_backup_engine_t* be, rocksdb_t* db, const char* app_metadata,
unsigned char flush_before_backup, char** errptr) {
SaveError(errptr,
be->rep->CreateNewBackupWithMetadata(
db->rep, std::string(app_metadata), flush_before_backup));
}

void rocksdb_backup_engine_purge_old_backups(rocksdb_backup_engine_t* be,
uint32_t num_backups_to_keep,
char** errptr) {
Expand Down
5 changes: 5 additions & 0 deletions include/rocksdb/c.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ extern ROCKSDB_LIBRARY_API void rocksdb_backup_engine_create_new_backup_flush(
rocksdb_backup_engine_t* be, rocksdb_t* db,
unsigned char flush_before_backup, char** errptr);

extern ROCKSDB_LIBRARY_API void
rocksdb_backup_engine_create_new_backup_with_metadata(
rocksdb_backup_engine_t* be, rocksdb_t* db, const char* app_metadata,
unsigned char flush_before_backup, char** errptr);

extern ROCKSDB_LIBRARY_API void rocksdb_backup_engine_purge_old_backups(
rocksdb_backup_engine_t* be, uint32_t num_backups_to_keep, char** errptr);

Expand Down

0 comments on commit 28c1683

Please sign in to comment.