Use db/config object in main, database etc

* Uses config object to augument/impl options parsing
* Database now holds config obj
* Commitlog can now be inited with global config obj.
This commit is contained in:
Calle Wilund
2015-04-29 10:24:17 +02:00
parent 5054892657
commit 2f4e7a00f6
7 changed files with 61 additions and 26 deletions

View File

@@ -35,6 +35,15 @@
#include "core/rwlock.hh"
#include "net/byteorder.hh"
#include "commitlog.hh"
#include "db/config.hh"
db::commitlog::config::config(const db::config& cfg)
: commit_log_location(cfg.commitlog_directory())
, commitlog_total_space_in_mb(cfg.commitlog_total_space_in_mb())
, commitlog_segment_size_in_mb(cfg.commitlog_segment_size_in_mb())
, commitlog_sync_period_in_ms(cfg.commitlog_sync_batch_window_in_ms())
, mode(cfg.commitlog_sync() == "batch" ? sync_mode::BATCH : sync_mode::PERIODIC)
{}
class db::commitlog::descriptor {
public: