MySQL 8.0.40
Source Code Documentation
MetadataCachePluginConfig Class Referencefinal

#include <plugin_config.h>

Inheritance diagram for MetadataCachePluginConfig:
[legend]

Public Member Functions

 MetadataCachePluginConfig (const mysql_harness::ConfigSection *section)
 Constructor. More...
 
std::string get_default (const std::string &option) const override
 
bool is_required (const std::string &option) const override
 Returns whether the given option is required. More...
 
std::string get_cluster_type_specific_id () const
 Gets (Group Replication ID for GR cluster or cluster_id for ReplicaSet cluster) if preset in the dynamic configuration. More...
 
std::string get_clusterset_id () const
 
uint64_t get_view_id () const
 Gets last know ReplicaSet cluster metadata view_id stored in the dynamic state file . More...
 
- Public Member Functions inherited from mysql_harness::BasePluginConfig
 BasePluginConfig ()=default
 
 BasePluginConfig (const BasePluginConfig &)=default
 
 BasePluginConfig (BasePluginConfig &&)=default
 
BasePluginConfigoperator= (const BasePluginConfig &)=default
 
BasePluginConfigoperator= (BasePluginConfig &&)=default
 
virtual ~BasePluginConfig ()=default
 destructor More...
 
std::string get_option_description (const mysql_harness::ConfigSection *section, const std::string &option) const
 get description of the option. More...
 
template<class Func >
decltype(auto) get_option (const mysql_harness::ConfigSection *section, const std::string &option, Func &&transformer) const
 get option value. More...
 
template<class Func >
decltype(auto) get_option_no_default (const mysql_harness::ConfigSection *section, const std::string &option, Func &&transformer) const
 get option value. More...
 
std::string get_option_string (const mysql_harness::ConfigSection *section, const std::string &option) const
 Gets value of given option as string. More...
 
template<class T >
get_uint_option (const mysql_harness::ConfigSection *section, const std::string &option, T min_value=0, T max_value=std::numeric_limits< T >::max()) const
 Gets an unsigned integer using the given option. More...
 
std::chrono::milliseconds get_option_milliseconds (const mysql_harness::ConfigSection *section, const std::string &option, double min_value=0.0, double max_value=std::numeric_limits< double >::max()) const
 Gets a number of milliseconds using the given option. More...
 

Public Attributes

std::unique_ptr< ClusterMetadataDynamicStatemetadata_cache_dynamic_state
 
const metadata_cache::metadata_servers_list_t metadata_servers_addresses
 MySQL Metadata hosts to connect with. More...
 
std::string user
 User used for authenticating with MySQL Metadata. More...
 
std::chrono::milliseconds ttl
 TTL used for storing data in the cache. More...
 
std::chrono::milliseconds auth_cache_ttl
 TTL used for limiting the lifetime of the rest user authentication data stored in the metadata. More...
 
std::chrono::milliseconds auth_cache_refresh_interval
 Refresh rate of the rest user authentication data stored in the cache. More...
 
std::string cluster_name
 Name of the Cluster this Router instance was bootstrapped to use. More...
 
unsigned int connect_timeout
 connect_timeout The time in seconds after which trying to connect to metadata server timeouts More...
 
unsigned int read_timeout
 read_timeout The time in seconds after which read from metadata server timeouts More...
 
unsigned int thread_stack_size
 memory in kilobytes allocated for thread's stack More...
 
bool use_gr_notifications
 Whether we should listen to GR notifications from the cluster nodes. More...
 
mysqlrouter::ClusterType cluster_type
 Type of the cluster this configuration was bootstrap against. More...
 
unsigned int router_id
 Id of the router in the metadata. More...
 

Private Member Functions

std::vector< mysql_harness::TCPAddressget_metadata_servers (const mysql_harness::ConfigSection *section, uint16_t default_port) const
 Gets a list of metadata servers. More...
 
mysqlrouter::ClusterType get_cluster_type (const mysql_harness::ConfigSection *section)
 
std::unique_ptr< ClusterMetadataDynamicStateget_dynamic_state (const mysql_harness::ConfigSection *section)
 

Additional Inherited Members

- Protected Member Functions inherited from mysql_harness::BasePluginConfig
 BasePluginConfig (const mysql_harness::ConfigSection *section)
 Constructor for derived classes. More...
 
