MySQL 8.0.40
Source Code Documentation
Destination Class Reference

Destination to forward client connections to. More...

#include <destination.h>

Inheritance diagram for Destination:
[legend]

Public Member Functions

 Destination (std::string id, std::string hostname, uint16_t port)
 
virtual ~Destination ()=default
 
std::string id () const
 unique, opaque identifier of a destination. More...
 
std::string hostname () const
 hostname to connect to. More...
 
uint16_t port () const noexcept
 TCP port to connect to. More...
 
virtual bool good () const
 check if the destination is "good". More...
 
virtual void connect_status (std::error_code)
 status of the last failed connect(). More...
 

Private Attributes

const std::string id_
 
const std::string hostname_
 
const uint16_t port_
 

Detailed Description

Destination to forward client connections to.

It is used between the RouteDestination implementations and MySQLRouting

Constructor & Destructor Documentation

◆ Destination()

Destination::Destination ( std::string  id,
std::string  hostname,
uint16_t  port 
)
inline

◆ ~Destination()

virtual Destination::~Destination ( )
virtualdefault

Member Function Documentation

◆ connect_status()

virtual void Destination::connect_status ( std::error_code  )
inlinevirtual

status of the last failed connect().

called by MySQLRouting after a connect() to all addresses of the destination failed.

Reimplemented in FirstAvailableDestination, MetadataCacheDestination, and StateTrackingDestination.

◆ good()

virtual bool Destination::good ( ) const
inlinevirtual

check if the destination is "good".

If the destination is not "good", it will be skipped by MySQLRouting.

Return values
falseif destination is known to be bad
trueotherwise

Reimplemented in StateTrackingDestination.

◆ hostname()

std::string Destination::hostname ( ) const
inline

hostname to connect to.

◆ id()

std::string Destination::id ( ) const
inline

unique, opaque identifier of a destination.

used by connection container to find allowed destinations.

◆ port()

uint16_t Destination::port ( ) const
inlinenoexcept

TCP port to connect to.

Member Data Documentation

◆ hostname_

const std::string Destination::hostname_
private

◆ id_

const std::string Destination::id_
private

◆ port_

const uint16_t Destination::port_
private

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