From 32b64ab724a1b646de7a4e878cc38d14f8ff4047 Mon Sep 17 00:00:00 2001 From: Xu Peng Date: Sun, 28 Apr 2019 13:55:43 +0800 Subject: [PATCH] feat(db): add more print Former-commit-id: 42486eb1e1c804e7b5120dc1f0dd12d2f7bd6a96 --- cpp/src/db/DBImpl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpp/src/db/DBImpl.cpp b/cpp/src/db/DBImpl.cpp index a005cf4018..ef5eebc4ff 100644 --- a/cpp/src/db/DBImpl.cpp +++ b/cpp/src/db/DBImpl.cpp @@ -327,12 +327,14 @@ void DBImpl::background_build_index() { _pMeta->files_to_index(to_index_files); Status status; for (auto& file : to_index_files) { + LOG(DEBUG) << "Buiding index for " << file.location; status = build_index(file); if (!status.ok()) { _bg_error = status; return; } } + LOG(DEBUG) << "All Buiding index Done"; bg_build_index_started_ = false; bg_build_index_finish_signal_.notify_all(); @@ -370,17 +372,21 @@ Status DBImpl::count(const std::string& group_id, long& result) { DBImpl::~DBImpl() { { + LOG(DEBUG) << "Start wait background merge thread"; std::unique_lock lock(_mutex); _shutting_down.store(true, std::memory_order_release); while (_bg_compaction_scheduled) { _bg_work_finish_signal.wait(lock); } + LOG(DEBUG) << "Stop wait background merge thread"; } { + LOG(DEBUG) << "Start wait background build index thread"; std::unique_lock lock(build_index_mutex_); while (bg_build_index_started_) { bg_build_index_finish_signal_.wait(lock); } + LOG(DEBUG) << "Stop wait background build index thread"; } std::vector ids; _pMemMgr->serialize(ids);