24#ifndef GROUP_EVENT_OBSERVER_INCLUDED
25#define GROUP_EVENT_OBSERVER_INCLUDED
54 const std::vector<Gcs_member_identifier> &joining,
55 const std::vector<Gcs_member_identifier> &leaving,
56 const std::vector<Gcs_member_identifier> &group,
bool is_leaving,
58 std::string &suggested_primary) = 0;
68 std::string primary_uuid,
79 const std::string &message_origin,
80 bool *skip_message) = 0;
123 const std::vector<Gcs_member_identifier> &leaving,
124 const std::vector<Gcs_member_identifier> &group,
125 bool is_leaving,
bool *skip_election,
127 std::string &suggested_primary);
137 std::string primary_uuid,
148 const std::string &message_origin,
This has the functionality of mysql_rwlock_t, with two differences:
Definition: rpl_gtid.h:325
Class that others can extend to receive notifications about views and primary elections.
Definition: group_event_observer.h:40
virtual ~Group_event_observer()=0
virtual 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.
virtual int before_message_handling(const Plugin_gcs_message &message, const std::string &message_origin, bool *skip_message)=0
Executed before the message is processed.
virtual 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)=0
Executed after view install and before primary election.
Class alerts listeners of group events like view changes and elections.
Definition: group_event_observer.h:87
~Group_events_observation_manager()
Definition: group_event_observer.cc:38
int before_message_handling(const Plugin_gcs_message &message, const std::string &message_origin, bool *skip_message)
Executed before the message is processed.
Definition: group_event_observer.cc:130
std::list< Group_event_observer * > group_events_observers
The group event observers.
Definition: group_event_observer.h:160
Checkable_rwlock * observer_list_lock
The lock to control access to the list.
Definition: group_event_observer.h:162
Group_events_observation_manager()
Definition: group_event_observer.cc:30
void unregister_group_event_observer(Group_event_observer *observer)
The method to unregister new observers.
Definition: group_event_observer.cc:61
void register_group_event_observer(Group_event_observer *observer)
The method to register new observers.
Definition: group_event_observer.cc:53
void read_lock_observer_list()
Locks the observer list for reads.
Definition: group_event_observer.cc:69
void write_lock_observer_list()
Locks the observer list for writes.
Definition: group_event_observer.cc:73
void unlock_observer_list()
Unlocks the observer list.
Definition: group_event_observer.cc:77
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.
Definition: group_event_observer.cc:102
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.
Definition: group_event_observer.cc:81
This is the base GCS plugin message.
Definition: gcs_plugin_messages.h:64
enum_primary_election_mode
Enum for election types.
Definition: primary_election_include.h:33
enum_primary_election_primary_change_status
Enum for primary change status.
Definition: primary_election_include.h:50