MySQL  8.0.19
Source Code Documentation
Gcs_operations Class Reference

#include <gcs_operations.h>

Public Types

enum  enum_leave_state { NOW_LEAVING, ALREADY_LEAVING, ALREADY_LEFT, ERROR_WHEN_LEAVING }
 

Public Member Functions

 Gcs_operations ()
 Default constructor. More...
 
virtual ~Gcs_operations ()
 Destructor. More...
 
int initialize ()
 Initialize the GCS interface. More...
 
void finalize ()
 Finalize the GCS interface. More...
 
Gcs_viewget_current_view ()
 Get the group current view. More...
 
enum enum_gcs_error configure (const Gcs_interface_parameters &parameters)
 Configure the GCS interface. More...
 
enum enum_gcs_error reconfigure (const Gcs_interface_parameters &parameters)
 Reconfigure the GCS interface, i.e. More...
 
enum enum_gcs_error set_debug_options (std::string &debug_options) const
 Configure the debug options that shall be used by GCS. More...
 
enum enum_gcs_error join (const Gcs_communication_event_listener &communication_event_listener, const Gcs_control_event_listener &control_event_listener, Plugin_gcs_view_modification_notifier *view_notifier)
 Request server to join the group. More...
 
bool belongs_to_group ()
 Returns true if this server belongs to the group. More...
 
enum_leave_state leave (Plugin_gcs_view_modification_notifier *view_notifier)
 Request GCS interface to leave the group. More...
 
void notify_of_view_change_end ()
 Notify all listeners that a view changed. More...
 
void notify_of_view_change_cancellation (int errnr=GROUP_REPLICATION_CONFIGURATION_ERROR)
 Notify all listeners that a view was canceled. More...
 
bool is_injected_view_modification ()
 Checks if the view modification is a injected one. More...
 
void remove_view_notifer (Plugin_gcs_view_modification_notifier *view_notifier)
 Removes the notifier from the list. More...
 
void leave_coordination_member_left ()
 Declare the member as being already out of the group. More...
 
int get_local_member_identifier (std::string &identifier)
 Get the local member identifier. More...
 
enum enum_gcs_error send_message (const Plugin_gcs_message &message, bool skip_if_not_initialized=false)
 Send a message to the group. More...
 
int force_members (const char *members)
 Forces a new group membership, on which the excluded members will not receive a new view and will be blocked. More...
 
uint32_t get_minimum_write_concurrency () const
 Retrieves the minimum supported "write concurrency" value. More...
 
uint32_t get_maximum_write_concurrency () const
 Retrieves the maximum supported "write concurrency" value. More...
 
enum enum_gcs_error get_write_concurrency (uint32_t &write_concurrency)
 Retrieves the group's "write concurrency" value. More...
 
enum enum_gcs_error set_write_concurrency (uint32_t new_write_concurrency)
 Reconfigures the group's "write concurrency" value. More...
 
Gcs_protocol_version get_protocol_version ()
 Retrieves the group's "group communication protocol" value. More...
 
std::pair< bool, std::future< void > > set_protocol_version (Gcs_protocol_version gcs_protocol)
 Modifies the GCS protocol version in use. More...
 
Gcs_protocol_version get_maximum_protocol_version ()
 Get the maximum protocol version currently supported by the group. More...
 
enum enum_gcs_error set_xcom_cache_size (uint64_t new_size)
 Requests GCS to change the maximum size of the XCom cache. More...
 
bool is_initialized ()
 Returns a flag indicating whether or not the component is initialized. More...
 

Static Public Member Functions

static const std::string & get_gcs_engine ()
 

Private Member Functions

enum enum_gcs_error do_set_debug_options (std::string &debug_options) const
 Internal function that configures the debug options that shall be used by GCS. More...
 
Gcs_group_management_interfaceget_gcs_group_manager () const
 
Gcs_communication_interfaceget_gcs_communication () const
 

Private Attributes

Gcs_gr_logger_impl gcs_logger
 
Gcs_interfacegcs_interface
 
bool injected_view_modification
 Was this view change injected. More...
 
bool leave_coordination_leaving
 Is the member leaving. More...
 
bool leave_coordination_left
 Did the member already left. More...
 
bool finalize_ongoing
 Is finalize ongoing. More...
 
std::list< Plugin_gcs_view_modification_notifier * > view_change_notifier_list
 List of associated view change notifiers waiting. More...
 
Checkable_rwlockgcs_operations_lock
 
Checkable_rwlockview_observers_lock
 Lock for the list of waiters on a view change. More...
 
Checkable_rwlockfinalize_ongoing_lock
 

Static Private Attributes

static const std::string gcs_engine = "xcom"
 

Detailed Description

