From cebf864174ad3d3340094130e591a9f04faa970b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 19 Sep 2014 18:00:37 -0700 Subject: [PATCH] mon/MonitorDBStore: uninline init_options These assume leveldb but we can't reference that from the header (for ceph-dencoder's sake). Not that this is firefly-only; upstream this has been cleaned up. Signed-off-by: Sage Weil --- src/mon/Makefile.am | 1 + src/mon/MonitorDBStore.cc | 36 ++++++++++++++++++++++++++++++++++++ src/mon/MonitorDBStore.h | 20 +------------------- 3 files changed, 38 insertions(+), 19 deletions(-) create mode 100644 src/mon/MonitorDBStore.cc diff --git a/src/mon/Makefile.am b/src/mon/Makefile.am index de5bbca..ceabe30 100644 --- a/src/mon/Makefile.am +++ b/src/mon/Makefile.am @@ -9,6 +9,7 @@ libmon_la_SOURCES = \ mon/PaxosService.cc \ mon/OSDMonitor.cc \ mon/MDSMonitor.cc \ + mon/MonitorDBStore.cc \ mon/MonmapMonitor.cc \ mon/PGMonitor.cc \ mon/LogMonitor.cc \ diff --git a/src/mon/MonitorDBStore.cc b/src/mon/MonitorDBStore.cc new file mode 100644 index 0000000..83107c0 --- /dev/null +++ b/src/mon/MonitorDBStore.cc @@ -0,0 +1,36 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +/* +* Ceph - scalable distributed file system +* +* Copyright (C) 2012 Inktank, Inc. +* +* This is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License version 2.1, as published by the Free Software +* Foundation. See file COPYING. +*/ + +#include "MonitorDBStore.h" +#include "os/LevelDBStore.h" + +void MonitorDBStore::init_options() +{ + db->init(); + if (g_conf->mon_leveldb_write_buffer_size) + db->options.write_buffer_size = g_conf->mon_leveldb_write_buffer_size; + if (g_conf->mon_leveldb_cache_size) + db->options.cache_size = g_conf->mon_leveldb_cache_size; + if (g_conf->mon_leveldb_block_size) + db->options.block_size = g_conf->mon_leveldb_block_size; + if (g_conf->mon_leveldb_bloom_size) + db->options.bloom_size = g_conf->mon_leveldb_bloom_size; + if (g_conf->mon_leveldb_compression) + db->options.compression_enabled = g_conf->mon_leveldb_compression; + if (g_conf->mon_leveldb_max_open_files) + db->options.max_open_files = g_conf->mon_leveldb_max_open_files; + if (g_conf->mon_leveldb_paranoid) + db->options.paranoid_checks = g_conf->mon_leveldb_paranoid; + if (g_conf->mon_leveldb_log.length()) + db->options.log_file = g_conf->mon_leveldb_log; +} diff --git a/src/mon/MonitorDBStore.h b/src/mon/MonitorDBStore.h index 88c4f93..741d6ec 100644 --- a/src/mon/MonitorDBStore.h +++ b/src/mon/MonitorDBStore.h @@ -486,25 +486,7 @@ class MonitorDBStore db->submit_transaction_sync(dbt); } - void init_options() { - db->init(); - if (g_conf->mon_leveldb_write_buffer_size) - db->options.write_buffer_size = g_conf->mon_leveldb_write_buffer_size; - if (g_conf->mon_leveldb_cache_size) - db->options.cache_size = g_conf->mon_leveldb_cache_size; - if (g_conf->mon_leveldb_block_size) - db->options.block_size = g_conf->mon_leveldb_block_size; - if (g_conf->mon_leveldb_bloom_size) - db->options.bloom_size = g_conf->mon_leveldb_bloom_size; - if (g_conf->mon_leveldb_compression) - db->options.compression_enabled = g_conf->mon_leveldb_compression; - if (g_conf->mon_leveldb_max_open_files) - db->options.max_open_files = g_conf->mon_leveldb_max_open_files; - if (g_conf->mon_leveldb_paranoid) - db->options.paranoid_checks = g_conf->mon_leveldb_paranoid; - if (g_conf->mon_leveldb_log.length()) - db->options.log_file = g_conf->mon_leveldb_log; - } + void init_options(); int open(ostream &out) { init_options(); -- 1.9.3