MySQL 8.0.40
Source Code Documentation
metadata_cache Namespace Reference

Classes

class  AcceptorUpdateHandlerInterface
 Abstract class that provides interface for listener on whether the listening sockets acceptors state should be updated. More...
 
class  ClusterStateListenerInterface
 Abstract class that provides interface for listener on cluster status changes. More...
 
class  ClusterStateNotifierInterface
 Abstract class that provides interface for adding and removing observers on cluster status changes. More...
 
class  ClusterTopology
 Represents a cluster (a GR group or AR members) and its metadata servers. More...
 
class  ManagedCluster
 Represents a cluster (a GR group or AR members) More...
 
class  ManagedInstance
 Class ManagedInstance represents a server managed by the topology. More...
 
class  metadata_error
 Class that represents all the exceptions that are thrown while fetching the metadata. More...
 
class  MetadataCacheAPI
 
class  MetadataCacheAPIBase
 
struct  MetadataCacheMySQLSessionConfig
 Metadata MySQL session configuration. More...
 
struct  MetadataCacheTTLConfig
 Metadata TTL configuration. More...
 
class  MetadataRefreshListenerInterface
 Abstract class that provides interface for listener on metadata refresh. More...
 
struct  RouterAttributes
 

Typedefs

using cluster_nodes_list_t = std::vector< ManagedInstance >
 
using metadata_server_t = mysql_harness::TCPAddress
 
using metadata_servers_list_t = std::vector< metadata_server_t >
 

Enumerations

enum class  metadata_errc {
  ok , no_metadata_server_reached , no_metadata_read_successful , metadata_refresh_terminated ,
  cluster_not_found , invalid_cluster_type , outdated_view_id
}
 
enum class  ServerMode { ReadWrite , ReadOnly , Unavailable }
 
enum class  ServerRole { Primary , Secondary , Unavailable }
 
enum class  InstanceType { GroupMember , AsyncMember , ReadReplica }
 

Functions

std::shared_ptr< MetaDatametadata_factory_get_instance (const mysqlrouter::ClusterType cluster_type, const metadata_cache::MetadataCacheMySQLSessionConfig &session_config, const mysqlrouter::SSLOptions &ssl_options, const bool use_cluster_notifications, const unsigned view_id)
 Return an instance of cluster metadata. More...
 
const std::error_category & metadata_cache_category () noexcept
 
std::error_code make_error_code (metadata_errc e) noexcept
 
bool operator== (const metadata_cache::ManagedCluster &cluster_a, const metadata_cache::ManagedCluster &cluster_b)
 
bool operator!= (const metadata_cache::ManagedCluster &cluster_a, const metadata_cache::ManagedCluster &cluster_b)
 
bool operator== (const metadata_cache::ClusterTopology &a, const metadata_cache::ClusterTopology &b)
 
bool operator!= (const metadata_cache::ClusterTopology &a, const metadata_cache::ClusterTopology &b)
 

Variables

constexpr const uint16_t kDefaultMetadataPort {32275}
 
constexpr const std::string_view kDefaultMetadataAddress {"127.0.0.1:32275"}
 
constexpr const std::string_view kDefaultMetadataUser {""}
 
constexpr const std::string_view kDefaultMetadataPassword {""}
 
constexpr const std::chrono::milliseconds kDefaultMetadataTTL {500}
 
constexpr const std::chrono::milliseconds kDefaultAuthCacheTTL
 
constexpr const std::chrono::milliseconds kDefaultAuthCacheRefreshInterval
 
constexpr const std::string_view kDefaultMetadataCluster {""}
 
constexpr const unsigned int kDefaultConnectTimeout
 
constexpr const unsigned int kDefaultReadTimeout
 
constexpr const std::string_view kNodeTagHidden {"_hidden"}
 
constexpr const std::string_view kNodeTagDisconnectWhenHidden
 
constexpr const bool kNodeTagHiddenDefault {false}
 
constexpr const bool kNodeTagDisconnectWhenHiddenDefault {true}
 
static std::shared_ptr< MetaDatameta_data {nullptr}
 

Typedef Documentation

◆ cluster_nodes_list_t

◆ metadata_server_t

◆ metadata_servers_list_t

Enumeration Type Documentation

◆ InstanceType

enum class metadata_cache::InstanceType
strong
Enumerator
GroupMember 
AsyncMember 
ReadReplica 

◆ metadata_errc

enum class metadata_cache::metadata_errc
strong
Enumerator
ok 
no_metadata_server_reached 
no_metadata_read_successful 
metadata_refresh_terminated 
cluster_not_found 
invalid_cluster_type 
outdated_view_id 

