0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-01 08:18:20 +02:00

ircd::db: Maintain SST file manager instance.

This commit is contained in:
Jason Volk 2018-04-20 15:45:57 -07:00
parent 9e9a1449ee
commit e3b2bcf19d
3 changed files with 10 additions and 0 deletions

View file

@ -91,6 +91,7 @@ struct ircd::db::database
std::shared_ptr<struct stats> stats;
std::shared_ptr<struct events> events;
std::shared_ptr<struct mergeop> mergeop;
std::shared_ptr<rocksdb::SstFileManager> ssts;
std::shared_ptr<rocksdb::Cache> cache;
std::vector<descriptor> descriptors;
std::vector<string_view> column_names;

View file

@ -30,6 +30,7 @@ namespace rocksdb
struct WriteBatch;
struct Slice;
struct Checkpoint;
struct SstFileManager;
}
//

View file

@ -23,6 +23,7 @@
#include <rocksdb/utilities/checkpoint.h>
#include <rocksdb/filter_policy.h>
#include <rocksdb/table.h>
#include <rocksdb/sst_file_manager.h>
#include <ircd/db/database/comparator.h>
#include <ircd/db/database/prefix_transform.h>
@ -370,6 +371,10 @@ try
{
std::make_shared<struct mergeop>(this)
}
,ssts
{
rocksdb::NewSstFileManager(env.get(), logs, {}, 0, true, nullptr, 0.05)
}
,cache{[this]
() -> std::shared_ptr<rocksdb::Cache>
{
@ -457,6 +462,9 @@ try
// Setup env
opts.env = env.get();
// Setup SST file mgmt
opts.sst_file_manager = this->ssts;
// Setup logging
logs->SetInfoLogLevel(ircd::debugmode? rocksdb::DEBUG_LEVEL : rocksdb::WARN_LEVEL);
opts.info_log_level = logs->GetInfoLogLevel();