From 552256cb1a2c4ec14156c465d34c9d8b92776203 Mon Sep 17 00:00:00 2001 From: Artem Krylysov Date: Tue, 30 Nov 2021 16:53:07 -0800 Subject: [PATCH] Add rocksdb_livefiles_column_family_name C API (#9232) Summary: Extend C API to add new function `rocksdb_livefiles_column_family_name`. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9232 Reviewed By: akankshamahajan15 Differential Revision: D32736516 Pulled By: ajkr fbshipit-source-id: a854256a0f4652c903ab5ad8355ded051ac19987 --- db/c.cc | 5 +++++ include/rocksdb/c.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/db/c.cc b/db/c.cc index dda5f5560..7e6ee6840 100644 --- a/db/c.cc +++ b/db/c.cc @@ -4737,6 +4737,11 @@ int rocksdb_livefiles_count( return static_cast(lf->rep.size()); } +const char* rocksdb_livefiles_column_family_name(const rocksdb_livefiles_t* lf, + int index) { + return lf->rep[index].column_family_name.c_str(); +} + const char* rocksdb_livefiles_name( const rocksdb_livefiles_t* lf, int index) { diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 37107e250..646ef2e8e 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -1995,6 +1995,8 @@ extern ROCKSDB_LIBRARY_API void rocksdb_fifo_compaction_options_destroy( extern ROCKSDB_LIBRARY_API int rocksdb_livefiles_count( const rocksdb_livefiles_t*); +extern ROCKSDB_LIBRARY_API const char* rocksdb_livefiles_column_family_name( + const rocksdb_livefiles_t*, int index); extern ROCKSDB_LIBRARY_API const char* rocksdb_livefiles_name( const rocksdb_livefiles_t*, int index); extern ROCKSDB_LIBRARY_API int rocksdb_livefiles_level(