![]() |
MySQL 9.5.0
Source Code Documentation
|
#include <cluster_metadata.h>
Public Member Functions | |
| ClusterMetadata (const MetadataSchemaVersion &schema_version, MySQLSession *mysql, mysql_harness::SocketOperationsBase *sockops=mysql_harness::SocketOperations::instance()) | |
| virtual | ~ClusterMetadata ()=default |
| virtual mysqlrouter::ClusterType | get_type ()=0 |
| virtual void | verify_router_id_is_ours (const uint32_t router_id, const std::string &hostname_override="")=0 |
| Checks if Router with given id is already registered in metadata database, and belongs to our machine. More... | |
| virtual uint32_t | register_router (const std::string &router_name, const bool overwrite, const std::string &hostname_override="")=0 |
| Registers Router in metadata database. More... | |
| virtual 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_split_endpoint, const std::string &rw_x_endpoint, const std::string &ro_x_endpoint, const std::string &username, const std::string &local_cluster)=0 |
| virtual std::vector< std::string > | get_routing_mode_queries ()=0 |
| virtual void | require_metadata_is_ok () |
| Verify that host is a valid metadata server. More... | |
| virtual void | require_cluster_is_ok ()=0 |
| Verify that host is a valid cluster member (either Group Replication or ReplicaSet cluster) More... | |
| virtual std::string | get_cluster_type_specific_id ()=0 |
| virtual ClusterInfo | fetch_metadata_servers ()=0 |
| virtual InstanceType | fetch_current_instance_type ()=0 |
| virtual std::vector< std::string > | get_grant_statements (const std::string &new_accounts) const =0 |
| virtual std::vector< std::tuple< std::string, unsigned long > > | fetch_cluster_hosts ()=0 |
| virtual std::string | get_local_cluster () |
| Get name of the cluster that was used for bootstrap. More... | |
| MySQLSession & | get_session () |
| virtual uint64_t | get_view_id (const std::string &) |
Protected Member Functions | |
| virtual uint64_t | query_cluster_count ()=0 |
Protected Attributes | |
| MySQLSession * | mysql_ |
| mysql_harness::SocketOperationsBase * | socket_operations_ |
| mysqlrouter::MetadataSchemaVersion | schema_version_ |
|
inline |
|
virtualdefault |
|
pure virtual |
|
pure virtual |
Implemented in mysqlrouter::ClusterMetadataGRV2, and mysqlrouter::ClusterMetadataAR.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Implemented in mysqlrouter::ClusterMetadataGRV2, and mysqlrouter::ClusterMetadataAR.
|
virtual |
Get name of the cluster that was used for bootstrap.
Reimplemented in mysqlrouter::ClusterMetadataGRInClusterSet.
|
pure virtual |
Implemented in mysqlrouter::ClusterMetadataGRV2, and mysqlrouter::ClusterMetadataAR.
|
inline |
|
pure virtual |
|
inlinevirtual |
Reimplemented in mysqlrouter::ClusterMetadataAR, and mysqlrouter::ClusterMetadataGRInClusterSet.
|
protectedpure virtual |
Implemented in mysqlrouter::ClusterMetadataGRV2, and mysqlrouter::ClusterMetadataAR.
|
pure virtual |
Registers Router in metadata database.
| 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 |
| LocalHostnameResolutionError(std::runtime_error) | on hostname query failure, std::runtime_error on other failure |
Implemented in mysqlrouter::ClusterMetadataGRV2, and mysqlrouter::ClusterMetadataAR.
|
pure virtual |
Verify that host is a valid cluster member (either Group Replication or ReplicaSet cluster)
| MySQLSession::Error | TODO |
| std::runtime_error | TODO |
| std::out_of_range | TODO |
| std::logic_error | TODO |
Implemented in mysqlrouter::ClusterMetadataGR, and mysqlrouter::ClusterMetadataAR.
|
virtual |
Verify that host is a valid metadata server.
| MySQLSession::Error | TODO |
| std::runtime_error | TODO |
| std::out_of_range | TODO |
| std::logic_error | TODO |
checks that the server
Reimplemented in mysqlrouter::ClusterMetadataGRInClusterSet.
|
pure virtual |
|
pure virtual |
Checks if Router with given id is already registered in metadata database, and belongs to our machine.
| router_id | Router id |
| hostname_override | If non-empty, this hostname will be used instead of getting queried from OS |
| 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 |
Implemented in mysqlrouter::ClusterMetadataGRV2, and mysqlrouter::ClusterMetadataAR.
|
protected |
|
protected |
|
protected |