From 8cbafeee3b0d40160325c5c98f7b09cbf45e9c14 Mon Sep 17 00:00:00 2001 From: David Palm Date: Tue, 30 Apr 2019 14:16:08 +0200 Subject: [PATCH] Add rocksdb_property_int_cf ref. https://github.com/facebook/rocksdb/issues/5249 --- db/c.cc | 12 ++++++++++++ include/rocksdb/c.h | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/db/c.cc b/db/c.cc index 743a88d838e..d000a158122 100644 --- a/db/c.cc +++ b/db/c.cc @@ -1070,6 +1070,18 @@ int rocksdb_property_int( } } +int rocksdb_property_int_cf( + rocksdb_t* db, + rocksdb_column_family_handle_t* column_family, + const char* propname, + uint64_t *out_val) { + if (db->rep->GetIntProperty(column_family->rep, (propname), out_val)) { + return 0; + } else { + return -1; + } +} + char* rocksdb_property_value_cf( rocksdb_t* db, rocksdb_column_family_handle_t* column_family, diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index ceb99ebf945..a0ae7ca7785 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -336,6 +336,11 @@ int rocksdb_property_int( rocksdb_t* db, const char* propname, uint64_t *out_val); +/* returns 0 on success, -1 otherwise */ +int rocksdb_property_int_cf( + rocksdb_t* db, rocksdb_column_family_handle_t* column_family, + const char* propname, uint64_t *out_val); + extern ROCKSDB_LIBRARY_API char* rocksdb_property_value_cf( rocksdb_t* db, rocksdb_column_family_handle_t* column_family, const char* propname);