24#ifndef MYSQL_CSA_SESSION_SERVICE_H
25#define MYSQL_CSA_SESSION_SERVICE_H
55 virtual bool init(std::size_t session_number,
Definition: rpl_rli.h:208
Service that provides a free session to executing transactions.
Definition: session_service.h:44
virtual Relay_context_ptr acquire_session(Task_id id)=0
Acquires session.
void enable_stop_error_suppression_for_clean_sessions()
Enables stop error suppression for sessions that have no reported error.
Definition: session_service.cpp:66
std::unordered_set< unsigned int > m_thd_ids
Captured THD identifiers for easy access.
Definition: session_service.h:94
virtual bool deinit()=0
Deinitializes the session service.
virtual std::size_t get_session_number()
Obtains the number of all sessions.
Definition: session_service.cpp:28
void awake_sessions(bool force_kill)
Awakes sessions to faster end execution.
Definition: session_service.cpp:72
bool has_thd_id(unsigned int thd_id) const
Checks whether session service contains a given THD thread id.
Definition: session_service.cpp:56
std::unordered_map< std::size_t, Relay_context_ptr > m_all_sessions
Aggregates all sessions in order to look at specific session data.
Definition: session_service.h:92
void clean_sessions()
Performs clean up of sessions, including rollback.
Definition: session_service.cpp:60
virtual ~Session_service()=default
Virtual destructor.
std::optional< Session_legacy_stats > get_session_stats(std::size_t session_id)
Obtains session statistics.
Definition: session_service.cpp:32
virtual bool init(std::size_t session_number, Relay_log_info *channel_rli)=0
Initializes the session service.
virtual void release_session(Relay_context_ptr session, Task_id id)=0
Releases a session back to the pool.
Represents the identifier of a task ingested by the scheduler,.
Definition: task_id.h:41
Binary log event definitions.
Definition: channel.cpp:28
std::shared_ptr< Session_service > Session_service_ptr
Shared pointer to Session_service.
Definition: session_service.h:40
std::shared_ptr< Relay_context > Relay_context_ptr
Definition: relay_context.h:39