MySQL 9.1.0
Source Code Documentation
Gcs_interface Class Referenceabstract

This interface must be implemented by all specific binding implementations as its entry point. More...

#include <gcs_interface.h>

Inheritance diagram for Gcs_interface:
[legend]

Public Member Functions

virtual enum_gcs_error initialize (const Gcs_interface_parameters &interface_params)=0
 Method used by a binding implementation in order to implement any internal startup procedure. More...
 
virtual bool is_initialized ()=0
 Method used to report if the binding interface has already been initialized. More...
 
virtual enum_gcs_error configure (const Gcs_interface_parameters &interface_params)=0
 Method used by a binding implementation in order to implement any type of necessary dynamic reconfiguration. More...
 
virtual enum_gcs_error finalize ()=0
 Method used by a binding implementation in order to implement any internal shutdown procedure. More...
 
virtual Gcs_control_interfaceget_control_session (const Gcs_group_identifier &group_identifier)=0
 Method that retrieves the binding implementation of the Control Session interface. More...
 
virtual Gcs_communication_interfaceget_communication_session (const Gcs_group_identifier &group_identifier)=0
 Method that retrieves the binding implementation of the Communication Session interface. More...
 
virtual Gcs_statistics_interfaceget_statistics (const Gcs_group_identifier &group_identifier)=0
 Method that retrieves the binding implementation of the Statistics interface. More...
 
virtual Gcs_group_management_interfaceget_management_session (const Gcs_group_identifier &group_identifier)=0
 Method that retrieves the binding implementation of the Group Management Session interface. More...
 
virtual enum_gcs_error set_logger (Logger_interface *logger)=0
 Method that retrieves the binding implementation of the Group Management Session interface. More...
 
virtual enum_gcs_error setup_runtime_resources (Gcs_interface_runtime_requirements &reqs)=0
 Set the up runtime resources. More...
 
virtual enum_gcs_error cleanup_runtime_resources (Gcs_interface_runtime_requirements &reqs)=0
 Does the necessary cleanup for runtime resources. More...
 
virtual ~Gcs_interface ()=default
 

Detailed Description

This interface must be implemented by all specific binding implementations as its entry point.

It should afterwards be distributed via a Factory, in order to allow its transparent instantiation.

All of the interfaces are group-oriented, meaning that all methods that allow the retrieval of sub-interfaces (control, communication, statistics) are oriented to serve all operations to a single group.

It provides two main functionalities:

  • Binding startup and finish;
  • Allow access to the control, communication and statistics interface.

A typical usage of this interface shall be:

Gcs_interface *group_if= new My_GCS_Gcs_interface();
params.add_parameter("name1", "value2");
if (!group_if->is_initialized())
{
group_if->initialize(params);
}
// Inject a logger if wanted
Logger_interface *logger= new My_GCS_Logger_interface();
group_if->set_logger(logger);
Gcs_group_identifier *group_id= new Gcs_group_identifier("my_group");
Gcs_control_interface *ctrl_if= group_if->get_control_session(group_id);
ctrl_if->join(); // notice here that group id is not used anymore...
// Do some operations here, retrieve other interfaces...
ctrl_if->leave();
group_if->finalize();
This interface represents all the control functionalities that a binding implementation must provide.
Definition: gcs_control_interface.h:111
virtual enum_gcs_error leave()=0
Method that causes one to leave the group that this interface pertains.
virtual enum_gcs_error join()=0
Method that causes one to join the group that this interface pertains.
This represents the unique identification of a group.
Definition: gcs_group_identifier.h:35
This class is to be used to provide parameters to bindings in a transparent and generic way.
Definition: gcs_types.h:59
void add_parameter(const std::string &name, const std::string &value)
Adds a parameter to the parameter catalog.
Definition: gcs_types.cc:31
This interface must be implemented by all specific binding implementations as its entry point.
Definition: gcs_interface.h:101
virtual enum_gcs_error finalize()=0
Method used by a binding implementation in order to implement any internal shutdown procedure.
virtual enum_gcs_error set_logger(Logger_interface *logger)=0
Method that retrieves the binding implementation of the Group Management Session interface.
virtual bool is_initialized()=0
Method used to report if the binding interface has already been initialized.
virtual Gcs_control_interface * get_control_session(const Gcs_group_identifier &group_identifier)=0
Method that retrieves the binding implementation of the Control Session interface.
virtual enum_gcs_error initialize(const Gcs_interface_parameters &interface_params)=0
Method used by a binding implementation in order to implement any internal startup procedure.
Logger interface that must be used to define a logger object.
Definition: gcs_logging.h:125
static Logger logger
The "top-level" logger used when no connection context is given.
Definition: test_trace_plugin.cc:296

