MySQL 9.2.0
Source Code Documentation
metadata_cache::ManagedInstance Class Reference

Class ManagedInstance represents a server managed by the topology. More...

#include <metadata_cache_datatypes.h>

Public Member Functions

 ManagedInstance (mysqlrouter::InstanceType p_type, const std::string &p_mysql_server_uuid, const ServerMode p_mode, const ServerRole p_role, const std::string &p_host, const uint16_t p_port, const uint16_t p_xport, std::string label)
 
 ManagedInstance (const ManagedInstance &)=default
 
ManagedInstanceoperator= (const ManagedInstance &)=default
 
 ManagedInstance (ManagedInstance &&)=default
 
ManagedInstanceoperator= (ManagedInstance &&)=default
 
 ManagedInstance (mysqlrouter::InstanceType p_type)
 
 ManagedInstance (mysqlrouter::InstanceType p_type, const mysql_harness::TcpDestination &dest)
 
 operator mysql_harness::TcpDestination () const
 
bool operator== (const ManagedInstance &other) const
 
std::string to_string () const
 

Public Attributes

mysqlrouter::InstanceType type
 Instance type. More...
 
std::string mysql_server_uuid
 The uuid of the MySQL server. More...
 
ServerMode mode {ServerMode::Unavailable}
 The mode of the server. More...
 
ServerRole role {ServerRole::Unavailable}
 The role of the server. More...
 
std::string host
 The host name on which the server is running. More...
 
uint16_t port {0}
 The port number in which the server is running. More...
 
uint16_t xport {0}
 The X protocol port number in which the server is running. More...
 
std::string attributes
 Node atributes as a json string from metadata. More...
 
bool hidden {mysqlrouter::kNodeTagHiddenDefault}
 Should the node be hidden from the application to use it. More...
 
bool disconnect_existing_sessions_when_hidden
 Should the Router disconnect existing client sessions to the node when it is hidden. More...
 
bool ignore {false}
 Should the node be ignored for new and existing connections (for example due to the read_only_targets option) More...
 
std::map< std::string, std::string, std::less<> > tags {}
 Server tags as defined in the metadata, parsed as a key-value pairs. More...
 
uint32_t version {0}
 
std::string label
 

Detailed Description

Class ManagedInstance represents a server managed by the topology.

Constructor & Destructor Documentation

◆ ManagedInstance() [1/5]

metadata_cache::ManagedInstance::ManagedInstance ( mysqlrouter::InstanceType  p_type,
const std::string &  p_mysql_server_uuid,
const ServerMode  p_mode,
const ServerRole  p_role,
const std::string &  p_host,
const uint16_t  p_port,
const uint16_t  p_xport,
std::string  label 
)

◆ ManagedInstance() [2/5]

metadata_cache::ManagedInstance::ManagedInstance ( const ManagedInstance )
default

◆ ManagedInstance() [3/5]

metadata_cache::ManagedInstance::ManagedInstance ( ManagedInstance &&  )
default

◆ ManagedInstance() [4/5]

metadata_cache::ManagedInstance::ManagedInstance ( mysqlrouter::InstanceType  p_type)
explicit

◆ ManagedInstance() [5/5]

metadata_cache::ManagedInstance::ManagedInstance ( mysqlrouter::InstanceType  p_type,
const mysql_harness::TcpDestination dest 
)
explicit

Member Function Documentation

◆ operator mysql_harness::TcpDestination()

metadata_cache::ManagedInstance::operator mysql_harness::TcpDestination ( ) const

◆ operator=() [1/2]

ManagedInstance & metadata_cache::ManagedInstance::operator= ( const ManagedInstance )
default

◆ operator=() [2/2]

ManagedInstance & metadata_cache::ManagedInstance::operator= ( ManagedInstance &&  )
default

◆ operator==()

bool metadata_cache::ManagedInstance::operator== ( const ManagedInstance other) const

◆ to_string()

std::string metadata_cache::ManagedInstance::to_string ( ) const
inline

Member Data Documentation

◆ attributes

std::string metadata_cache::ManagedInstance::attributes

Node atributes as a json string from metadata.

◆ disconnect_existing_sessions_when_hidden

bool metadata_cache::ManagedInstance::disconnect_existing_sessions_when_hidden
Initial value:
{
constexpr const bool kNodeTagDisconnectWhenHiddenDefault
Definition: cluster_metadata.h:173

Should the Router disconnect existing client sessions to the node when it is hidden.

◆ hidden

bool metadata_cache::ManagedInstance::hidden {mysqlrouter::kNodeTagHiddenDefault}

Should the node be hidden from the application to use it.

◆ host

std::string metadata_cache::ManagedInstance::host

The host name on which the server is running.

◆ ignore

bool metadata_cache::ManagedInstance::ignore {false}

Should the node be ignored for new and existing connections (for example due to the read_only_targets option)

◆ label

std::string metadata_cache::ManagedInstance::label

◆ mode

ServerMode metadata_cache::ManagedInstance::mode {ServerMode::Unavailable}

The mode of the server.

◆ mysql_server_uuid

std::string metadata_cache::ManagedInstance::mysql_server_uuid

The uuid of the MySQL server.

◆ port

uint16_t metadata_cache::ManagedInstance::port {0}

The port number in which the server is running.

◆ role

ServerRole metadata_cache::ManagedInstance::role {ServerRole::Unavailable}

The role of the server.

◆ tags

std::map<std::string, std::string, std::less<> > metadata_cache::ManagedInstance::tags {}

Server tags as defined in the metadata, parsed as a key-value pairs.

◆ type

mysqlrouter::InstanceType metadata_cache::ManagedInstance::type

Instance type.

◆ version

uint32_t metadata_cache::ManagedInstance::version {0}

◆ xport

uint16_t metadata_cache::ManagedInstance::xport {0}

The X protocol port number in which the server is running.


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