Coordinates all operations to GCS interface.

Member Enumeration Documentation

◆ enum_leave_state

This enumeration describes the return values when a process tries to leave a group.

Enumerator
NOW_LEAVING 
ALREADY_LEAVING 
ALREADY_LEFT 
ERROR_WHEN_LEAVING 

Constructor & Destructor Documentation

◆ Gcs_operations()

Gcs_operations::Gcs_operations ( )

Default constructor.

◆ ~Gcs_operations()

Gcs_operations::~Gcs_operations ( )
virtual

Destructor.

Member Function Documentation

◆ belongs_to_group()

bool Gcs_operations::belongs_to_group ( )

Returns true if this server belongs to the group.

◆ configure()

enum enum_gcs_error Gcs_operations::configure ( const Gcs_interface_parameters parameters)

Configure the GCS interface.

Parameters
[in]parametersThe configuration parameters
Returns
the operation status
Return values
0OK
!=0Error

◆ do_set_debug_options()

enum enum_gcs_error Gcs_operations::do_set_debug_options ( std::string &  debug_options) const
private

Internal function that configures the debug options that shall be used by GCS.

◆ finalize()

void Gcs_operations::finalize ( )

Finalize the GCS interface.

◆ force_members()

int Gcs_operations::force_members ( const char *  members)

Forces a new group membership, on which the excluded members will not receive a new view and will be blocked.

Parameters
membersThe list of members, comma separated. E.g., host1:port1,host2:port2
Returns
Operation status
Return values
0OK
!=0Error

◆ get_current_view()

Gcs_view * Gcs_operations::get_current_view ( )

Get the group current view.

Returns
a copy of the group current view. NULL if member does not belong to a group.. The return value must deallocated by the caller.

◆ get_gcs_communication()

Gcs_communication_interface * Gcs_operations::get_gcs_communication ( ) const
private

◆ get_gcs_engine()

const std::string & Gcs_operations::get_gcs_engine ( )
static
Returns
the communication engine being used

◆ get_gcs_group_manager()

Gcs_group_management_interface * Gcs_operations::get_gcs_group_manager ( ) const
private

◆ get_local_member_identifier()

int Gcs_operations::get_local_member_identifier ( std::string &  identifier)

Get the local member identifier.

Parameters
[out]identifierThe local member identifier when the method is successful
Returns
Operation status
Return values
0OK
!=0Error

◆ get_maximum_protocol_version()

Gcs_protocol_version Gcs_operations::get_maximum_protocol_version ( )

Get the maximum protocol version currently supported by the group.

Returns
the maximum protocol version currently supported by the group

◆ get_maximum_write_concurrency()

uint32_t Gcs_operations::get_maximum_write_concurrency ( ) const

Retrieves the maximum supported "write concurrency" value.

◆ get_minimum_write_concurrency()

uint32_t Gcs_operations::get_minimum_write_concurrency ( ) const

Retrieves the minimum supported "write concurrency" value.

◆ get_protocol_version()

Gcs_protocol_version Gcs_operations::get_protocol_version ( )

Retrieves the group's "group communication protocol" value.

Return values
theprotocol version

◆ get_write_concurrency()

enum enum_gcs_error Gcs_operations::get_write_concurrency ( uint32_t &  write_concurrency)

Retrieves the group's "write concurrency" value.

Parameters
[out]write_concurrencyA reference to where the group's "write concurrency" will be written to
Return values
GCS_OKif successful
GCS_NOKif unsuccessful

◆ initialize()

int Gcs_operations::initialize ( )

Initialize the GCS interface.

Returns
the operation status
Return values
0OK
!=0Error

◆ is_initialized()

bool Gcs_operations::is_initialized ( )

Returns a flag indicating whether or not the component is initialized.

Return values
trueif the component is initialized.
falseotherwise.

◆ is_injected_view_modification()

bool Gcs_operations::is_injected_view_modification ( )

Checks if the view modification is a injected one.

Returns
Return values
trueif the current view modification is a injected one
falseotherwise

◆ join()

enum enum_gcs_error Gcs_operations::join ( const Gcs_communication_event_listener communication_event_listener,
const Gcs_control_event_listener control_event_listener,
Plugin_gcs_view_modification_notifier view_notifier 
)

Request server to join the group.

Parameters
[in]communication_event_listenerThe communication event listener
[in]control_event_listenerThe control event listener
[in]view_notifierA view change notifier to know the response
Returns
the operation status
Return values
0OK
!=0Error

◆ leave()

Gcs_operations::enum_leave_state Gcs_operations::leave ( Plugin_gcs_view_modification_notifier view_notifier)

Request GCS interface to leave the group.

Parameters
[in]view_notifierA view change notifier to know the response. Pass a null pointer if you don't want to wait

Note: This method only asks to leave, it does not know if request was successful

Returns
the operation status
Return values
NOW_LEAVINGRequest accepted, the member is leaving
ALREADY_LEAVINGThe member is already leaving
ALREADY_LEFTThe member already left
ERROR_WHEN_LEAVINGAn error happened when trying to leave

◆ leave_coordination_member_left()

void Gcs_operations::leave_coordination_member_left ( )

Declare the member as being already out of the group.

◆ notify_of_view_change_cancellation()

void Gcs_operations::notify_of_view_change_cancellation ( int  errnr = GROUP_REPLICATION_CONFIGURATION_ERROR)

Notify all listeners that a view was canceled.

Parameters
[in]errnrThe error associated to this view

◆ notify_of_view_change_end()

void Gcs_operations::notify_of_view_change_end ( )

Notify all listeners that a view changed.

◆ reconfigure()

enum enum_gcs_error Gcs_operations::reconfigure ( const Gcs_interface_parameters parameters)

Reconfigure the GCS interface, i.e.

update its configuration parameters.

Parameters
[in]parametersThe configuration parameters
Returns
the operation status
Return values
0OK
!=0Error

◆ remove_view_notifer()

void Gcs_operations::remove_view_notifer ( Plugin_gcs_view_modification_notifier view_notifier)

Removes the notifier from the list.

◆ send_message()

enum enum_gcs_error Gcs_operations::send_message ( const Plugin_gcs_message message,
bool  skip_if_not_initialized = false 
)

Send a message to the group.

Parameters
[in]messageThe message to send
[in]skip_if_not_initializedIf true, the message will not be sent and no errors will returned when the GCS interface is not initialized
Returns
the operation status
Return values
0OK
!=0Error

◆ set_debug_options()

enum enum_gcs_error Gcs_operations::set_debug_options ( std::string &  debug_options) const

Configure the debug options that shall be used by GCS.

Parameters
debug_optionsSet of debug options separated by comma
Returns
the operation status
Return values
0OK
!=0Error

◆ set_protocol_version()

std::pair< bool, std::future< void > > Gcs_operations::set_protocol_version ( Gcs_protocol_version  gcs_protocol)

Modifies the GCS protocol version in use.

The method is non-blocking. It returns a future on which the caller can wait for the action to finish.

Parameters
gcs_protocolThe desired GCS protocol version
Return values
{true,future}If successful
{false,_}If unsuccessful because new_version is unsupported

◆ set_write_concurrency()

enum enum_gcs_error Gcs_operations::set_write_concurrency ( uint32_t  new_write_concurrency)

Reconfigures the group's "write concurrency" value.

The caller should ensure that the supplied value is between minimum_write_concurrency and maximum_write_concurrency.

The method is non-blocking, meaning that it shall only send the request to an underlying GCS. The final result can be polled via get_write_concurrency.

Parameters
new_write_concurrencyThe desired "write concurrency" value.
Return values
GCS_OKif successful
GCS_NOKif unsuccessful

◆ set_xcom_cache_size()

enum enum_gcs_error Gcs_operations::set_xcom_cache_size ( uint64_t  new_size)

Requests GCS to change the maximum size of the XCom cache.

Parameters
new_sizeThe new maximum size of the XCom cache.
Return values
GCS_OKif request successfully scheduled
GCS_NOKif GCS is unable to schedule the request

Member Data Documentation

◆ finalize_ongoing

bool Gcs_operations::finalize_ongoing
private

Is finalize ongoing.

◆ finalize_ongoing_lock

Checkable_rwlock* Gcs_operations::finalize_ongoing_lock
private

◆ gcs_engine

const std::string Gcs_operations::gcs_engine = "xcom"
staticprivate

◆ gcs_interface

Gcs_interface* Gcs_operations::gcs_interface
private

◆ gcs_logger

Gcs_gr_logger_impl Gcs_operations::gcs_logger
private

◆ gcs_operations_lock

Checkable_rwlock* Gcs_operations::gcs_operations_lock
private

◆ injected_view_modification

bool Gcs_operations::injected_view_modification
private

Was this view change injected.

◆ leave_coordination_leaving

bool Gcs_operations::leave_coordination_leaving
private

Is the member leaving.

◆ leave_coordination_left

bool Gcs_operations::leave_coordination_left
private

Did the member already left.

◆ view_change_notifier_list

std::list<Plugin_gcs_view_modification_notifier *> Gcs_operations::view_change_notifier_list
private

List of associated view change notifiers waiting.

◆ view_observers_lock

Checkable_rwlock* Gcs_operations::view_observers_lock
private

Lock for the list of waiters on a view change.


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