MySQL  8.0.28
Source Code Documentation
mysqlrouter::ClusterMetadataGRV1 Class Reference

#include <cluster_metadata.h>

Inheritance diagram for mysqlrouter::ClusterMetadataGRV1:
mysqlrouter::ClusterMetadataGR mysqlrouter::ClusterMetadata

Public Member Functions

 ClusterMetadataGRV1 (const MetadataSchemaVersion &schema_version, MySQLSession *mysql, mysql_harness::SocketOperationsBase *sockops=mysql_harness::SocketOperations::instance())
 
 ~ClusterMetadataGRV1 () override=default
 
mysqlrouter::ClusterType get_type () override
 
ClusterInfo fetch_metadata_servers () override
 
std::vector< std::string > get_routing_mode_queries (const std::string &cluster_name) override
 
void verify_router_id_is_ours (const 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...
 
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
 
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
 
std::string get_cluster_type_specific_id () override
 
void require_cluster_is_ok () override
 Verify that host is a valid cluster member (either Group Replication or ReplicaSet cluster) More...
 
std::vector< std::tuple< std::string, unsigned long > > fetch_cluster_hosts () override
 

Protected Member Functions

uint64_t query_cluster_count () override
 

Additional Inherited Members

Constructor & Destructor Documentation

◆ ClusterMetadataGRV1()

mysqlrouter::ClusterMetadataGRV1::ClusterMetadataGRV1 ( const MetadataSchemaVersion schema_version,
MySQLSession mysql,
mysql_harness::SocketOperationsBase sockops = mysql_harness::SocketOperations::instance() 
)
inline

◆ ~ClusterMetadataGRV1()

mysqlrouter::ClusterMetadataGRV1::~ClusterMetadataGRV1 ( )
overridedefault

Member Function Documentation

◆ fetch_metadata_servers()

ClusterInfo mysqlrouter::ClusterMetadataGRV1::fetch_metadata_servers ( )
overridevirtual

◆ get_grant_statements()

std::vector< std::string > mysqlrouter::ClusterMetadataGRV1::get_grant_statements ( const std::string &  new_accounts) const
overridevirtual

◆ get_routing_mode_queries()

std::vector< std::string > mysqlrouter::ClusterMetadataGRV1::get_routing_mode_queries ( const std::string &  cluster_name)
overridevirtual

◆ get_type()

mysqlrouter::ClusterType mysqlrouter::ClusterMetadataGRV1::get_type ( )
inlineoverridevirtual

◆ query_cluster_count()

uint64_t mysqlrouter::ClusterMetadataGRV1::query_cluster_count ( )
overrideprotectedvirtual

◆ register_router()

uint32_t mysqlrouter::ClusterMetadataGRV1::register_router ( const std::string &  router_name,
const bool  overwrite,
const std::string &  hostname_override = "" 
)
overridevirtual

Registers Router in metadata database.

Parameters
router_nameRouter name
overwriteif Router name is already registered, allow this registration to be "hijacked" instead of throwing
hostname_overrideIf non-empty, this hostname will be used instead of getting queried from OS
Returns
newly-assigned router_id
Exceptions
LocalHostnameResolutionError(std::runtime_error)on hostname query failure, std::runtime_error on other failure

Implements mysqlrouter::ClusterMetadata.

◆ update_router_info()

void mysqlrouter::ClusterMetadataGRV1::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

◆ verify_router_id_is_ours()

void mysqlrouter::ClusterMetadataGRV1::verify_router_id_is_ours ( const uint32_t  router_id,
const std::string &  hostname_override = "" 
)
overridevirtual

Checks if Router with given id is already registered in metadata database, and belongs to our machine.

Parameters
router_idRouter id
hostname_overrideIf non-empty, this hostname will be used instead of getting queried from OS
Exceptions
LocalHostnameResolutionError(std::runtime_error)on hostname query failure
std::runtime_errorif router_id doesn't exist, or is associated with a different host
MySQLSession::Error(std::runtime_error)on database error

Implements mysqlrouter::ClusterMetadata.


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