提交 64ecdd71 编写于 作者: Y Yingchun Lai 提交者: neverchanje

refactor: refactor rocksdb options usage (#467)

上级 fb72d917
......@@ -6,7 +6,7 @@ LOCAL_IP=`scripts/get_local_ip`
export REPORT_DIR="$ROOT/test_report"
export DSN_ROOT=$ROOT/DSN_ROOT
export DSN_THIRDPARTY_ROOT=$ROOT/rdsn/thirdparty/output
export LD_LIBRARY_PATH=$DSN_ROOT/lib:$DSN_THIRDPARTY_ROOT/lib:$BOOST_DIR/lib:$TOOLCHAIN_DIR/lib64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$DSN_ROOT/lib:$DSN_THIRDPARTY_ROOT/lib:$BOOST_DIR/lib:$LD_LIBRARY_PATH
function usage()
{
......
......@@ -211,7 +211,7 @@ void pegasus_manual_compact_service::extract_manual_compact_opts(
int32_t target_level;
if (dsn::buf2int32(find->second, target_level) &&
(target_level == -1 ||
(target_level >= 1 && target_level <= _app->_db_opts.num_levels))) {
(target_level >= 1 && target_level <= _app->_data_cf_opts.num_levels))) {
options.target_level = target_level;
} else {
dwarn_replica("{}={} is invalid, use default value {}",
......
此差异已折叠。
......@@ -308,14 +308,13 @@ private:
std::shared_ptr<KeyWithTTLCompactionFilterFactory> _key_ttl_compaction_filter_factory;
std::shared_ptr<rocksdb::Statistics> _statistics;
rocksdb::BlockBasedTableOptions _tbl_opts;
rocksdb::Options _db_opts;
rocksdb::WriteOptions _wt_opts;
rocksdb::ReadOptions _rd_opts;
rocksdb::DBOptions _db_opts;
rocksdb::ColumnFamilyOptions _data_cf_opts;
rocksdb::ReadOptions _data_cf_rd_opts;
std::string _usage_scenario;
rocksdb::DB *_db;
static std::shared_ptr<rocksdb::Cache> _block_cache;
static std::shared_ptr<rocksdb::Cache> _s_block_cache;
volatile bool _is_open;
uint32_t _pegasus_data_version;
std::atomic<int64_t> _last_durable_decree;
......
......@@ -29,11 +29,12 @@ public:
_primary_address(server->_primary_address),
_pegasus_data_version(server->_pegasus_data_version),
_db(server->_db),
_wt_opts(server->_wt_opts),
_rd_opts(server->_rd_opts),
_rd_opts(server->_data_cf_rd_opts),
_default_ttl(0),
_pfc_recent_expire_count(server->_pfc_recent_expire_count)
{
// disable write ahead logging as replication handles logging instead now
_wt_opts.disableWAL = true;
}
int empty_put(int64_t decree)
......@@ -720,7 +721,7 @@ private:
rocksdb::WriteBatch _batch;
rocksdb::DB *_db;
rocksdb::WriteOptions &_wt_opts;
rocksdb::WriteOptions _wt_opts;
rocksdb::ReadOptions &_rd_opts;
volatile uint32_t _default_ttl;
::dsn::perf_counter_wrapper &_pfc_recent_expire_count;
......
......@@ -57,7 +57,7 @@ public:
manual_compact_svc->extract_manual_compact_opts(envs, key_prefix, options);
}
void set_num_level(int level) { _server->_db_opts.num_levels = level; }
void set_num_level(int level) { _server->_data_cf_opts.num_levels = level; }
void check_manual_compact_state(bool ok, const std::string &msg = "")
{
......
......@@ -19,7 +19,7 @@ public:
pegasus_compression_options_test()
{
_server->_db_opts.num_levels = 7;
_server->_data_cf_opts.num_levels = 7;
compression_header = _server->COMPRESSION_HEADER;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册