CUBRID Engine  latest
cubload::session Class Reference

#include <load_session.hpp>

Collaboration diagram for cubload::session:
Collaboration graph

Public Member Functions

 session (load_args &args)
 
 ~session ()
 
 session (session &&other)=delete
 
 session (const session &copy)=delete
 
sessionoperator= (session &&other)=delete
 
sessionoperator= (const session &copy)=delete
 
int install_class (cubthread::entry &thread_ref, const batch &batch, bool &is_ignored, std::string &cls_name)
 
int load_batch (cubthread::entry &thread_ref, const batch *batch, bool use_temp_batch, bool &is_batch_accepted, load_status &status)
 
void wait_for_completion ()
 
void wait_for_previous_batch (batch_id id)
 
void notify_batch_done (batch_id id)
 
void notify_batch_done_and_register_tran_end (batch_id id, int tran_index)
 
void register_tran_start (int tran_index)
 
void on_error (std::string &err_msg)
 
void fail (bool has_lock=false)
 
bool is_failed ()
 
void interrupt ()
 
void fetch_status (load_status &status, bool has_lock=false)
 
void stats_update_rows_committed (int64_t rows_committed)
 
int64_t stats_get_rows_committed ()
 
void stats_update_last_committed_line (int64_t last_committed_line)
 
void stats_update_current_line (int64_t current_line)
 
void update_class_statistics (cubthread::entry &thread_ref)
 
const load_argsget_args ()
 
class_registryget_class_registry ()
 
template<typename... Args>
void append_log_msg (MSGCAT_LOADDB_MSG msg_id, Args &&...args)
 

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_idm_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< statsm_collected_stats
 
driverm_driver
 
cubthread::entry_taskm_temp_task
 

Detailed Description

Definition at line 71 of file load_session.hpp.

Constructor & Destructor Documentation

cubload::session::~session ( )

Definition at line 271 of file load_session.cpp.

References m_driver, and cubload::worker_manager_unregister_session().

cubload::session::session ( session &&  other)
delete
cubload::session::session ( const session copy)
delete

Member Function Documentation

template<typename... Args>
void cubload::session::append_log_msg ( MSGCAT_LOADDB_MSG  msg_id,
Args &&...  args 
)
void cubload::session::collect_stats ( )
private
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

class_registry & cubload::session::get_class_registry ( )
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().

Here is the caller graph for this function:

bool cubload::session::is_completed ( )
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().

Here is the caller graph for this function:

int cubload::session::load_batch ( cubthread::entry thread_ref,
const batch batch,
bool  use_temp_batch,
bool is_batch_accepted,
load_status status 
)
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().

Here is the caller graph for this function:

void cubload::session::notify_batch_done_and_register_tran_end ( batch_id  id,
int  tran_index 
)
void cubload::session::notify_waiting_threads ( )
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().

Here is the caller graph for this function:

void cubload::session::on_error ( std::string &  err_msg)
session& cubload::session::operator= ( session &&  other)
delete
session& cubload::session::operator= ( const session copy)
delete
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

template<typename T >
void cubload::session::update_atomic_value_with_max ( std::atomic< T > &  atomic_val,
new_max 
)
private

Definition at line 466 of file load_session.cpp.

Referenced by load_batch(), and stats_update_current_line().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

Member Data Documentation

std::atomic<size_t> cubload::session::m_active_task_count
private
load_args cubload::session::m_args
private

Definition at line 142 of file load_session.hpp.

Referenced by collect_stats(), get_args(), session(), and update_class_statistics().

class_registry cubload::session::m_class_registry
private

Definition at line 147 of file load_session.hpp.

Referenced by get_class_registry(), session(), and update_class_statistics().

std::vector<stats> cubload::session::m_collected_stats
private

Definition at line 151 of file load_session.hpp.

Referenced by collect_stats(), fetch_status(), load_batch(), and session().

std::condition_variable cubload::session::m_cond_var
private
driver* cubload::session::m_driver
private

Definition at line 153 of file load_session.hpp.

Referenced by install_class(), session(), and ~session().

bool cubload::session::m_is_failed
private

Definition at line 150 of file load_session.hpp.

Referenced by fail(), is_failed(), and session().

batch_id cubload::session::m_last_batch_id
private
std::atomic<batch_id> cubload::session::m_max_batch_id
private

Definition at line 144 of file load_session.hpp.

Referenced by is_completed(), load_batch(), and session().

cubthread::entry_task* cubload::session::m_temp_task
private

Definition at line 155 of file load_session.hpp.

Referenced by load_batch(), and session().

std::set<int> cubload::session::m_tran_indexes
private

The documentation for this class was generated from the following files: