From 6d142a7ff7d1cc7e8a5f42124cb472fef93af4ef Mon Sep 17 00:00:00 2001 From: Anthony Green Date: Tue, 9 Jan 2024 14:35:49 -0500 Subject: [PATCH] Expose backup metadata getter in C API --- db/c.cc | 5 +++++ include/rocksdb/c.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/db/c.cc b/db/c.cc index cd7342dcd257..6636adb9b1bb 100644 --- a/db/c.cc +++ b/db/c.cc @@ -706,6 +706,11 @@ uint32_t rocksdb_backup_engine_info_number_files( return info->rep[index].number_files; } +const char* rocksdb_backup_engine_info_metadata( + const rocksdb_backup_engine_info_t* info, int index) { + return info->rep[index].app_metadata.c_str(); +} + void rocksdb_backup_engine_info_destroy( const rocksdb_backup_engine_info_t* info) { delete info; diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 18c6b6f2af58..e1ab85a9c0e0 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -214,6 +214,9 @@ extern ROCKSDB_LIBRARY_API uint64_t rocksdb_backup_engine_info_size( extern ROCKSDB_LIBRARY_API uint32_t rocksdb_backup_engine_info_number_files( const rocksdb_backup_engine_info_t* info, int index); +extern ROCKSDB_LIBRARY_API const char* rocksdb_backup_engine_info_metadata( + const rocksdb_backup_engine_info_t* info, int index); + extern ROCKSDB_LIBRARY_API void rocksdb_backup_engine_info_destroy( const rocksdb_backup_engine_info_t* info);