![]() |
MySQL 26.7.0
Source Code Documentation
|
Service that provides a free session to executing transactions. More...
#include <session_service.h>
Public Types | |
| using | Task_id = mysql::scheduler::Task_id |
| Alias for task identifier. More... | |
Public Member Functions | |
| virtual | ~Session_service ()=default |
| Virtual destructor. More... | |
| virtual bool | init (std::size_t session_number, Relay_log_info *channel_rli)=0 |
| Initializes the session service. More... | |
| virtual bool | deinit ()=0 |
| Deinitializes the session service. More... | |
| std::optional< Session_legacy_stats > | get_session_stats (std::size_t session_id) |
| Obtains session statistics. More... | |
| virtual std::size_t | get_session_number () |
| Obtains the number of all sessions. More... | |
| virtual Relay_context_ptr | acquire_session (Task_id id)=0 |
| Acquires session. More... | |
| virtual void | release_session (Relay_context_ptr session, Task_id id)=0 |
| Releases a session back to the pool. More... | |
| void | clean_sessions () |
| Performs clean up of sessions, including rollback. More... | |
| void | enable_stop_error_suppression_for_clean_sessions () |
| Enables stop error suppression for sessions that have no reported error. More... | |
| bool | has_thd_id (unsigned int thd_id) const |
| Checks whether session service contains a given THD thread id. More... | |
| void | awake_sessions (bool force_kill) |
| Awakes sessions to faster end execution. More... | |
Protected Attributes | |
| std::unordered_map< std::size_t, Relay_context_ptr > | m_all_sessions |
| Aggregates all sessions in order to look at specific session data. More... | |
| std::unordered_set< unsigned int > | m_thd_ids |
| Captured THD identifiers for easy access. More... | |
Service that provides a free session to executing transactions.
Base class for maintaining session pool available for CSA workers
Alias for task identifier.
|
virtualdefault |
Virtual destructor.
|
pure virtual |
Acquires session.
| id | Attach id for the session (internal sequence session id) |
Implemented in mysql::csa::Session_service_bounded_queue.
| void mysql::csa::Session_service::awake_sessions | ( | bool | force_kill | ) |
Awakes sessions to faster end execution.
| force_kill | When true, kills THDs |
| void mysql::csa::Session_service::clean_sessions | ( | ) |
Performs clean up of sessions, including rollback.
|
pure virtual |
Deinitializes the session service.
Implemented in mysql::csa::Session_service_bounded_queue.
| void mysql::csa::Session_service::enable_stop_error_suppression_for_clean_sessions | ( | ) |
Enables stop error suppression for sessions that have no reported error.
|
virtual |
Obtains the number of all sessions.
| std::optional< Session_legacy_stats > mysql::csa::Session_service::get_session_stats | ( | std::size_t | session_id | ) |
Obtains session statistics.
| bool mysql::csa::Session_service::has_thd_id | ( | unsigned int | thd_id | ) | const |
Checks whether session service contains a given THD thread id.
| thd_id | THD thread identifier to check |
|
pure virtual |
Initializes the session service.
| session_number | The number of sessions to add to the initial pool |
| channel_rli | Parent RLI - channel RLI to share common applier config |
Implemented in mysql::csa::Session_service_bounded_queue.
|
pure virtual |
Releases a session back to the pool.
| session | Session to return to the session pool |
| id | Session internal ID |
Implemented in mysql::csa::Session_service_bounded_queue.
|
protected |
Aggregates all sessions in order to look at specific session data.
|
protected |
Captured THD identifiers for easy access.