Constructor & Destructor Documentation

◆ ~Gcs_interface()

virtual Gcs_interface::~Gcs_interface ( )
virtualdefault

Member Function Documentation

◆ cleanup_runtime_resources()

virtual enum_gcs_error Gcs_interface::cleanup_runtime_resources ( Gcs_interface_runtime_requirements reqs)
pure virtual

Does the necessary cleanup for runtime resources.

Parameters
reqsa Gcs_interface_runtime_requirements filled with all the requirements and their references

Implemented in Gcs_xcom_interface.

◆ configure()

virtual enum_gcs_error Gcs_interface::configure ( const Gcs_interface_parameters interface_params)
pure virtual

Method used by a binding implementation in order to implement any type of necessary dynamic reconfiguration.

An example of this could be an underlying GCS that needs to adjust itself to changes in a group. Note, however, that the method must be only used when the system is not running in order to avoid possible concurrency issues. Using cached information by the caller, after this member function has been called, results in undefined behavior.

Return values
GCS_OKin case of everything goes well. Any other value of gcs_error in case of error.

Implemented in Gcs_xcom_interface.

◆ finalize()

virtual enum_gcs_error Gcs_interface::finalize ( )
pure virtual

Method used by a binding implementation in order to implement any internal shutdown procedure.

Return values
GCS_OKin case of everything goes well. Any other value of gcs_error in case of error

Implemented in Gcs_xcom_interface.

◆ get_communication_session()

virtual Gcs_communication_interface * Gcs_interface::get_communication_session ( const Gcs_group_identifier group_identifier)
pure virtual

Method that retrieves the binding implementation of the Communication Session interface.

Parameters
[in]group_identifierthe group in which this implementation pertains
Returns
A valid reference to a gcs_communication_interface implementation. NULL, in case of error.

Implemented in Gcs_xcom_interface.

◆ get_control_session()

virtual Gcs_control_interface * Gcs_interface::get_control_session ( const Gcs_group_identifier group_identifier)
pure virtual

Method that retrieves the binding implementation of the Control Session interface.

Parameters
[in]group_identifierthe group in which this implementation pertains
Returns
A valid reference to a gcs_control_interface implementation, NULL, in case of error.

Implemented in Gcs_xcom_interface.

◆ get_management_session()

virtual Gcs_group_management_interface * Gcs_interface::get_management_session ( const Gcs_group_identifier group_identifier)
pure virtual

Method that retrieves the binding implementation of the Group Management Session interface.

Parameters
[in]group_identifierthe group in which this implementation pertains
Returns
A valid reference to a Gcs_group_management_interface implementation, NULL, in case of error.

Implemented in Gcs_xcom_interface.

◆ get_statistics()

virtual Gcs_statistics_interface * Gcs_interface::get_statistics ( const Gcs_group_identifier group_identifier)
pure virtual

Method that retrieves the binding implementation of the Statistics interface.

Parameters
[in]group_identifierthe group in which this implementation pertains
Returns
A valid reference to a gcs_statistics_interface implementation. NULL, in case of error.

Implemented in Gcs_xcom_interface.

◆ initialize()

virtual enum_gcs_error Gcs_interface::initialize ( const Gcs_interface_parameters interface_params)
pure virtual

Method used by a binding implementation in order to implement any internal startup procedure.

Return values
GCS_OKin case of everything goes well. Any other value of gcs_error in case of error.

Implemented in Gcs_xcom_interface.

◆ is_initialized()

virtual bool Gcs_interface::is_initialized ( )
pure virtual

Method used to report if the binding interface has already been initialized.

Return values
trueif already initialized

Implemented in Gcs_xcom_interface.

◆ set_logger()

virtual enum_gcs_error Gcs_interface::set_logger ( Logger_interface logger)
pure virtual

Method that retrieves the binding implementation of the Group Management Session interface.

Parameters
[in]loggerthe logger implementation for GCS to use
Return values
GCS_OKin case of everything goes well. Any other value of gcs_error in case of error

Implemented in Gcs_xcom_interface.

◆ setup_runtime_resources()

virtual enum_gcs_error Gcs_interface::setup_runtime_resources ( Gcs_interface_runtime_requirements reqs)
pure virtual

Set the up runtime resources.

Parameters
reqsa Gcs_interface_runtime_requirements filled with all the requirements

Implemented in Gcs_xcom_interface.


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