src/backend/logging/frontend_logger.cpp
/**
 * @brief Collect the log records from BackendLoggers
 */
@brief Collect the log records from BackendLoggers
@brief Collect the log records from BackendLoggers
void FrontendLogger::CollectLogRecordsFromBackendLoggers() {
  auto sleep_period = std::chrono::milliseconds(wait_timeout);
  std::this_thread::sleep_for(sleep_period);
  {
    for (auto backend_logger : backend_loggers) {
      {
        std::lock_guard<std::mutex> lock(backend_logger->local_queue_mutex);
        auto local_queue_size = backend_logger->local_queue.size();
        if (local_queue_size == 0) continue;
        for (oid_t log_record_itr = 0; log_record_itr < local_queue_size;
             log_record_itr++) {
          LOG_INFO("Found a log record to push in global queue");
          global_queue.push_back(
              std::move(backend_logger->local_queue[log_record_itr]));
        }
        backend_logger->local_queue.clear();
      }
    }
  }
}
void FrontendLogger :: CollectLogRecordsFromBackendLoggers ( ) { auto sleep_period = std :: chrono :: milliseconds ( wait_timeout ) ; std :: this_thread :: sleep_for ( sleep_period ) ; { for ( auto backend_logger : backend_loggers ) { { std :: lock_guard < std :: mutex > lock ( backend_logger -> local_queue_mutex ) ; auto local_queue_size = backend_logger -> local_queue . size ( ) ; if ( local_queue_size == 0 ) continue ; for ( oid_t log_record_itr = 0 ; log_record_itr < local_queue_size ; log_record_itr ++ ) { LOG_INFO ( " " ) ; global_queue . push_back ( std :: move ( backend_logger -> local_queue [ log_record_itr ] ) ) ; } backend_logger -> local_queue . clear ( ) ; } } } }
@brief Collect the log records from BackendLoggers
@brief Collect the log records from BackendLoggers
// Look at the local queues of the backend loggers // Skip current backend_logger, nothing to do // Move the log record from backend_logger to here // cleanup the local queue