[Refactor] Remove objects which are only used for unit test (#4751)

We create some objects which are only used for unit tests, it's not necessary,
and it may cause create duplicate instances for some classes.
This patch remove unnecessary instance of class BlockManager and StoragePageCache.
This commit is contained in:
Yingchun Lai
2020-10-18 21:37:12 +08:00
committed by GitHub
parent e31b4a4561
commit 45fa67aa71
14 changed files with 25 additions and 37 deletions

View File

@ -119,7 +119,6 @@ StorageEngine::StorageEngine(const EngineOptions& options)
_txn_manager(new TxnManager(config::txn_map_shard_size, config::txn_shard_size)),
_rowset_id_generator(new UniqueRowsetIdGenerator(options.backend_uid)),
_memtable_flush_executor(nullptr),
_block_manager(nullptr),
_default_rowset_type(ALPHA_ROWSET),
_heartbeat_flags(nullptr) {
if (_s_instance == nullptr) {
@ -181,10 +180,6 @@ Status StorageEngine::_open() {
_memtable_flush_executor.reset(new MemTableFlushExecutor());
_memtable_flush_executor->init(dirs);
fs::BlockManagerOptions bm_opts;
bm_opts.read_only = false;
_block_manager.reset(new fs::FileBlockManager(Env::Default(), std::move(bm_opts)));
_parse_default_rowset_type();
return Status::OK();