Skip to content

Commit

Permalink
allow updating block cache capacity from C (facebook#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
domsj authored and dhruba committed Jun 3, 2016
1 parent 630b732 commit 02ec815
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions db/c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2173,6 +2173,10 @@ void rocksdb_cache_destroy(rocksdb_cache_t* 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* result = new rocksdb_env_t;
result->rep = Env::Default();
Expand Down
2 changes: 2 additions & 0 deletions include/rocksdb/c.h
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,8 @@ extern ROCKSDB_LIBRARY_API void rocksdb_flushoptions_set_wait(
extern ROCKSDB_LIBRARY_API rocksdb_cache_t* rocksdb_cache_create_lru(
size_t capacity);
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 */

Expand Down

0 comments on commit 02ec815

Please sign in to comment.