![]() |
MySQL 9.2.0
Source Code Documentation
|
Connection event coordinator. More...
#include <connection_control_coordinator.h>
Public Member Functions | |
Connection_event_coordinator () | |
void | notify_event (MYSQL_THD thd, const mysql_event_tracking_connection_data *connection_event) |
Handle connection event. More... | |
void | notify_sys_var (opt_connection_control variable, void *new_value) |
Process change in sys_var value. More... | |
bool | register_event_subscriber (Connection_event_observer **subscriber, std::vector< opt_connection_control, CustomAllocator< opt_connection_control > > *sys_vars, std::vector< stats_connection_control, CustomAllocator< stats_connection_control > > *status_vars) |
Register an event subscriber. More... | |
bool | notify_status_var (Connection_event_observer **observer, stats_connection_control status_var, status_var_action action) |
Update a status variable. More... | |
Private Member Functions | |
void | reset () |
Reset Connection_event_coordinator information. More... | |
Private Attributes | |
std::vector< Connection_event_subscriber, CustomAllocator< Connection_event_subscriber > > | m_subscribers |
Connection_event_observer * | m_status_vars_subscription [STAT_LAST] |
Additional Inherited Members | |
![]() | |
static void * | operator new (size_t size) noexcept |
static void * | operator new[] (size_t size) noexcept |
static void | operator delete (void *ptr) |
static void | operator delete[] (void *ptr) |
Connection event coordinator.
This class will keep list of subscribers for different subevents and notify them based on their preference.
|
inline |
void connection_control::Connection_event_coordinator::notify_event | ( | MYSQL_THD | thd, |
const mysql_event_tracking_connection_data * | connection_event | ||
) |
Handle connection event.
When a notification from server is received, perform following: Iterate through list of subscribers If a subscriber has shown interest in received event, call notify() for the subscriber
Note : If we receive error from a subscriber, we log it and move on.
[in] | thd | THD handle |
[in] | connection_event | Event information |
bool connection_control::Connection_event_coordinator::notify_status_var | ( | Connection_event_observer ** | observer, |
stats_connection_control | status_var, | ||
status_var_action | action | ||
) |
Update a status variable.
[in] | observer | Requestor |
[in] | status_var | Status variable to be updated |
[in] | action | Operation to be performed on status variable |
false | Success |
true | Error in processing |
void connection_control::Connection_event_coordinator::notify_sys_var | ( | opt_connection_control | variable, |
void * | new_value | ||
) |
Process change in sys_var value.
Iterate through all subscribers
Note : If we receive error from a subscriber, we log it and move on.
[in] | variable | Variable information |
[in] | new_value | New value for variable |
bool connection_control::Connection_event_coordinator::register_event_subscriber | ( | Connection_event_observer ** | subscriber, |
std::vector< opt_connection_control, CustomAllocator< opt_connection_control > > * | sys_vars, | ||
std::vector< stats_connection_control, CustomAllocator< stats_connection_control > > * | status_vars | ||
) |
Register an event subscriber.
A subscriber can provide following preferences:
[in] | subscriber | Handle to Connection_event_observers |
[in] | sys_vars | opt_connection_control vector |
[in] | status_vars | stats_connection_control vector |
false | Subscription successful |
true | Failure in subscription for given combination of prefernece. Most probably, other subscriber has already subscribed for status var update. |
|
private |
Reset Connection_event_coordinator information.
|
private |
|
private |