Add get_name, get_id for column family handle in C API (#10499)

Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/10499

Reviewed By: hx235

Differential Revision: D38523859

Pulled By: ajkr

fbshipit-source-id: 268bba1fcce4a3e20c51e498a79d7b476f663aea
main
muthukrishnan.s 2 years ago committed by Facebook GitHub Bot
parent 78bbdef530
commit 79ed4be80f
  1. 3
      HISTORY.md
  2. 12
      db/c.cc
  3. 6
      include/rocksdb/c.h

@ -3,6 +3,9 @@
### Behavior Change
* Updated `TestGet()` in `no_batched_op_stress` (default stress test) to check the result of Get() operations against expected state.
### Public API changes
* Add `rocksdb_column_family_handle_get_id`, `rocksdb_column_family_handle_get_name` to get name, id of column family in C API
## 7.6.0 (08/19/2022)
### New Features
* Added `prepopulate_blob_cache` to ColumnFamilyOptions. If enabled, prepopulate warm/hot blobs which are already in memory into blob cache at the time of flush. On a flush, the blob that is in memory (in memtables) get flushed to the device. If using Direct IO, additional IO is incurred to read this blob back into memory again, which is avoided by enabling this option. This further helps if the workload exhibits high temporal locality, where most of the reads go to recently written data. This also helps in case of the remote file system since it involves network traffic and higher latencies.

@ -1054,6 +1054,18 @@ void rocksdb_drop_column_family(
SaveError(errptr, db->rep->DropColumnFamily(handle->rep));
}
uint32_t rocksdb_column_family_handle_get_id(
rocksdb_column_family_handle_t* handle) {
return handle->rep->GetID();
}
char* rocksdb_column_family_handle_get_name(
rocksdb_column_family_handle_t* handle, size_t* name_len) {
auto name = handle->rep->GetName();
*name_len = name.size();
return CopyString(name);
}
void rocksdb_column_family_handle_destroy(rocksdb_column_family_handle_t* handle) {
delete handle->rep;
delete handle;

@ -423,6 +423,12 @@ extern ROCKSDB_LIBRARY_API void rocksdb_drop_column_family(
extern ROCKSDB_LIBRARY_API void rocksdb_column_family_handle_destroy(
rocksdb_column_family_handle_t*);
extern ROCKSDB_LIBRARY_API uint32_t
rocksdb_column_family_handle_get_id(rocksdb_column_family_handle_t* handle);
extern ROCKSDB_LIBRARY_API char* rocksdb_column_family_handle_get_name(
rocksdb_column_family_handle_t* handle, size_t* name_len);
extern ROCKSDB_LIBRARY_API void rocksdb_close(rocksdb_t* db);
extern ROCKSDB_LIBRARY_API void rocksdb_put(

Loading…
Cancel
Save