MySQL 8.0.39
Source Code Documentation
Member_actions_handler_configuration Class Reference

The member actions table configuration abstraction layer. More...

#include <member_actions_handler_configuration.h>

Public Member Functions

 Member_actions_handler_configuration (Configuration_propagation *configuration_propagation)
 Constructor. More...
 
virtual ~Member_actions_handler_configuration ()
 
std::pair< bool, std::string > enable_disable_action (const std::string &name, const std::string &event, bool enable)
 Enable/disable a member action. More...
 
bool get_actions_for_event (protobuf_replication_group_member_actions::ActionList &action_list, const std::string &event)
 Retrieve member actions configured to trigger on a given event. More...
 
bool get_all_actions (std::string &serialized_configuration, bool set_force_update)
 Retrieve member actions configuration in the serialized format. More...
 
bool update_all_actions (const protobuf_replication_group_member_actions::ActionList &action_list)
 Update member actions configuration with a given configuration. More...
 
bool replace_all_actions (const protobuf_replication_group_member_actions::ActionList &action_list)
 Replace member actions configuration with a given configuration, even if the given configuration has a version lower than the local configuration. More...
 
bool reset_to_default_actions_configuration ()
 Reset member actions to the default configuration. More...
 

Private Member Functions

void field_store (Field *field, const std::string &value)
 
void field_store (Field *field, uint value)
 
std::pair< bool, std::string > commit_and_propagate_changes (Rpl_sys_table_access &table_op)
 Commit and propagate the local member actions configuration. More...
 
bool get_all_actions_internal (Rpl_sys_table_access &table_op, protobuf_replication_group_member_actions::ActionList &action_list)
 Retrieve member actions configuration in the serialized format. More...
 
bool update_all_actions_internal (const protobuf_replication_group_member_actions::ActionList &action_list, bool ignore_version, bool ignore_global_read_lock)
 Update member actions configuration with a given configuration. More...
 

Private Attributes

const std::string s_schema_name {"mysql"}
 
const std::string s_table_name {"replication_group_member_actions"}
 
const uint s_fields_number {6}
 
Configuration_propagationm_configuration_propagation {nullptr}
 The pointer to the object to call to propagate configuration. More...
 

Detailed Description

The member actions table configuration abstraction layer.

Constructor & Destructor Documentation

◆ Member_actions_handler_configuration()

Member_actions_handler_configuration::Member_actions_handler_configuration ( Configuration_propagation configuration_propagation)

Constructor.

Parameters
[in]configuration_propagationthe object to call to propagate configuration

◆ ~Member_actions_handler_configuration()

Member_actions_handler_configuration::~Member_actions_handler_configuration ( )
virtual

Member Function Documentation

◆ commit_and_propagate_changes()

std::pair< bool, std::string > Member_actions_handler_configuration::commit_and_propagate_changes ( Rpl_sys_table_access table_op)
private

Commit and propagate the local member actions configuration.

Parameters
[in]table_opthe table that persists the configuration
Returns
Operation status
Return values
falseSuccessful
trueError

◆ enable_disable_action()

std::pair< bool, std::string > Member_actions_handler_configuration::enable_disable_action ( const std::string &  name,
const std::string &  event,
bool  enable 
)

Enable/disable a member action.

Parameters
[in]namethe action name
[in]eventthe action event
[in]enabletrue to enable the action, false to disable
Returns
std::pair<bool, std::string> where each element has the following meaning: first element of the pair is the function error value: false Successful true Error second element of the pair is the error message.

◆ field_store() [1/2]

void Member_actions_handler_configuration::field_store ( Field field,
const std::string &  value 
)
private

◆ field_store() [2/2]

void Member_actions_handler_configuration::field_store ( Field field,
uint  value 
)
private

◆ get_actions_for_event()

bool Member_actions_handler_configuration::get_actions_for_event ( protobuf_replication_group_member_actions::ActionList action_list,
const std::string &  event 
)

Retrieve member actions configured to trigger on a given event.

Parameters
[out]action_listmember actions list
[in]eventthe event to filter the actions
Returns
Operation status
Return values
falseSuccessful
trueError

◆ get_all_actions()

bool Member_actions_handler_configuration::get_all_actions ( std::string &  serialized_configuration,
bool  set_force_update 
)

Retrieve member actions configuration in the serialized format.

Parameters
[out]serialized_configurationthe serialized configuration
[in]set_force_updateif true enables the force_update flag, which will make the sent configuration to override other members configuration
Returns
Operation status
Return values
falseSuccessful
trueError

◆ get_all_actions_internal()

bool Member_actions_handler_configuration::get_all_actions_internal ( Rpl_sys_table_access table_op,
protobuf_replication_group_member_actions::ActionList action_list 
)
private

Retrieve member actions configuration in the serialized format.

Parameters
[in]table_opthe table that persists the configuration
[out]action_listmember actions list
Returns
Operation status
Return values
falseSuccessful
trueError

◆ replace_all_actions()

bool Member_actions_handler_configuration::replace_all_actions ( const protobuf_replication_group_member_actions::ActionList action_list)

Replace member actions configuration with a given configuration, even if the given configuration has a version lower than the local configuration.

Parameters
[in]action_listmember actions list
Returns
Operation status
Return values
falseSuccessful
trueError

◆ reset_to_default_actions_configuration()

bool Member_actions_handler_configuration::reset_to_default_actions_configuration ( )

Reset member actions to the default configuration.

Returns
Operation status
Return values
falseSuccessful
trueError

◆ update_all_actions()

bool Member_actions_handler_configuration::update_all_actions ( const protobuf_replication_group_member_actions::ActionList action_list)

Update member actions configuration with a given configuration.

If the given configuration has a version lower than the local configuration, the update is skipped.

Parameters
[in]action_listmember actions list
Returns
Operation status
Return values
falseSuccessful
trueError

◆ update_all_actions_internal()

bool Member_actions_handler_configuration::update_all_actions_internal ( const protobuf_replication_group_member_actions::ActionList action_list,
bool  ignore_version,
bool  ignore_global_read_lock 
)
private

Update member actions configuration with a given configuration.

If the given configuration has a version lower than the local configuration, the update is skipped.

Parameters
[in]action_listmember actions list
[in]ignore_versionif false, the local configuration is updated if the version of the given configuration is higher than the local one true, there is no version checking
[in]ignore_global_read_lockif true, global_read_lock is ignored on commit false, otherwise
Returns
Operation status
Return values
falseSuccessful
trueError

Member Data Documentation

◆ m_configuration_propagation

Configuration_propagation* Member_actions_handler_configuration::m_configuration_propagation {nullptr}
private

The pointer to the object to call to propagate configuration.

◆ s_fields_number

const uint Member_actions_handler_configuration::s_fields_number {6}
private

◆ s_schema_name

const std::string Member_actions_handler_configuration::s_schema_name {"mysql"}
private

◆ s_table_name

const std::string Member_actions_handler_configuration::s_table_name {"replication_group_member_actions"}
private

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