allow updating block cache capacity from C (#1149)

This commit is contained in:
Jan Doms 2016-06-03 15:04:51 +02:00 committed by dhruba borthakur
parent 630b732cb3
commit 02ec8154e5
2 changed files with 6 additions and 0 deletions

View File

@ -2173,6 +2173,10 @@ void rocksdb_cache_destroy(rocksdb_cache_t* cache) {
delete cache; delete cache;
} }
void rocksdb_cache_set_capacity(rocksdb_cache_t* cache, size_t capacity) {
cache->rep->SetCapacity(capacity);
}
rocksdb_env_t* rocksdb_create_default_env() { rocksdb_env_t* rocksdb_create_default_env() {
rocksdb_env_t* result = new rocksdb_env_t; rocksdb_env_t* result = new rocksdb_env_t;
result->rep = Env::Default(); result->rep = Env::Default();

View File

@ -847,6 +847,8 @@ extern ROCKSDB_LIBRARY_API void rocksdb_flushoptions_set_wait(
extern ROCKSDB_LIBRARY_API rocksdb_cache_t* rocksdb_cache_create_lru( extern ROCKSDB_LIBRARY_API rocksdb_cache_t* rocksdb_cache_create_lru(
size_t capacity); size_t capacity);
extern ROCKSDB_LIBRARY_API void rocksdb_cache_destroy(rocksdb_cache_t* cache); extern ROCKSDB_LIBRARY_API void rocksdb_cache_destroy(rocksdb_cache_t* cache);
extern ROCKSDB_LIBRARY_API void rocksdb_cache_set_capacity(
rocksdb_cache_t* cache, size_t capacity);
/* Env */ /* Env */