MySQL 9.1.0
Source Code Documentation
|
Class alerts listeners of group events like view changes and elections. More...
#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, enum_primary_election_primary_change_status primary_change_status, 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_rwlock * | observer_list_lock |
The lock to control access to the list. More... | |
Class alerts listeners of group events like view changes and elections.
Group_events_observation_manager::Group_events_observation_manager | ( | ) |
Group_events_observation_manager::~Group_events_observation_manager | ( | ) |
int Group_events_observation_manager::after_primary_election | ( | std::string | primary_uuid, |
enum_primary_election_primary_change_status | primary_change_status, | ||
enum_primary_election_mode | election_mode, | ||
int | error = 0 |
||
) |
Executed after primary election.
primary_uuid | the elected primary |
primary_change_status | if the primary changed after the election |
election_mode | what was the election mode |
error | if there was and error on the process |
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.
joining | members joining the group | |
leaving | members leaving the group | |
group | members in the group | |
is_leaving | is the member leaving | |
[out] | skip_election | skip primary election on view |
[out] | election_mode | election mode |
[out] | suggested_primary | what should be the next primary to elect |
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.
message | The GCS message | |
message_origin | The member that sent this message (address) | |
[out] | skip_message | skip message handling if true |
|
private |
Locks the observer list for reads.
void Group_events_observation_manager::register_group_event_observer | ( | Group_event_observer * | observer | ) |
The method to register new observers.
observer | An observer class to register |
|
private |
Unlocks the observer list.
void Group_events_observation_manager::unregister_group_event_observer | ( | Group_event_observer * | observer | ) |
The method to unregister new observers.
observer | An observer class to unregister |
|
private |
Locks the observer list for writes.
|
private |
The group event observers.
|
private |
The lock to control access to the list.