Expose LRU cache num_shard_bits paramater in C api (#10222)

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

Reviewed By: cbi42

Differential Revision: D37358171

Pulled By: ajkr

fbshipit-source-id: e86285fdceaec943415ee9d482090009b00cbc95
main
Edvard Davtyan 2 years ago committed by Facebook GitHub Bot
parent 28f2d3cca6
commit 12bfd519de
  1. 5
      db/c.cc
  2. 2
      include/rocksdb/c.h

@ -4636,6 +4636,11 @@ void rocksdb_lru_cache_options_set_capacity(rocksdb_lru_cache_options_t* opt,
opt->rep.capacity = capacity; opt->rep.capacity = capacity;
} }
void rocksdb_lru_cache_options_set_num_shard_bits(
rocksdb_lru_cache_options_t* opt, int num_shard_bits) {
opt->rep.num_shard_bits = num_shard_bits;
}
void rocksdb_lru_cache_options_set_memory_allocator( void rocksdb_lru_cache_options_set_memory_allocator(
rocksdb_lru_cache_options_t* opt, rocksdb_memory_allocator_t* allocator) { rocksdb_lru_cache_options_t* opt, rocksdb_memory_allocator_t* allocator) {
opt->rep.memory_allocator = allocator->rep; opt->rep.memory_allocator = allocator->rep;

@ -1945,6 +1945,8 @@ extern ROCKSDB_LIBRARY_API void rocksdb_lru_cache_options_destroy(
rocksdb_lru_cache_options_t*); rocksdb_lru_cache_options_t*);
extern ROCKSDB_LIBRARY_API void rocksdb_lru_cache_options_set_capacity( extern ROCKSDB_LIBRARY_API void rocksdb_lru_cache_options_set_capacity(
rocksdb_lru_cache_options_t*, size_t); rocksdb_lru_cache_options_t*, size_t);
extern ROCKSDB_LIBRARY_API void rocksdb_lru_cache_options_set_num_shard_bits(
rocksdb_lru_cache_options_t*, int);
extern ROCKSDB_LIBRARY_API void rocksdb_lru_cache_options_set_memory_allocator( extern ROCKSDB_LIBRARY_API void rocksdb_lru_cache_options_set_memory_allocator(
rocksdb_lru_cache_options_t*, rocksdb_memory_allocator_t*); rocksdb_lru_cache_options_t*, rocksdb_memory_allocator_t*);

Loading…
Cancel
Save