◆ ServerMode

enum class metadata_cache::ServerMode
strong
Enumerator
ReadWrite 
ReadOnly 
Unavailable 

◆ ServerRole

enum class metadata_cache::ServerRole
strong
Enumerator
Primary 
Secondary 
Unavailable 

Function Documentation

◆ make_error_code()

std::error_code metadata_cache::make_error_code ( metadata_errc  e)
inlinenoexcept

◆ metadata_cache_category()

const std::error_category & metadata_cache::metadata_cache_category ( )
inlinenoexcept

◆ metadata_factory_get_instance()

std::shared_ptr< MetaData > metadata_cache::metadata_factory_get_instance ( const mysqlrouter::ClusterType  cluster_type,
const metadata_cache::MetadataCacheMySQLSessionConfig session_config,
const mysqlrouter::SSLOptions ssl_options,
const bool  use_cluster_notifications,
const unsigned  view_id 
)

Return an instance of cluster metadata.

Parameters
cluster_typetype of the cluster the metadata cache object will represent (GR or ReplicaSet)
session_configMetadata MySQL session configuration
ssl_optionsSSL related options to be used for connection
use_cluster_notificationsFlag indicating if the metadata cache should use cluster notifications as an additional trigger for metadata refresh (only available for GR cluster type)
view_idlast known view_id of the cluster metadata (only relevant for ReplicaSet cluster)

◆ operator!=() [1/2]

◆ operator!=() [2/2]

bool metadata_cache::operator!= ( const metadata_cache::ManagedCluster cluster_a,
const metadata_cache::ManagedCluster cluster_b 
)

◆ operator==() [1/2]

bool metadata_cache::operator== ( const metadata_cache::ClusterTopology a,
const metadata_cache::ClusterTopology b 
)

◆ operator==() [2/2]

bool metadata_cache::operator== ( const metadata_cache::ManagedCluster cluster_a,
const metadata_cache::ManagedCluster cluster_b 
)

Variable Documentation

◆ kDefaultAuthCacheRefreshInterval

constexpr const std::chrono::milliseconds metadata_cache::kDefaultAuthCacheRefreshInterval
constexpr
Initial value:
{
2000}

◆ kDefaultAuthCacheTTL

constexpr const std::chrono::milliseconds metadata_cache::kDefaultAuthCacheTTL
constexpr
Initial value:
{
double seconds()
Definition: task.cc:310

◆ kDefaultConnectTimeout

constexpr const unsigned int metadata_cache::kDefaultConnectTimeout
constexpr
Initial value:
{
static constexpr int kDefaultConnectTimeout
Definition: mysql_session.h:155

◆ kDefaultMetadataAddress

constexpr const std::string_view metadata_cache::kDefaultMetadataAddress {"127.0.0.1:32275"}
constexpr

◆ kDefaultMetadataCluster

constexpr const std::string_view metadata_cache::kDefaultMetadataCluster {""}
constexpr

◆ kDefaultMetadataPassword

constexpr const std::string_view metadata_cache::kDefaultMetadataPassword {""}
constexpr

◆ kDefaultMetadataPort

constexpr const uint16_t metadata_cache::kDefaultMetadataPort {32275}
constexpr

◆ kDefaultMetadataTTL

constexpr const std::chrono::milliseconds metadata_cache::kDefaultMetadataTTL {500}
constexpr

◆ kDefaultMetadataUser

constexpr const std::string_view metadata_cache::kDefaultMetadataUser {""}
constexpr

◆ kDefaultReadTimeout

constexpr const unsigned int metadata_cache::kDefaultReadTimeout
constexpr
Initial value:
{
static constexpr int kDefaultReadTimeout
Definition: mysql_session.h:156

◆ kNodeTagDisconnectWhenHidden

constexpr const std::string_view metadata_cache::kNodeTagDisconnectWhenHidden
constexpr
Initial value:
{
"_disconnect_existing_sessions_when_hidden"}

◆ kNodeTagDisconnectWhenHiddenDefault

constexpr const bool metadata_cache::kNodeTagDisconnectWhenHiddenDefault {true}
constexpr

◆ kNodeTagHidden

constexpr const std::string_view metadata_cache::kNodeTagHidden {"_hidden"}
constexpr

◆ kNodeTagHiddenDefault

constexpr const bool metadata_cache::kNodeTagHiddenDefault {false}
constexpr

◆ meta_data

std::shared_ptr<MetaData> metadata_cache::meta_data {nullptr}
static