mirror of
https://github.com/matrix-construct/construct
synced 2024-10-02 21:59:02 +02:00
ircd::db: Maintain SST file manager instance.
This commit is contained in:
parent
9e9a1449ee
commit
e3b2bcf19d
3 changed files with 10 additions and 0 deletions
|
@ -91,6 +91,7 @@ struct ircd::db::database
|
||||||
std::shared_ptr<struct stats> stats;
|
std::shared_ptr<struct stats> stats;
|
||||||
std::shared_ptr<struct events> events;
|
std::shared_ptr<struct events> events;
|
||||||
std::shared_ptr<struct mergeop> mergeop;
|
std::shared_ptr<struct mergeop> mergeop;
|
||||||
|
std::shared_ptr<rocksdb::SstFileManager> ssts;
|
||||||
std::shared_ptr<rocksdb::Cache> cache;
|
std::shared_ptr<rocksdb::Cache> cache;
|
||||||
std::vector<descriptor> descriptors;
|
std::vector<descriptor> descriptors;
|
||||||
std::vector<string_view> column_names;
|
std::vector<string_view> column_names;
|
||||||
|
|
|
@ -30,6 +30,7 @@ namespace rocksdb
|
||||||
struct WriteBatch;
|
struct WriteBatch;
|
||||||
struct Slice;
|
struct Slice;
|
||||||
struct Checkpoint;
|
struct Checkpoint;
|
||||||
|
struct SstFileManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <rocksdb/utilities/checkpoint.h>
|
#include <rocksdb/utilities/checkpoint.h>
|
||||||
#include <rocksdb/filter_policy.h>
|
#include <rocksdb/filter_policy.h>
|
||||||
#include <rocksdb/table.h>
|
#include <rocksdb/table.h>
|
||||||
|
#include <rocksdb/sst_file_manager.h>
|
||||||
|
|
||||||
#include <ircd/db/database/comparator.h>
|
#include <ircd/db/database/comparator.h>
|
||||||
#include <ircd/db/database/prefix_transform.h>
|
#include <ircd/db/database/prefix_transform.h>
|
||||||
|
@ -370,6 +371,10 @@ try
|
||||||
{
|
{
|
||||||
std::make_shared<struct mergeop>(this)
|
std::make_shared<struct mergeop>(this)
|
||||||
}
|
}
|
||||||
|
,ssts
|
||||||
|
{
|
||||||
|
rocksdb::NewSstFileManager(env.get(), logs, {}, 0, true, nullptr, 0.05)
|
||||||
|
}
|
||||||
,cache{[this]
|
,cache{[this]
|
||||||
() -> std::shared_ptr<rocksdb::Cache>
|
() -> std::shared_ptr<rocksdb::Cache>
|
||||||
{
|
{
|
||||||
|
@ -457,6 +462,9 @@ try
|
||||||
// Setup env
|
// Setup env
|
||||||
opts.env = env.get();
|
opts.env = env.get();
|
||||||
|
|
||||||
|
// Setup SST file mgmt
|
||||||
|
opts.sst_file_manager = this->ssts;
|
||||||
|
|
||||||
// Setup logging
|
// Setup logging
|
||||||
logs->SetInfoLogLevel(ircd::debugmode? rocksdb::DEBUG_LEVEL : rocksdb::WARN_LEVEL);
|
logs->SetInfoLogLevel(ircd::debugmode? rocksdb::DEBUG_LEVEL : rocksdb::WARN_LEVEL);
|
||||||
opts.info_log_level = logs->GetInfoLogLevel();
|
opts.info_log_level = logs->GetInfoLogLevel();
|
||||||
|
|
Loading…
Reference in a new issue