CUBRID Engine
latest
|
#include <load_session.hpp>
Private Member Functions | |
void | notify_waiting_threads () |
bool | is_completed () |
void | collect_stats () |
template<typename T > | |
void | update_atomic_value_with_max (std::atomic< T > &atomic_val, T new_max) |
Private Attributes | |
std::mutex | m_mutex |
std::condition_variable | m_cond_var |
std::set< int > | m_tran_indexes |
load_args | m_args |
batch_id | m_last_batch_id |
std::atomic< batch_id > | m_max_batch_id |
std::atomic< size_t > | m_active_task_count |
class_registry | m_class_registry |
stats | m_stats |
bool | m_is_failed |
std::vector< stats > | m_collected_stats |
driver * | m_driver |
cubthread::entry_task * | m_temp_task |
Definition at line 71 of file load_session.hpp.
|
explicit |
Definition at line 232 of file load_session.cpp.
References cubload::FIRST_CLASS_ID, cubload::driver::get_class_installer(), cubthread::get_entry(), cubload::driver::get_error_handler(), cubload::init_driver(), cubload::class_installer::install_class(), intl_identifier_lower_string_size(), LOADDB_MSG_EXCEED_MAX_LEN, m_active_task_count, m_args, m_class_registry, m_collected_stats, m_driver, m_is_failed, cubthread::entry::m_loaddb_driver, m_max_batch_id, m_stats, m_temp_task, NULL, cubload::NULL_BATCH_ID, cubload::error_handler::on_error(), cubload::class_installer::set_class_id(), SM_MAX_IDENTIFIER_LENGTH, cubload::load_args::table_name, and cubload::worker_manager_register_session().
cubload::session::~session | ( | ) |
Definition at line 271 of file load_session.cpp.
References m_driver, and cubload::worker_manager_unregister_session().
|
delete |
void cubload::session::append_log_msg | ( | MSGCAT_LOADDB_MSG | msg_id, |
Args &&... | args | ||
) |
Definition at line 168 of file load_session.hpp.
References collect_stats(), cubload::error_handler::format_log_msg(), get_args(), cubload::stats::log_message, m_mutex, m_stats, and notify_waiting_threads().
Referenced by cubload::server_class_installer::check_class(), cubload::load_task::execute(), cubload::server_class_installer::register_class_with_attributes(), and update_class_statistics().
|
private |
Definition at line 634 of file load_session.cpp.
References cubload::stats::error_message, cubload::stats::log_message, m_args, m_collected_stats, m_stats, and cubload::load_args::syntax_check.
Referenced by append_log_msg(), notify_batch_done_and_register_tran_end(), and on_error().
void cubload::session::fail | ( | bool | has_lock = false | ) |
Definition at line 379 of file load_session.cpp.
References m_is_failed, m_mutex, and notify_waiting_threads().
Referenced by cubload::load_task::execute(), cubload::init_driver(), install_class(), and interrupt().
void cubload::session::fetch_status | ( | load_status & | status, |
bool | has_lock = false |
||
) |
Definition at line 648 of file load_session.cpp.
References assert, is_completed(), is_failed(), m_collected_stats, and m_mutex.
Referenced by load_batch(), and sloaddb_fetch_status().
Definition at line 513 of file load_session.cpp.
References m_args.
Referenced by append_log_msg(), cubload::load_task::execute(), cubload::server_object_loader::finish_line(), cubload::server_object_loader::flush_records(), cubload::server_class_installer::is_class_ignored(), cubload::server_object_loader::process_line(), and cubload::server_class_installer::register_class_with_attributes().
class_registry & cubload::session::get_class_registry | ( | ) |
Definition at line 507 of file load_session.cpp.
References m_class_registry.
Referenced by cubload::load_task::execute(), cubload::server_object_loader::init(), install_class(), and cubload::server_class_installer::register_class_with_attributes().
int cubload::session::install_class | ( | cubthread::entry & | thread_ref, |
const batch & | batch, | ||
bool & | is_ignored, | ||
std::string & | cls_name | ||
) |
Definition at line 525 of file load_session.cpp.
References er_errid_if_has_error(), ER_FAILED, er_has_error(), fail(), cubload::class_registry::get_class_entry(), cubload::batch::get_class_id(), cubload::class_entry::get_class_name(), get_class_registry(), cubload::invoke_parser(), is_failed(), cubload::class_entry::is_ignored(), m_driver, cubthread::entry::m_loaddb_driver, NO_ERROR, and NULL.
Referenced by sloaddb_install_class().
void cubload::session::interrupt | ( | ) |
Definition at line 413 of file load_session.cpp.
References fail(), cubthread::get_entry(), logtb_set_tran_index_interrupt(), m_mutex, m_tran_indexes, and notify_waiting_threads().
Referenced by session_stop_attached_threads(), and sloaddb_interrupt().
|
private |
Definition at line 279 of file load_session.cpp.
References m_last_batch_id, and m_max_batch_id.
Referenced by fetch_status(), and wait_for_completion().
bool cubload::session::is_failed | ( | ) |
Definition at line 407 of file load_session.cpp.
References m_is_failed.
Referenced by cubload::load_task::execute(), fetch_status(), cubload::server_object_loader::finish_line(), cubload::server_object_loader::flush_records(), install_class(), load_batch(), notify_batch_done(), notify_batch_done_and_register_tran_end(), cubload::server_object_loader::process_line(), cubload::server_class_installer::register_class_with_attributes(), wait_for_completion(), and wait_for_previous_batch().
int cubload::session::load_batch | ( | cubthread::entry & | thread_ref, |
const batch * | batch, | ||
bool | use_temp_batch, | ||
bool & | is_batch_accepted, | ||
load_status & | status | ||
) |
Definition at line 566 of file load_session.cpp.
References assert, cubthread::entry::conn_entry, ER_FAILED, fetch_status(), cubload::batch::get_content(), cubload::batch::get_id(), is_failed(), m_active_task_count, m_collected_stats, m_cond_var, m_max_batch_id, m_mutex, m_temp_task, NO_ERROR, NULL, update_atomic_value_with_max(), and cubload::worker_manager_try_task().
Referenced by sloaddb_load_batch().
void cubload::session::notify_batch_done | ( | batch_id | id | ) |
Definition at line 317 of file load_session.cpp.
References assert, er_clear(), is_failed(), m_active_task_count, m_last_batch_id, m_mutex, and notify_waiting_threads().
Referenced by cubload::load_task::notify_done().
void cubload::session::notify_batch_done_and_register_tran_end | ( | batch_id | id, |
int | tran_index | ||
) |
Definition at line 334 of file load_session.cpp.
References assert, collect_stats(), er_clear(), cubthread::get_entry(), is_failed(), logtb_free_tran_index(), m_active_task_count, m_last_batch_id, m_mutex, m_tran_indexes, and notify_waiting_threads().
Referenced by cubload::load_task::notify_done_and_tran_end().
|
private |
Definition at line 519 of file load_session.cpp.
References m_cond_var.
Referenced by append_log_msg(), fail(), interrupt(), notify_batch_done(), notify_batch_done_and_register_tran_end(), and on_error().
void cubload::session::on_error | ( | std::string & | err_msg | ) |
Definition at line 367 of file load_session.cpp.
References collect_stats(), cubload::stats::error_message, m_mutex, m_stats, notify_waiting_threads(), and cubload::stats::rows_failed.
void cubload::session::register_tran_start | ( | int | tran_index | ) |
Definition at line 359 of file load_session.cpp.
References assert, m_mutex, and m_tran_indexes.
Referenced by cubload::load_task::execute().
int64_t cubload::session::stats_get_rows_committed | ( | ) |
Definition at line 434 of file load_session.cpp.
References m_stats, and cubload::stats::rows_committed.
void cubload::session::stats_update_current_line | ( | int64_t | current_line | ) |
Definition at line 459 of file load_session.cpp.
References cubload::stats::current_line, m_stats, and update_atomic_value_with_max().
Referenced by cubload::server_object_loader::finish_line().
void cubload::session::stats_update_last_committed_line | ( | int64_t | last_committed_line | ) |
Definition at line 440 of file load_session.cpp.
References cubload::stats::last_committed_line, m_mutex, and m_stats.
Referenced by cubload::load_task::execute().
void cubload::session::stats_update_rows_committed | ( | int64_t | rows_committed | ) |
Definition at line 427 of file load_session.cpp.
References m_mutex, m_stats, and cubload::stats::rows_committed.
Referenced by cubload::load_task::execute().
|
private |
Definition at line 466 of file load_session.cpp.
Referenced by load_batch(), and stats_update_current_line().
void cubload::session::update_class_statistics | ( | cubthread::entry & | thread_ref | ) |
Definition at line 483 of file load_session.cpp.
References append_log_msg(), cubload::load_args::disable_statistics, cubload::class_registry::get_all_class_entries(), cubload::class_entry::get_class_name(), cubload::class_entry::get_class_oid(), cubload::class_entry::is_ignored(), LOADDB_MSG_UPDATED_CLASS_STATS, LOADDB_MSG_UPDATING_STATISTICS, m_args, m_class_registry, STATS_WITH_SAMPLING, cubload::load_args::syntax_check, and xstats_update_statistics().
Referenced by sloaddb_update_stats().
void cubload::session::wait_for_completion | ( | ) |
Definition at line 299 of file load_session.cpp.
References is_completed(), is_failed(), m_active_task_count, m_cond_var, and m_mutex.
Referenced by session_stop_attached_threads(), and sloaddb_destroy().
void cubload::session::wait_for_previous_batch | ( | batch_id | id | ) |
Definition at line 285 of file load_session.cpp.
References cubload::FIRST_BATCH_ID, is_failed(), m_cond_var, m_last_batch_id, and m_mutex.
Referenced by cubload::load_task::execute().
|
private |
Definition at line 145 of file load_session.hpp.
Referenced by load_batch(), notify_batch_done(), notify_batch_done_and_register_tran_end(), session(), and wait_for_completion().
|
private |
Definition at line 142 of file load_session.hpp.
Referenced by collect_stats(), get_args(), session(), and update_class_statistics().
|
private |
Definition at line 147 of file load_session.hpp.
Referenced by get_class_registry(), session(), and update_class_statistics().
|
private |
Definition at line 151 of file load_session.hpp.
Referenced by collect_stats(), fetch_status(), load_batch(), and session().
|
private |
Definition at line 139 of file load_session.hpp.
Referenced by load_batch(), notify_waiting_threads(), wait_for_completion(), and wait_for_previous_batch().
|
private |
Definition at line 153 of file load_session.hpp.
Referenced by install_class(), session(), and ~session().
|
private |
Definition at line 150 of file load_session.hpp.
Referenced by fail(), is_failed(), and session().
|
private |
Definition at line 143 of file load_session.hpp.
Referenced by is_completed(), notify_batch_done(), notify_batch_done_and_register_tran_end(), and wait_for_previous_batch().
|
private |
Definition at line 144 of file load_session.hpp.
Referenced by is_completed(), load_batch(), and session().
|
private |
Definition at line 138 of file load_session.hpp.
Referenced by append_log_msg(), fail(), fetch_status(), interrupt(), load_batch(), notify_batch_done(), notify_batch_done_and_register_tran_end(), on_error(), register_tran_start(), stats_update_last_committed_line(), stats_update_rows_committed(), wait_for_completion(), and wait_for_previous_batch().
|
private |
Definition at line 149 of file load_session.hpp.
Referenced by append_log_msg(), collect_stats(), on_error(), session(), stats_get_rows_committed(), stats_update_current_line(), stats_update_last_committed_line(), and stats_update_rows_committed().
|
private |
Definition at line 155 of file load_session.hpp.
Referenced by load_batch(), and session().
|
private |
Definition at line 140 of file load_session.hpp.
Referenced by interrupt(), notify_batch_done_and_register_tran_end(), and register_tran_start().