0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-01 17:48:56 +02:00

ircd::db: Use our cache wrapping for block and compressed column caches.

This commit is contained in:
Jason Volk 2018-09-02 17:31:09 -07:00
parent 084d434c59
commit a5d014d10a
2 changed files with 6 additions and 6 deletions

View file

@ -39,10 +39,10 @@ struct ircd::db::database::descriptor
db::prefix_transform prefix {};
/// Size of the LRU cache for uncompressed blocks
size_t cache_size { 16_MiB };
ssize_t cache_size { -1 };
/// Size of the LRU cache for compressed blocks
size_t cache_size_comp { 8_MiB };
ssize_t cache_size_comp { -1 };
/// Bloom filter bits. Filter is still useful even if queries are expected
/// to always hit on this column; see `expect_queries_hit` option.

View file

@ -1370,13 +1370,13 @@ ircd::db::database::column::column(database *const &d,
// Setup the cache for assets.
const auto &cache_size(this->descriptor.cache_size);
if(cache_size)
table_opts.block_cache = rocksdb::NewLRUCache(cache_size);
if(cache_size != 0)
table_opts.block_cache = std::make_shared<database::cache>(d, cache_size);
// Setup the cache for compressed assets.
const auto &cache_size_comp(this->descriptor.cache_size_comp);
if(cache_size_comp)
table_opts.block_cache_compressed = rocksdb::NewLRUCache(cache_size_comp);
if(cache_size_comp != 0)
table_opts.block_cache_compressed = std::make_shared<database::cache>(d, cache_size_comp);
// Setup the bloom filter.
const auto &bloom_bits(this->descriptor.bloom_bits);