MySQL 8.4.2
Source Code Documentation
Group_transaction_observation_manager Class Reference

#include <group_transaction_observation_manager.h>

Public Member Functions

 Group_transaction_observation_manager ()
 
 ~Group_transaction_observation_manager ()
 
void register_transaction_observer (Group_transaction_listener *observer)
 
void unregister_transaction_observer (Group_transaction_listener *observer)
 
int before_transaction_begin (my_thread_id thread_id, ulong gr_consistency_level, ulong hold_timeout, enum_rpl_channel_type rpl_channel_type, const THD *thd)
 Executed before a transaction begins. More...
 
int before_commit (my_thread_id thread_id, Group_transaction_listener::enum_transaction_origin origin)
 
int before_rollback (my_thread_id thread_id)
 
int after_commit (my_thread_id thread_id, rpl_sidno sidno, rpl_gno gno)
 
int after_rollback (my_thread_id thread_id, Group_transaction_listener::enum_transaction_origin origin)
 
bool is_any_observer_present ()
 Are there any observers present. More...
 
std::list< Group_transaction_listener * > * get_all_observers ()
 Get all registered observers. More...
 
void read_lock_observer_list ()
 Locks the observer list for reads. More...
 
void write_lock_observer_list ()
 Locks the observer list for writes. More...
 
void unlock_observer_list ()
 Unlocks the observer list. More...
 

Private Attributes

std::list< Group_transaction_listener * > group_transaction_listeners
 List of observers. More...
 
Checkable_rwlocktransaction_observer_list_lock
 The lock to protect the list. More...
 
std::atomic< bool > registered_observers
 Flag that indicates that there are observers (for performance) More...
 

Constructor & Destructor Documentation

◆ Group_transaction_observation_manager()

Group_transaction_observation_manager::Group_transaction_observation_manager ( )

◆ ~Group_transaction_observation_manager()

Group_transaction_observation_manager::~Group_transaction_observation_manager ( )

Member Function Documentation

◆ after_commit()

int Group_transaction_observation_manager::after_commit ( my_thread_id  thread_id,
rpl_sidno  sidno,
rpl_gno  gno 
)

◆ after_rollback()

int Group_transaction_observation_manager::after_rollback ( my_thread_id  thread_id,
Group_transaction_listener::enum_transaction_origin  origin 
)

◆ before_commit()

int Group_transaction_observation_manager::before_commit ( my_thread_id  thread_id,
Group_transaction_listener::enum_transaction_origin  origin 
)

◆ before_rollback()

int Group_transaction_observation_manager::before_rollback ( my_thread_id  thread_id)

◆ before_transaction_begin()

int Group_transaction_observation_manager::before_transaction_begin ( my_thread_id  thread_id,
ulong  gr_consistency_level,
ulong  hold_timeout,
enum_rpl_channel_type  rpl_channel_type,
const THD thd 
)

Executed before a transaction begins.

Parameters
thread_idthe transaction thread id
gr_consistency_levelthe current consistency level for this session
hold_timeoutthe max time to execute an action on this transaction
rpl_channel_typetype channel that receives transaction
thdserver thd that represents client session

◆ get_all_observers()

std::list< Group_transaction_listener * > * Group_transaction_observation_manager::get_all_observers ( )

Get all registered observers.

Note
to get the list and while using it, you should take a read lock from transaction_observer_list_lock (you can use read_lock_observer_list())
Returns
The list of all registered observers

◆ is_any_observer_present()

bool Group_transaction_observation_manager::is_any_observer_present ( )

Are there any observers present.

Returns
true if at least one observer is present, false otherwise

◆ read_lock_observer_list()

void Group_transaction_observation_manager::read_lock_observer_list ( )

Locks the observer list for reads.

◆ register_transaction_observer()

void Group_transaction_observation_manager::register_transaction_observer ( Group_transaction_listener observer)

◆ unlock_observer_list()

void Group_transaction_observation_manager::unlock_observer_list ( )

Unlocks the observer list.

◆ unregister_transaction_observer()

void Group_transaction_observation_manager::unregister_transaction_observer ( Group_transaction_listener observer)

◆ write_lock_observer_list()

void Group_transaction_observation_manager::write_lock_observer_list ( )

Locks the observer list for writes.

Member Data Documentation

◆ group_transaction_listeners

std::list<Group_transaction_listener *> Group_transaction_observation_manager::group_transaction_listeners
private

List of observers.

◆ registered_observers

std::atomic<bool> Group_transaction_observation_manager::registered_observers
private

Flag that indicates that there are observers (for performance)

◆ transaction_observer_list_lock

Checkable_rwlock* Group_transaction_observation_manager::transaction_observer_list_lock
private

The lock to protect the list.


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