MySQL  8.0.19
Source Code Documentation
Group_events_observation_manager Class Reference

#include <group_event_observer.h>

Public Member Functions

 Group_events_observation_manager ()
 
 ~Group_events_observation_manager ()
 
void register_group_event_observer (Group_event_observer *observer)
 The method to register new observers. More...
 
void unregister_group_event_observer (Group_event_observer *observer)
 The method to unregister new observers. More...
 
int after_view_change (const std::vector< Gcs_member_identifier > &joining, const std::vector< Gcs_member_identifier > &leaving, const std::vector< Gcs_member_identifier > &group, bool is_leaving, bool *skip_election, enum_primary_election_mode *election_mode, std::string &suggested_primary)
 Executed after view install and before primary election. More...
 
int after_primary_election (std::string primary_uuid, bool primary_changed, enum_primary_election_mode election_mode, int error=0)
 Executed after primary election. More...
 
int before_message_handling (const Plugin_gcs_message &message, const std::string &message_origin, bool *skip_message)
 Executed before the message is processed. More...
 

Private Member Functions

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_event_observer * > group_events_observers
 The group event observers. More...
 
Checkable_rwlockobserver_list_lock
 The lock to control access to the list. More...
 

Detailed Description

Class alerts listeners of group events like view changes and elections.

Constructor & Destructor Documentation

◆ Group_events_observation_manager()

Group_events_observation_manager::Group_events_observation_manager ( )

◆ ~Group_events_observation_manager()

Group_events_observation_manager::~Group_events_observation_manager ( )

Member Function Documentation

◆ after_primary_election()

int Group_events_observation_manager::after_primary_election ( std::string  primary_uuid,
bool  primary_changed,
enum_primary_election_mode  election_mode,
int  error = 0 
)

Executed after primary election.

Parameters
primary_uuidthe elected primary
primary_changedif the primary changed after the election
election_modewhat was the election mode
errorif there was and error on the process

◆ after_view_change()

int Group_events_observation_manager::after_view_change ( const std::vector< Gcs_member_identifier > &  joining,
const std::vector< Gcs_member_identifier > &  leaving,
const std::vector< Gcs_member_identifier > &  group,
bool  is_leaving,
bool skip_election,
enum_primary_election_mode election_mode,
std::string &  suggested_primary 
)

Executed after view install and before primary election.

Parameters
joiningmembers joining the group
leavingmembers leaving the group
groupmembers in the group
is_leavingis the member leaving
[out]skip_electionskip primary election on view
[out]election_modeelection mode
[out]suggested_primarywhat should be the next primary to elect

◆ before_message_handling()

int Group_events_observation_manager::before_message_handling ( const Plugin_gcs_message message,
const std::string &  message_origin,
bool skip_message 
)

Executed before the message is processed.

Parameters
messageThe GCS message
message_originThe member that sent this message (address)
[out]skip_messageskip message handling if true

◆ read_lock_observer_list()

void Group_events_observation_manager::read_lock_observer_list ( )
private

Locks the observer list for reads.

◆ register_group_event_observer()

void Group_events_observation_manager::register_group_event_observer ( Group_event_observer observer)

The method to register new observers.

Parameters
observerAn observer class to register

◆ unlock_observer_list()

void Group_events_observation_manager::unlock_observer_list ( )
private

Unlocks the observer list.

◆ unregister_group_event_observer()

void Group_events_observation_manager::unregister_group_event_observer ( Group_event_observer observer)

The method to unregister new observers.

Parameters
observerAn observer class to unregister

◆ write_lock_observer_list()

void Group_events_observation_manager::write_lock_observer_list ( )
private

Locks the observer list for writes.

Member Data Documentation

◆ group_events_observers

std::list<Group_event_observer *> Group_events_observation_manager::group_events_observers
private

The group event observers.

◆ observer_list_lock

Checkable_rwlock* Group_events_observation_manager::observer_list_lock
private

The lock to control access to the list.


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