Loading cpp/src/db/DBImpl.cpp +22 −24 Original line number Diff line number Diff line Loading @@ -898,35 +898,33 @@ DBImpl::BackgroundBuildIndex() { meta_ptr_->FilesToIndex(to_index_files); Status status; // step 2: put build index task to scheduler for (auto &file : to_index_files) { scheduler::BuildIndexJobPtr job = std::make_shared<scheduler::BuildIndexJob>(0, meta_ptr_, options_); // scheduler::BuildIndexJobPtr // job = std::make_shared<scheduler::BuildIndexJob>(0, meta_ptr_, options_); scheduler::TableFileSchemaPtr file_ptr = std::make_shared<meta::TableFileSchema>(file); // step 2: put build index task to scheduler // for (auto &file : to_index_files) { // scheduler::TableFileSchemaPtr file_ptr = std::make_shared<meta::TableFileSchema>(file); // job->AddToIndexFiles(file_ptr); // } // scheduler::JobMgrInst::GetInstance()->Put(job); // job->WaitBuildIndexFinish(); // if (!job->GetStatus().ok()) { // Status status = job->GetStatus(); // ENGINE_LOG_ERROR << "Building index failed: " << status.ToString(); // } job->AddToIndexFiles(file_ptr); scheduler::JobMgrInst::GetInstance()->Put(job); job->WaitBuildIndexFinish(); if (!job->GetStatus().ok()) { Status status = job->GetStatus(); for (auto &file : to_index_files) { std::cout << "get to index file" << std::endl; status = BuildIndex(file); if (!status.ok()) { ENGINE_LOG_ERROR << "Building index for " << file.id_ << " failed: " << status.ToString(); } } // for (auto &file : to_index_files) { // std::cout << "get to index file" << std::endl; // status = BuildIndex(file); // if (!status.ok()) { // ENGINE_LOG_ERROR << "Building index for " << file.id_ << " failed: " << status.ToString(); // } // // if (shutting_down_.load(std::memory_order_acquire)) { // ENGINE_LOG_DEBUG << "Server will shutdown, skip build index action"; // break; // } // } if (shutting_down_.load(std::memory_order_acquire)) { ENGINE_LOG_DEBUG << "Server will shutdown, skip build index action"; break; } } ENGINE_LOG_TRACE << "Background build index thread exit"; } Loading cpp/src/metrics/PrometheusMetrics.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ PrometheusMetrics::Init() { return s.code(); } const std::string uri = std::string("/tmp/metrics"); const std::string uri = std::string("/metrics"); const std::size_t num_threads = 2; // Init Exposer Loading Loading
cpp/src/db/DBImpl.cpp +22 −24 Original line number Diff line number Diff line Loading @@ -898,35 +898,33 @@ DBImpl::BackgroundBuildIndex() { meta_ptr_->FilesToIndex(to_index_files); Status status; // step 2: put build index task to scheduler for (auto &file : to_index_files) { scheduler::BuildIndexJobPtr job = std::make_shared<scheduler::BuildIndexJob>(0, meta_ptr_, options_); // scheduler::BuildIndexJobPtr // job = std::make_shared<scheduler::BuildIndexJob>(0, meta_ptr_, options_); scheduler::TableFileSchemaPtr file_ptr = std::make_shared<meta::TableFileSchema>(file); // step 2: put build index task to scheduler // for (auto &file : to_index_files) { // scheduler::TableFileSchemaPtr file_ptr = std::make_shared<meta::TableFileSchema>(file); // job->AddToIndexFiles(file_ptr); // } // scheduler::JobMgrInst::GetInstance()->Put(job); // job->WaitBuildIndexFinish(); // if (!job->GetStatus().ok()) { // Status status = job->GetStatus(); // ENGINE_LOG_ERROR << "Building index failed: " << status.ToString(); // } job->AddToIndexFiles(file_ptr); scheduler::JobMgrInst::GetInstance()->Put(job); job->WaitBuildIndexFinish(); if (!job->GetStatus().ok()) { Status status = job->GetStatus(); for (auto &file : to_index_files) { std::cout << "get to index file" << std::endl; status = BuildIndex(file); if (!status.ok()) { ENGINE_LOG_ERROR << "Building index for " << file.id_ << " failed: " << status.ToString(); } } // for (auto &file : to_index_files) { // std::cout << "get to index file" << std::endl; // status = BuildIndex(file); // if (!status.ok()) { // ENGINE_LOG_ERROR << "Building index for " << file.id_ << " failed: " << status.ToString(); // } // // if (shutting_down_.load(std::memory_order_acquire)) { // ENGINE_LOG_DEBUG << "Server will shutdown, skip build index action"; // break; // } // } if (shutting_down_.load(std::memory_order_acquire)) { ENGINE_LOG_DEBUG << "Server will shutdown, skip build index action"; break; } } ENGINE_LOG_TRACE << "Background build index thread exit"; } Loading
cpp/src/metrics/PrometheusMetrics.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ PrometheusMetrics::Init() { return s.code(); } const std::string uri = std::string("/tmp/metrics"); const std::string uri = std::string("/metrics"); const std::size_t num_threads = 2; // Init Exposer Loading