MySQL 8.0.40
Source Code Documentation
RouterClusterSetOptions Class Reference

Represents the Router options in v2_cs_router_options view in the metadata schema. More...

#include <router_cs_options.h>

Public Member Functions

bool read_from_metadata (mysqlrouter::MySQLSession &session, const unsigned router_id)
 Pupulate the object by reading the options from the metadata. More...
 
std::string get_string () const
 Get the raw JSON string read from the metadata during the last read_from_metadata() call. More...
 
std::optional< mysqlrouter::TargetClusterget_target_cluster (const unsigned router_id) const
 Get the target_cluster assigned for a given Router in the metadata. More...
 
std::chrono::seconds get_stats_updates_frequency () const
 Get the stats updates ferquency value (in seconds) assigned for a given Router in the metadata. More...
 
bool get_use_replica_primary_as_rw () const
 Get the get_use_replica_primary_as_rw boolean value assigned for a given Router in the metadata. More...
 

Private Member Functions

std::string get_router_option_str (const std::string &options, const std::string &name, const std::string &default_value, std::string &out_error) const
 
uint32_t get_router_option_uint (const std::string &options, const std::string &name, const uint32_t &default_value, std::string &out_error) const
 
uint32_t get_router_option_bool (const std::string &options, const std::string &name, const bool &default_value, std::string &out_error) const
 

Private Attributes

std::string options_str_
 

Detailed Description

Represents the Router options in v2_cs_router_options view in the metadata schema.

Member Function Documentation

◆ get_router_option_bool()

uint32_t RouterClusterSetOptions::get_router_option_bool ( const std::string &  options,
const std::string &  name,
const bool &  default_value,
std::string &  out_error 
) const
private

◆ get_router_option_str()

std::string RouterClusterSetOptions::get_router_option_str ( const std::string &  options,
const std::string &  name,
const std::string &  default_value,
std::string &  out_error 
) const
private

◆ get_router_option_uint()

uint32_t RouterClusterSetOptions::get_router_option_uint ( const std::string &  options,
const std::string &  name,
const uint32_t &  default_value,
std::string &  out_error 
) const
private

◆ get_stats_updates_frequency()

std::chrono::seconds RouterClusterSetOptions::get_stats_updates_frequency ( ) const

Get the stats updates ferquency value (in seconds) assigned for a given Router in the metadata.

◆ get_string()

std::string RouterClusterSetOptions::get_string ( ) const
inline

Get the raw JSON string read from the metadata during the last read_from_metadata() call.

◆ get_target_cluster()

std::optional< mysqlrouter::TargetCluster > RouterClusterSetOptions::get_target_cluster ( const unsigned  router_id) const

Get the target_cluster assigned for a given Router in the metadata.

Parameters
router_idid of the Router in the metadata
Returns
assigned target_cluster if read successful, std::nullopt otherwise

◆ get_use_replica_primary_as_rw()

bool RouterClusterSetOptions::get_use_replica_primary_as_rw ( ) const

Get the get_use_replica_primary_as_rw boolean value assigned for a given Router in the metadata.

◆ read_from_metadata()

bool RouterClusterSetOptions::read_from_metadata ( mysqlrouter::MySQLSession session,
const unsigned  router_id 
)

Pupulate the object by reading the options from the metadata.

Parameters
sessionmysql server session to read metadata with
router_idid of the Router in the metadata
Returns
true if successful, false otherwise

Member Data Documentation

◆ options_str_

std::string RouterClusterSetOptions::options_str_
private

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