26#ifndef MYSQLROUTER_ROUTING_COMPONENT_INCLUDED
27#define MYSQLROUTER_ROUTING_COMPONENT_INCLUDED
52 std::string get_bind_address()
const;
53 uint16_t get_bind_port()
const;
55 std::chrono::milliseconds get_client_connect_timeout()
const;
56 std::chrono::milliseconds get_destination_connect_timeout()
const;
57 std::string get_destination_cluster_name()
const;
58 std::string get_destination_replicaset_name()
const;
61 uint64_t get_max_connect_errors()
const;
62 std::string get_mode()
const;
64 std::string get_name()
const;
66 std::string get_protocol_name()
const;
68 std::string get_socket()
const;
70 explicit operator bool() const noexcept {
return r_.operator bool(); }
72 std::vector<std::string> get_blocked_client_hosts()
const;
88 std::vector<ConnData> get_connections()
const;
91 int get_active_connections()
const;
92 int get_total_connections()
const;
94 std::vector<mysql_harness::TCPAddress> get_destinations()
const;
96 void start_accepting_connections();
97 void restart_accepting_connections();
99 bool is_accepting_connections()
const;
101 void stop_socket_acceptors();
106 std::shared_ptr<MySQLRoutingBase>
r_;
117 void register_route(
const std::string &
name,
118 std::shared_ptr<MySQLRoutingBase>
srv);
120 void erase(
const std::string &
name);
124 uint64_t current_total_connections();
129 std::vector<std::string> route_names()
const;
131 static const uint64_t kDefaultMaxTotalConnections = 512;
139 std::map<std::string, std::weak_ptr<MySQLRoutingBase>>
routes_;
141 uint64_t max_total_connections_{0};
static mysql_service_status_t deinit()
Component deinitialization.
Definition: audit_api_message_emit.cc:580
static mysql_service_status_t init()
Component initialization.
Definition: audit_api_message_emit.cc:571
Definition: base_protocol.h:29
Definition: routing_component.h:45
std::shared_ptr< MySQLRoutingBase > r_
Definition: routing_component.h:106
MySQLRoutingAPI(std::shared_ptr< MySQLRoutingBase > r)
Definition: routing_component.h:49
MySQLRoutingAPI()=default
Facade to avoid a tight coupling between Routing component and actual routing endpoint implementation...
Definition: mysql_routing_base.h:41
Definition: routing_component.h:109
MySQLRoutingComponent(MySQLRoutingComponent const &)=delete
std::map< std::string, std::weak_ptr< MySQLRoutingBase > > routes_
Definition: routing_component.h:139
uint64_t max_total_connections() const
Definition: routing_component.h:125
MySQLRoutingComponent()=default
void operator=(MySQLRoutingComponent const &)=delete
std::mutex routes_mu_
Definition: routing_component.h:138
Definition: connection.h:43
Configuration.
Definition: config_parser.h:253
static int get_connection(MEM_ROOT *mem_root, FEDERATED_SHARE *share)
Definition: ha_federated.cc:605
bool is_running(const PluginFuncEnv *env) noexcept
Definition: loader.cc:202
RoutingStrategy ROUTING_EXPORT get_routing_strategy(const std::string &value)
Returns RoutingStrategy for its literal representation.
Definition: routing.cc:91
Definition: srv0dynamic_procedures.h:48
Definition: gcs_xcom_synode.h:64
const mysql_service_registry_t * r
Definition: pfs_example_plugin_employee.cc:86
#define ROUTING_EXPORT
Definition: routing_export.h:15
case opt name
Definition: sslopt-case.h:33
Definition: routing_component.h:74
std::size_t bytes_up
Definition: routing_component.h:79
time_point_type last_sent_to_server
Definition: routing_component.h:84
time_point_type connected_to_server
Definition: routing_component.h:83
std::string dst
Definition: routing_component.h:77
time_point_type started
Definition: routing_component.h:82
std::string src
Definition: routing_component.h:76
std::chrono::time_point< std::chrono::system_clock > time_point_type
Definition: routing_component.h:75
std::size_t bytes_down
Definition: routing_component.h:80
time_point_type last_received_from_server
Definition: routing_component.h:85
ulong get_max_connections(void)
Get max number of connections.
Definition: sql_thd_api.cc:301