|
| GRClusterSetMetadataBackend (GRClusterMetadata *metadata, ConnectCallback &connect_clb) |
|
mysqlrouter::ClusterType | get_cluster_type () override |
|
stdx::expected< metadata_cache::ClusterTopology, std::error_code > | fetch_cluster_topology (MySQLSession::Transaction &transaction, const mysqlrouter::MetadataSchemaVersion &schema_version, mysqlrouter::TargetCluster &target_cluster, const unsigned router_id, const metadata_cache::metadata_server_t &metadata_server, const metadata_cache::metadata_servers_list_t &metadata_servers, bool needs_writable_node, const std::string &clusterset_id="", bool whole_topology=false) override |
| Returns cluster defined in the metadata given set of the metadata servers (cluster members) More...
|
|
void | reset () override |
|
std::vector< metadata_cache::metadata_servers_list_t > | get_metadata_servers (const metadata_cache::metadata_servers_list_t &metadata_servers) override |
|
virtual std::optional< std::chrono::seconds > | get_periodic_stats_update_frequency () noexcept override |
|
| GRMetadataBackendV2 (GRClusterMetadata *metadata, ConnectCallback &connect_clb) |
|
metadata_cache::ClusterTopology | fetch_instances_from_metadata_server (const mysqlrouter::TargetCluster &target_cluster, const std::string &clusterset_id="") override |
| Queries the metadata server for the list of instances that belong to the desired cluster. More...
|
|
virtual void | fetch_periodic_stats_update_frequency (const mysqlrouter::MetadataSchemaVersion &schema_version, const unsigned router_id) override |
|
| GRMetadataBackend (GRClusterMetadata *metadata, ConnectCallback &connect_clb) |
|
virtual | ~GRMetadataBackend () |
|
|
metadata_cache::cluster_nodes_list_t | fetch_target_cluster_instances_from_metadata_server (mysqlrouter::MySQLSession &session, const std::string &cluster_id) |
| Returns vector of the cluster members according to the metadata of the selected server. More...
|
|
std::tuple< std::string, std::string, mysqlrouter::TargetCluster > | get_target_cluster_info_from_metadata_server (mysqlrouter::MySQLSession &session, const mysqlrouter::TargetCluster &target_cluster, const std::string &clusterset_id) |
|
metadata_cache::ClusterTopology | update_clusterset_topology_from_metadata_server (mysqlrouter::MySQLSession &session, const std::string &clusterset_id, uint64_t view_id) |
| Queries the metada for the current ClusterSet topology. More...
|
|
void | update_clusterset_status_from_gr (metadata_cache::ClusterTopology &cs_topology, bool needs_writable_node, bool whole_topology, const RouterClusterSetOptions &router_cs_options, const metadata_cache::metadata_servers_list_t &metadata_servers) |
| Given the topology read from metadata updates the topology with the current status from GR tables. More...
|
|
std::optional< metadata_cache::metadata_server_t > | find_rw_server () |
| Finds the writable node within the currently known ClusterSet topology. More...
|
|
|
static void | update_metadata_servers_list (metadata_cache::ClusterTopology &cs_topology) |
| Given the topology read from the metadata and updated with the current staus from the GR tables updates the metadata_servers list putting them in the following order: 1) Primary Node of Primary Cluster 2) Secondary Nodes of Primary Cluster 3) Nodes of Secondary Clusters starting with Primary Node for each. More...
|
|
◆ GRClusterSetMetadataBackend()
◆ fetch_cluster_topology()
Returns cluster defined in the metadata given set of the metadata servers (cluster members)
- Parameters
-
| transaction | transaction to be used for SQL queries required by this function |
| schema_version | current metadata schema version |
[in,out] | target_cluster | object identifying the Cluster this operation refers to |
| router_id | id of the router in the cluster metadata |
| metadata_server | info about the metadata server we are querying |
| metadata_servers | set of all the metadata servers read during the bootstrap or the last metadata refresh, sorted by the staus of the cluster and status of the node in the cluster (Primary first) |
| needs_writable_node | flag indicating if the caller needs us to query for writable node |
| clusterset_id | UUID of the ClusterSet the Cluster belongs to (if bootstrapped as a ClusterSet) |
| whole_topology | return all usable nodes, ignore potential metadata filters or policies (like target_cluster etc.) |
- Returns
- object containing cluster topology information in case of success, or error code in case of failure
- Exceptions
-
metadata_cache::metadata_error | |
Reimplemented from GRMetadataBackend.
◆ fetch_target_cluster_instances_from_metadata_server()
Returns vector of the cluster members according to the metadata of the selected server.
- Parameters
-
session | active connection to the member that is checked for the metadata |
cluster_id | ID of the cluster this operation refers to |
- Returns
- vector of the cluster members
◆ find_rw_server()
Finds the writable node within the currently known ClusterSet topology.
- Returns
- address of the current primary node if found
-
std::nullopt if did not find any writable node primary
◆ get_cluster_type()
◆ get_metadata_servers()
◆ get_periodic_stats_update_frequency()
virtual std::optional< std::chrono::seconds > GRClusterSetMetadataBackend::get_periodic_stats_update_frequency |
( |
| ) |
|
|
inlineoverridevirtualnoexcept |
◆ get_target_cluster_info_from_metadata_server()
◆ reset()
void GRClusterSetMetadataBackend::reset |
( |
| ) |
|
|
inlineoverridevirtual |
◆ update_clusterset_status_from_gr()
Given the topology read from metadata updates the topology with the current status from GR tables.
- Parameters
-
cs_topology | ClusterSet topology as read from the metadata server |
needs_writable_node | flag indicating if the caller needs us to query for writable node |
whole_topology | return all usable nodes, ignore potential metadata filters or policies (like target_cluster etc.) |
router_cs_options | ClusterSet related options configured for this Router in the metadata |
metadata_servers | the list of ClusterSet metadata servers |
◆ update_clusterset_topology_from_metadata_server()
Queries the metada for the current ClusterSet topology.
Stores the topology in the class state. Returns the set of the metadata server for the ClusterSet.
- Parameters
-
session | active connection to the member that is checked for the metadata |
clusterset_id | ID of the ClusterSet this operation refers to |
view_id | view id of the metadata |
- Returns
- set of the servers that contains metadata for the ClusterSet
◆ update_metadata_servers_list()
Given the topology read from the metadata and updated with the current staus from the GR tables updates the metadata_servers list putting them in the following order: 1) Primary Node of Primary Cluster 2) Secondary Nodes of Primary Cluster 3) Nodes of Secondary Clusters starting with Primary Node for each.
- Parameters
-
cs_topology | ClusterSet topology |
◆ cluster_topology_
◆ metadata_read_
bool GRClusterSetMetadataBackend::metadata_read_ {false} |
|
private |
◆ router_cs_options_string
std::string GRClusterSetMetadataBackend::router_cs_options_string {""} |
|
private |
◆ view_id_
uint64_t GRClusterSetMetadataBackend::view_id_ {0} |
|
private |
The documentation for this class was generated from the following file: