From 414a840b2915daf3fe09bfde2e6f777dfed0c00d Mon Sep 17 00:00:00 2001 From: Victor Date: Thu, 15 Aug 2024 09:29:40 +0800 Subject: [PATCH] add api rocksdb_sst_file_metadata_get_file_create_time --- db/c.cc | 5 +++++ include/rocksdb/c.h | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/db/c.cc b/db/c.cc index 5aed7b2bc48..e6bcba8c10a 100644 --- a/db/c.cc +++ b/db/c.cc @@ -5388,6 +5388,11 @@ char* rocksdb_sst_file_metadata_get_largestkey( return CopyString(file_meta->rep->largestkey); } +uint64_t rocksdb_sst_file_metadata_get_file_creation_time( + rocksdb_sst_file_metadata_t* file_meta) { + return file_meta->rep->file_creation_time; +} + /* Transactions */ rocksdb_transactiondb_options_t* rocksdb_transactiondb_options_create() { diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 85a810d74f2..ab3b25b7cdd 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -2353,6 +2353,14 @@ extern ROCKSDB_LIBRARY_API char* rocksdb_sst_file_metadata_get_smallestkey( extern ROCKSDB_LIBRARY_API char* rocksdb_sst_file_metadata_get_largestkey( rocksdb_sst_file_metadata_t* file_meta, size_t* len); +/** + * Returns the create time of the specified sst file. + * + * @param file_meta the metadata of an SST file to obtain its create time. + */ +extern ROCKSDB_LIBRARY_API uint64_t rocksdb_sst_file_metadata_get_file_creation_time( + rocksdb_sst_file_metadata_t* file_meta); + /* Transactions */ extern ROCKSDB_LIBRARY_API rocksdb_column_family_handle_t*