MySQL 8.0.39
Source Code Documentation
mysqlrouter::ClusterMetadataGRInClusterSet Class Reference

#include <cluster_metadata.h>

Inheritance diagram for mysqlrouter::ClusterMetadataGRInClusterSet:
[legend]

Public Types

enum class  TargetClusterType { targetClusterCurrent , targetClusterPrimary , targetClusterByName }
 

Public Member Functions

 ClusterMetadataGRInClusterSet (const MetadataSchemaVersion &schema_version, MySQLSession *mysql, const OptionsMap &, mysql_harness::SocketOperationsBase *sockops=mysql_harness::SocketOperations::instance())
 
 ~ClusterMetadataGRInClusterSet () override=default
 
mysqlrouter::ClusterType get_type () override
 
void require_metadata_is_ok () override
 Verify that host is a valid metadata server. More...
 
ClusterInfo fetch_metadata_servers () override
 
std::vector< std::tuple< std::string, unsigned long > > fetch_cluster_hosts () override
 
std::string get_cluster_type_specific_id () override
 
uint64_t get_view_id (const std::string &cluster_type_specific_id) override
 
void update_router_info (const uint32_t router_id, const std::string &cluster_id, const std::string &target_cluster, const std::string &rw_endpoint, const std::string &ro_endpoint, const std::string &rw_x_endpoint, const std::string &ro_x_endpoint, const std::string &username) override
 
- Public Member Functions inherited from mysqlrouter::ClusterMetadataGRV2
 ClusterMetadataGRV2 (const MetadataSchemaVersion &schema_version, MySQLSession *mysql, mysql_harness::SocketOperationsBase *sockops=mysql_harness::SocketOperations::instance())
 
 ~ClusterMetadataGRV2 () override=default
 
std::vector< std::string > get_routing_mode_queries () override
 
void verify_router_id_is_ours (uint32_t router_id, const std::string &hostname_override="") override
 Checks if Router with given id is already registered in metadata database, and belongs to our machine. More...
 
uint32_t register_router (const std::string &router_name, const bool overwrite, const std::string &hostname_override="") override
 Registers Router in metadata database. More...
 
std::vector< std::string > get_grant_statements (const std::string &new_accounts) const override
 
- Public Member Functions inherited from mysqlrouter::ClusterMetadataGR
 ClusterMetadataGR (const MetadataSchemaVersion &schema_version, MySQLSession *mysql, mysql_harness::SocketOperationsBase *sockops=mysql_harness::SocketOperations::instance())
 
 ~ClusterMetadataGR () override=default
 
void require_cluster_is_ok () override
 Verify that host is a valid cluster member (either Group Replication or ReplicaSet cluster) More...
 

Protected Attributes

TargetClusterType target_cluster_type_
 
std::string target_cluster_name_
 

Additional Inherited Members

- Protected Member Functions inherited from mysqlrouter::ClusterMetadataGRV2
uint64_t query_cluster_count () override
 

Member Enumeration Documentation

◆ TargetClusterType

Enumerator
targetClusterCurrent 
targetClusterPrimary 
targetClusterByName 

Constructor & Destructor Documentation

◆ ClusterMetadataGRInClusterSet()

mysqlrouter::ClusterMetadataGRInClusterSet::ClusterMetadataGRInClusterSet ( const MetadataSchemaVersion schema_version,
MySQLSession mysql,
const OptionsMap options,
mysql_harness::SocketOperationsBase sockops = mysql_harness::SocketOperations::instance() 
)

◆ ~ClusterMetadataGRInClusterSet()

mysqlrouter::ClusterMetadataGRInClusterSet::~ClusterMetadataGRInClusterSet ( )
overridedefault

Member Function Documentation

◆ fetch_cluster_hosts()

std::vector< std::tuple< std::string, unsigned long > > mysqlrouter::ClusterMetadataGRInClusterSet::fetch_cluster_hosts ( )
overridevirtual

Reimplemented from mysqlrouter::ClusterMetadataGR.

◆ fetch_metadata_servers()

ClusterInfo mysqlrouter::ClusterMetadataGRInClusterSet::fetch_metadata_servers ( )
overridevirtual

Reimplemented from mysqlrouter::ClusterMetadataGRV2.

◆ get_cluster_type_specific_id()

std::string mysqlrouter::ClusterMetadataGRInClusterSet::get_cluster_type_specific_id ( )
overridevirtual

Reimplemented from mysqlrouter::ClusterMetadataGR.

◆ get_type()

mysqlrouter::ClusterType mysqlrouter::ClusterMetadataGRInClusterSet::get_type ( )
inlineoverridevirtual

Reimplemented from mysqlrouter::ClusterMetadataGRV2.

◆ get_view_id()

uint64_t mysqlrouter::ClusterMetadataGRInClusterSet::get_view_id ( const std::string &  cluster_type_specific_id)
overridevirtual

Reimplemented from mysqlrouter::ClusterMetadata.

◆ require_metadata_is_ok()

void mysqlrouter::ClusterMetadataGRInClusterSet::require_metadata_is_ok ( )
inlineoverridevirtual

Verify that host is a valid metadata server.

Exceptions
MySQLSession::Error
std::runtime_error
std::out_of_range
std::logic_error

checks that the server

  • has the metadata in the correct version
  • contains metadata for the group it's in (in case of GR cluster) (metadata server group must be same as managed group currently)

Reimplemented from mysqlrouter::ClusterMetadata.

◆ update_router_info()

void mysqlrouter::ClusterMetadataGRInClusterSet::update_router_info ( const uint32_t  router_id,
const std::string &  cluster_id,
const std::string &  target_cluster,
const std::string &  rw_endpoint,
const std::string &  ro_endpoint,
const std::string &  rw_x_endpoint,
const std::string &  ro_x_endpoint,
const std::string &  username 
)
overridevirtual

Reimplemented from mysqlrouter::ClusterMetadataGRV2.

Member Data Documentation

◆ target_cluster_name_

std::string mysqlrouter::ClusterMetadataGRInClusterSet::target_cluster_name_
protected

◆ target_cluster_type_

TargetClusterType mysqlrouter::ClusterMetadataGRInClusterSet::target_cluster_type_
protected

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