- Static Protected Member Functions inherited from mysql_harness::BasePluginConfig
static std::string get_section_name (const mysql_harness::ConfigSection *section)
 Generate the name for this configuration. More...
 

Constructor & Destructor Documentation

◆ MetadataCachePluginConfig()

MetadataCachePluginConfig::MetadataCachePluginConfig ( const mysql_harness::ConfigSection section)

Constructor.

Parameters
sectionfrom configuration file provided as ConfigSection

Member Function Documentation

◆ get_cluster_type()

mysqlrouter::ClusterType MetadataCachePluginConfig::get_cluster_type ( const mysql_harness::ConfigSection section)
private

◆ get_cluster_type_specific_id()

std::string MetadataCachePluginConfig::get_cluster_type_specific_id ( ) const

Gets (Group Replication ID for GR cluster or cluster_id for ReplicaSet cluster) if preset in the dynamic configuration.

Note
If there is no dynamic configuration (backward compatibility) it returns empty string.

◆ get_clusterset_id()

std::string MetadataCachePluginConfig::get_clusterset_id ( ) const

◆ get_default()

std::string MetadataCachePluginConfig::get_default ( const std::string &  option) const
overridevirtual
Parameters
optionname of the option

Implements mysql_harness::BasePluginConfig.

◆ get_dynamic_state()

std::unique_ptr< ClusterMetadataDynamicState > MetadataCachePluginConfig::get_dynamic_state ( const mysql_harness::ConfigSection section)
private

◆ get_metadata_servers()

std::vector< mysql_harness::TCPAddress > MetadataCachePluginConfig::get_metadata_servers ( const mysql_harness::ConfigSection section,
uint16_t  default_port 
) const
private

Gets a list of metadata servers.

Throws std::invalid_argument on errors.

Parameters
sectionInstance of ConfigSection
default_portUse this port when none was provided
Returns
std::vector<mysql_harness::TCPAddress>

◆ get_view_id()

uint64_t MetadataCachePluginConfig::get_view_id ( ) const

Gets last know ReplicaSet cluster metadata view_id stored in the dynamic state file .

◆ is_required()

bool MetadataCachePluginConfig::is_required ( const std::string &  option) const
overridevirtual

Returns whether the given option is required.

Returns
bool

Implements mysql_harness::BasePluginConfig.

Member Data Documentation

◆ auth_cache_refresh_interval

std::chrono::milliseconds MetadataCachePluginConfig::auth_cache_refresh_interval

Refresh rate of the rest user authentication data stored in the cache.

◆ auth_cache_ttl

std::chrono::milliseconds MetadataCachePluginConfig::auth_cache_ttl

TTL used for limiting the lifetime of the rest user authentication data stored in the metadata.

◆ cluster_name

std::string MetadataCachePluginConfig::cluster_name

Name of the Cluster this Router instance was bootstrapped to use.

◆ cluster_type

mysqlrouter::ClusterType MetadataCachePluginConfig::cluster_type

Type of the cluster this configuration was bootstrap against.

◆ connect_timeout

unsigned int MetadataCachePluginConfig::connect_timeout

connect_timeout The time in seconds after which trying to connect to metadata server timeouts

◆ metadata_cache_dynamic_state

std::unique_ptr<ClusterMetadataDynamicState> MetadataCachePluginConfig::metadata_cache_dynamic_state
mutable

◆ metadata_servers_addresses

const metadata_cache::metadata_servers_list_t MetadataCachePluginConfig::metadata_servers_addresses

MySQL Metadata hosts to connect with.

◆ read_timeout

unsigned int MetadataCachePluginConfig::read_timeout

read_timeout The time in seconds after which read from metadata server timeouts

◆ router_id

unsigned int MetadataCachePluginConfig::router_id

Id of the router in the metadata.

◆ thread_stack_size

unsigned int MetadataCachePluginConfig::thread_stack_size

memory in kilobytes allocated for thread's stack

◆ ttl

std::chrono::milliseconds MetadataCachePluginConfig::ttl

TTL used for storing data in the cache.

◆ use_gr_notifications

bool MetadataCachePluginConfig::use_gr_notifications

Whether we should listen to GR notifications from the cluster nodes.

◆ user

std::string MetadataCachePluginConfig::user

User used for authenticating with MySQL Metadata.


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