MySQL 8.3.0
Source Code Documentation
routing.h File Reference
#include "mysqlrouter/mysql_session.h"
#include "mysqlrouter/routing_export.h"
#include <chrono>
#include <map>
#include <string>

Go to the source code of this file.

Namespaces

namespace  routing
 

Typedefs

using routing::Mode = RoutingMode
 

Enumerations

enum class  routing::RoutingMode { routing::kUndefined = 0 , routing::kReadWrite = 1 , routing::kReadOnly = 2 }
 Modes supported by Routing plugin. More...
 
enum class  routing::AccessMode { routing::kUndefined = 0 , routing::kAuto = 1 }
 
enum class  routing::RoutingStrategy {
  routing::kUndefined = 0 , routing::kFirstAvailable = 1 , routing::kNextAvailable = 2 , routing::kRoundRobin = 3 ,
  routing::kRoundRobinWithFallback = 4
}
 Routing strategies supported by Routing plugin. More...
 

Functions

std::string ROUTING_EXPORT routing::get_mode_names ()
 Get comma separated list of all mode names. More...
 
Mode ROUTING_EXPORT routing::get_mode (const std::string &value)
 Returns Mode for its literal representation. More...
 
std::string ROUTING_EXPORT routing::get_mode_name (Mode mode) noexcept
 Returns literal name of given mode. More...
 
std::string ROUTING_EXPORT routing::get_access_mode_names ()
 Get comma separated list of all access mode names. More...
 
AccessMode ROUTING_EXPORT routing::get_access_mode (const std::string &value)
 Returns AccessMode for its literal representation. More...
 
std::string ROUTING_EXPORT routing::get_access_mode_name (AccessMode access_mode) noexcept
 Returns literal name of given access mode. More...
 
std::string ROUTING_EXPORT routing::get_routing_strategy_names (bool metadata_cache)
 Get comma separated list of all routing stategy names for a given routing type (metadata cache or static) More...
 
RoutingStrategy ROUTING_EXPORT routing::get_routing_strategy (const std::string &value)
 Returns RoutingStrategy for its literal representation. More...
 
std::string ROUTING_EXPORT routing::get_routing_strategy_name (RoutingStrategy routing_strategy) noexcept
 Returns literal name of given routing strategy. More...
 

Variables

constexpr const int routing::kDefaultWaitTimeout {0}
 Timeout for idling clients (in seconds). More...
 
constexpr const int routing::kDefaultMaxConnections {0}
 Max number of active routes for this routing instance. More...
 
constexpr const std::chrono::seconds routing::kDefaultDestinationConnectionTimeout
 Timeout connecting to destination (in seconds). More...
 
constexpr const unsigned long long routing::kDefaultMaxConnectErrors {100}
 Maximum connect or handshake errors per host. More...
 
constexpr const std::string_view routing::kDefaultBindAddress {"127.0.0.1"}
 Default bind address. More...
 
constexpr const unsigned int routing::kDefaultNetBufferLength {16384}
 Default net buffer length. More...
 
constexpr const std::chrono::seconds routing::kDefaultClientConnectTimeout {9}
 Timeout waiting for handshake response from client. More...
 
constexpr const std::chrono::milliseconds routing::kDefaultConnectionSharingDelay {1000}
 delay in milliseconds before an idling connection may be moved to the pool when connection sharing is allowed. More...
 
constexpr const std::chrono::seconds routing::kDefaultUnreachableDestinationRefreshInterval {1}
 The number of seconds that MySQL Router waits between checking for reachability of an unreachable destination. More...
 
constexpr const bool routing::kDefaultSslSessionCacheMode {true}
 Default SSL session cache mode. More...
 
constexpr const unsigned int routing::kDefaultSslSessionCacheSize {1024}
 Default SSL session cache size. More...
 
constexpr const std::chrono::seconds routing::kDefaultSslSessionCacheTimeout {300}
 Default SSL session cache timeout. More...
 
constexpr const std::chrono::seconds routing::kDefaultConnectRetryTimeout {7}
 Default Connect Retry timeout. More...
 
constexpr const bool routing::kDefaultWaitForMyWrites {true}
 Default Wait For My Writes timeout. More...
 
constexpr const std::chrono::seconds routing::kDefaultWaitForMyWritesTimeout {2}
 Default Wait For My Writes timeout. More...