MySQL 8.0.40
Source Code Documentation
MetaData Class Referenceabstract

The metadata class is used to create a pluggable transport layer from which the metadata is fetched for the metadata cache. More...

#include <metadata.h>

Inheritance diagram for MetaData:
[legend]

Public Types

using JsonAllocator = rapidjson::CrtAllocator
 
using JsonDocument = rapidjson::Document
 
using auth_credentials_t = std::map< std::string, std::pair< std::string, JsonDocument > >
 

Public Member Functions

virtual stdx::expected< metadata_cache::ClusterTopology, std::error_code > fetch_cluster_topology (const std::atomic< bool > &terminated, mysqlrouter::TargetCluster &target_cluster, const unsigned router_id, const metadata_cache::metadata_servers_list_t &metadata_servers, bool needs_writable_node, const std::string &clusterset_id, bool whole_topology, std::size_t &instance_id)=0
 
virtual bool update_router_attributes (const metadata_cache::metadata_server_t &rw_server, const unsigned router_id, const metadata_cache::RouterAttributes &router_attributes)=0
 
virtual bool update_router_last_check_in (const metadata_cache::metadata_server_t &rw_server, const unsigned router_id)=0
 
virtual bool connect_and_setup_session (const metadata_cache::metadata_server_t &metadata_server)=0
 
virtual void disconnect ()=0
 
virtual void setup_notifications_listener (const metadata_cache::ClusterTopology &cluster_topology, const std::function< void()> &callback)=0
 
virtual void shutdown_notifications_listener ()=0
 
virtual std::shared_ptr< mysqlrouter::MySQLSessionget_connection ()=0
 
virtual mysqlrouter::ClusterType get_cluster_type ()=0
 
virtual auth_credentials_t fetch_auth_credentials (const mysqlrouter::TargetCluster &target_cluster)=0
 
virtual std::optional< std::chrono::secondsget_periodic_stats_update_frequency () noexcept=0
 
 MetaData ()=default
 
 MetaData (const MetaData &)=delete
 
MetaDataoperator= (const MetaData &)=delete
 
virtual ~MetaData ()=default
 

Detailed Description

The metadata class is used to create a pluggable transport layer from which the metadata is fetched for the metadata cache.

Member Typedef Documentation

◆ auth_credentials_t

using MetaData::auth_credentials_t = std::map<std::string, std::pair<std::string, JsonDocument> >

◆ JsonAllocator

using MetaData::JsonAllocator = rapidjson::CrtAllocator

◆ JsonDocument

using MetaData::JsonDocument = rapidjson::Document

Constructor & Destructor Documentation

◆ MetaData() [1/2]

MetaData::MetaData ( )
default

◆ MetaData() [2/2]

MetaData::MetaData ( const MetaData )
explicitdelete

◆ ~MetaData()

virtual MetaData::~MetaData ( )
virtualdefault

Member Function Documentation

◆ connect_and_setup_session()

virtual bool MetaData::connect_and_setup_session ( const metadata_cache::metadata_server_t metadata_server)
pure virtual

Implemented in ClusterMetadata.

◆ disconnect()

virtual void MetaData::disconnect ( )
pure virtual

Implemented in ClusterMetadata.

◆ fetch_auth_credentials()

virtual auth_credentials_t MetaData::fetch_auth_credentials ( const mysqlrouter::TargetCluster target_cluster)
pure virtual

Implemented in ClusterMetadata, and GRClusterMetadata.

◆ fetch_cluster_topology()

virtual stdx::expected< metadata_cache::ClusterTopology, std::error_code > MetaData::fetch_cluster_topology ( const std::atomic< bool > &  terminated,
mysqlrouter::TargetCluster target_cluster,
const unsigned  router_id,
const metadata_cache::metadata_servers_list_t metadata_servers,
bool  needs_writable_node,
const std::string &  clusterset_id,
bool  whole_topology,
std::size_t &  instance_id 
)
pure virtual

Implemented in ARClusterMetadata, and GRClusterMetadata.

◆ get_cluster_type()

virtual mysqlrouter::ClusterType MetaData::get_cluster_type ( )
pure virtual

Implemented in ARClusterMetadata, and GRClusterMetadata.

◆ get_connection()

virtual std::shared_ptr< mysqlrouter::MySQLSession > MetaData::get_connection ( )
pure virtual

Implemented in ClusterMetadata.

◆ get_periodic_stats_update_frequency()

virtual std::optional< std::chrono::seconds > MetaData::get_periodic_stats_update_frequency ( )
pure virtualnoexcept

Implemented in ClusterMetadata, and GRClusterMetadata.

◆ operator=()

MetaData & MetaData::operator= ( const MetaData )
delete

◆ setup_notifications_listener()

virtual void MetaData::setup_notifications_listener ( const metadata_cache::ClusterTopology cluster_topology,
const std::function< void()> &  callback 
)
pure virtual

Implemented in ARClusterMetadata, and GRClusterMetadata.

◆ shutdown_notifications_listener()

virtual void MetaData::shutdown_notifications_listener ( )
pure virtual

Implemented in ARClusterMetadata, and GRClusterMetadata.

◆ update_router_attributes()

virtual bool MetaData::update_router_attributes ( const metadata_cache::metadata_server_t rw_server,
const unsigned  router_id,
const metadata_cache::RouterAttributes router_attributes 
)
pure virtual

Implemented in ClusterMetadata.

◆ update_router_last_check_in()

virtual bool MetaData::update_router_last_check_in ( const metadata_cache::metadata_server_t rw_server,
const unsigned  router_id 
)
pure virtual

Implemented in ClusterMetadata.


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