MySQL 8.4.2
Source Code Documentation
|
This interface represents all the control functionalities that a binding implementation must provide. More...
#include <gcs_control_interface.h>
Public Member Functions | |
virtual enum_gcs_error | join ()=0 |
Method that causes one to join the group that this interface pertains. More... | |
virtual enum_gcs_error | leave ()=0 |
Method that causes one to leave the group that this interface pertains. More... | |
virtual bool | belongs_to_group ()=0 |
Reports if one has joined and belongs to a group. More... | |
virtual Gcs_view * | get_current_view ()=0 |
Returns the currently installed view. More... | |
virtual const Gcs_member_identifier | get_local_member_identifier () const =0 |
Retrieves the local identifier of this member on a group. More... | |
virtual int | add_event_listener (const Gcs_control_event_listener &event_listener)=0 |
Registers an implementation of a Gcs_control_event_listener that will receive Control Events. More... | |
virtual void | remove_event_listener (int event_listener_handle)=0 |
Removes a previously registered event listener. More... | |
virtual enum_gcs_error | set_xcom_cache_size (uint64_t size)=0 |
Sets a new value for the maximum size of the XCom cache. More... | |
virtual | ~Gcs_control_interface ()=default |
This interface represents all the control functionalities that a binding implementation must provide.
Like all interfaces in this API, it is group-oriented, meaning that a single instance shall exist per group, as it was returned by the class Gcs_interface::get_control_session.
It contains methods for:
View Membership contain operations that will conduct one to:
Due to the asynchronous nature of this interface, the results of join() and leave() operations, in local or remote members, shall come via an event. Those events shall be delivered in form of callbacks defined in Gcs_control_event_listener, that should be implemented by a client of this interface interested in receiving those notifications.
Regarding Generic Data Exchange, it is a functionality that was created to allow exchange of arbitrary data among members when one joins. This generic data is retrieved via the callback get_exchangeable_data() each time a View Change (VC) occurs. It states the data that one would like to offer in exchange whenever a VC happens.
What must happen under the hood is that, when one receives a VC from the underlying GCS, the binding implementation should start a round of message exchange, in which members (one or all depending of the algorithm) send the Exchangeable Data to the joining node.
That data is delivered when Gcs_control_event_listener::on_view_changed is called, which hands-out all exchanged data in one point in time.
A typical usage for that interface would be:
|
virtualdefault |
|
pure virtual |
Registers an implementation of a Gcs_control_event_listener that will receive Control Events.
See the class header for more details on implementations and usage.
Note that a binding implementation shall not offer the possibility of changing listeners while the system is up and running. In that sense, listeners must be added to it only when booting up the system.
[in] | event_listener | a class that implements Gcs_control_event_listener |
Implemented in Gcs_xcom_control.
|
pure virtual |
Reports if one has joined and belongs to a group.
true | if belonging to a group |
Implemented in Gcs_xcom_control.
|
pure virtual |
Returns the currently installed view.
pointer | to a Gcs_view object. If one has left a group, this shall be the last installed view. That view can be considered a best-effort view since, in some GCSs, the one that leaves might not have access to the exchanged information. |
NULL | if one never joined a group. |
Implemented in Gcs_xcom_control.
|
pure virtual |
Retrieves the local identifier of this member on a group.
reference | to a valid Gcs_member_identifier instance |
NULL | in case of error |
Implemented in Gcs_xcom_control.
|
pure virtual |
Method that causes one to join the group that this interface pertains.
The method is non-blocking, meaning that it shall only send the request to an underlying GCS. The final result shall come via a View Change event delivered through Gcs_control_event_listener.
GCS_OK | in case of everything goes well. Any other value of gcs_error in case of error. |
Implemented in Gcs_xcom_control.
|
pure virtual |
Method that causes one to leave the group that this interface pertains.
The method is non-blocking, meaning that it shall only send the request to an underlying GCS. The final result shall come via a View Change event delivered through Gcs_control_event_listener.
GCS_OK | in case of everything goes well. Any other value of gcs_error in case of error |
Implemented in Gcs_xcom_control.
|
pure virtual |
Removes a previously registered event listener.
Note that a binding implementation shall not offer the possibility of changing listeners while the system is up and running. In that sense listeners must be removed from it only when shutting down the system.
[in] | event_listener_handle | the handle returned when the listener was registered |
Implemented in Gcs_xcom_control.
|
pure virtual |
Sets a new value for the maximum size of the XCom cache.
[in] | size | the new maximum size of the XCom cache |
- | GCS_OK if request was successfully scheduled in XCom, GCS_NOK otherwise. |
Implemented in Gcs_xcom_control.