#include <cluster_metadata.h>
|
| ClusterMetadataAR (const MetadataSchemaVersion &schema_version, MySQLSession *mysql, mysql_harness::SocketOperationsBase *sockops=mysql_harness::SocketOperations::instance()) |
|
| ~ClusterMetadataAR () override=default |
|
mysqlrouter::ClusterType | get_type () override |
|
void | require_cluster_is_ok () override |
| Verify that host is a valid cluster member (either Group Replication or ReplicaSet cluster) More...
|
|
ClusterInfo | fetch_metadata_servers () override |
|
std::string | get_cluster_type_specific_id () override |
|
uint64_t | get_view_id (const std::string &) override |
|
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...
|
|
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 |
|
std::vector< std::tuple< std::string, unsigned long > > | fetch_cluster_hosts () override |
|
| ClusterMetadata (const MetadataSchemaVersion &schema_version, MySQLSession *mysql, mysql_harness::SocketOperationsBase *sockops=mysql_harness::SocketOperations::instance()) |
|
virtual | ~ClusterMetadata ()=default |
|
virtual void | require_metadata_is_ok () |
| Verify that host is a valid metadata server. More...
|
|
MySQLSession & | get_session () |
|
◆ ClusterMetadataAR()
◆ ~ClusterMetadataAR()
mysqlrouter::ClusterMetadataAR::~ClusterMetadataAR |
( |
| ) |
|
|
overridedefault |
◆ fetch_cluster_hosts()
std::vector< std::tuple< std::string, unsigned long > > mysqlrouter::ClusterMetadataAR::fetch_cluster_hosts |
( |
| ) |
|
|
overridevirtual |
◆ fetch_metadata_servers()
ClusterInfo mysqlrouter::ClusterMetadataAR::fetch_metadata_servers |
( |
| ) |
|
|
overridevirtual |
◆ get_cluster_type_specific_id()
std::string mysqlrouter::ClusterMetadataAR::get_cluster_type_specific_id |
( |
| ) |
|
|
overridevirtual |
◆ get_grant_statements()
std::vector< std::string > mysqlrouter::ClusterMetadataAR::get_grant_statements |
( |
const std::string & |
new_accounts | ) |
const |
|
overridevirtual |
◆ get_routing_mode_queries()
std::vector< std::string > mysqlrouter::ClusterMetadataAR::get_routing_mode_queries |
( |
| ) |
|
|
overridevirtual |
◆ get_type()
◆ get_view_id()
uint64_t mysqlrouter::ClusterMetadataAR::get_view_id |
( |
const std::string & |
| ) |
|
|
overridevirtual |
◆ query_cluster_count()
uint64_t mysqlrouter::ClusterMetadataAR::query_cluster_count |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ register_router()
uint32_t mysqlrouter::ClusterMetadataAR::register_router |
( |
const std::string & |
router_name, |
|
|
const bool |
overwrite, |
|
|
const std::string & |
hostname_override = "" |
|
) |
| |
|
overridevirtual |
Registers Router in metadata database.
- Parameters
-
router_name | Router name |
overwrite | if Router name is already registered, allow this registration to be "hijacked" instead of throwing |
hostname_override | If 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.
◆ require_cluster_is_ok()
void mysqlrouter::ClusterMetadataAR::require_cluster_is_ok |
( |
| ) |
|
|
inlineoverridevirtual |
Verify that host is a valid cluster member (either Group Replication or ReplicaSet cluster)
- Exceptions
-
MySQLSession::Error | |
std::runtime_error | |
std::out_of_range | |
std::logic_error | |
Implements mysqlrouter::ClusterMetadata.
◆ update_router_info()
void mysqlrouter::ClusterMetadataAR::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::ClusterMetadataAR::verify_router_id_is_ours |
( |
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_id | Router id |
hostname_override | If non-empty, this hostname will be used instead of getting queried from OS |
- Exceptions
-
LocalHostnameResolutionError(std::runtime_error) | on hostname query failure |
std::runtime_error | if 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: