MySQL 8.4.2
Source Code Documentation
|
#include <classic_connect.h>
Public Types | |
enum class | Stage { InitDestination , Resolve , InitEndpoint , NextEndpoint , NextDestination , InitConnect , FromPool , Connect , ConnectFinish , Connected , Error , Done } |
using | server_protocol_type = net::ip::tcp |
Public Types inherited from BasicProcessor | |
enum class | Result { Again , RecvFromClient , SendToClient , RecvFromServer , RecvFromBoth , SendToServer , SendableToServer , Suspend , Done , Void } |
Public Member Functions | |
ConnectProcessor (MysqlRoutingClassicConnectionBase *conn, std::function< void(const classic_protocol::message::server::Error &err)> on_error, TraceEvent *parent_event) | |
stdx::expected< Processor::Result, std::error_code > | process () override |
void | stage (Stage stage) |
Stage | stage () const |
bool | is_destination_good (const std::string &hostname, uint16_t port) const |
Public Member Functions inherited from Processor | |
BasicProcessor (MysqlRoutingClassicConnectionBase *conn) | |
Public Member Functions inherited from BasicProcessor | |
BasicProcessor (MysqlRoutingClassicConnectionBase *conn) | |
virtual | ~BasicProcessor ()=default |
const MysqlRoutingClassicConnectionBase * | connection () const |
MysqlRoutingClassicConnectionBase * | connection () |
Private Member Functions | |
stdx::expected< Processor::Result, std::error_code > | init_destination () |
stdx::expected< Processor::Result, std::error_code > | resolve () |
stdx::expected< Processor::Result, std::error_code > | init_endpoint () |
stdx::expected< Processor::Result, std::error_code > | next_endpoint () |
stdx::expected< Processor::Result, std::error_code > | next_destination () |
stdx::expected< Processor::Result, std::error_code > | init_connect () |
stdx::expected< Processor::Result, std::error_code > | from_pool () |
stdx::expected< Processor::Result, std::error_code > | connect () |
stdx::expected< Processor::Result, std::error_code > | connect_finish () |
stdx::expected< Processor::Result, std::error_code > | connected () |
stdx::expected< Processor::Result, std::error_code > | error () |
void | assign_server_side_connection_after_pool (ConnectionPool::ServerSideConnection server_conn) |
Private Attributes | |
Stage | stage_ {Stage::InitDestination} |
net::io_context & | io_ctx_ |
net::ip::tcp::resolver | resolver_ {io_ctx_} |
server_protocol_type::endpoint | server_endpoint_ |
Destinations & | destinations_ |
Destinations::iterator | destinations_it_ |
net::ip::tcp::resolver::results_type | endpoints_ |
net::ip::tcp::resolver::results_type::iterator | endpoints_it_ |
bool | all_quarantined_ {false} |
std::error_code | destination_ec_ |
std::vector< std::pair< std::string, std::error_code > > | connect_errors_ |
std::function< void(const classic_protocol::message::server::Error &err)> | on_error_ |
std::chrono::steady_clock::time_point | connect_started_ |
TraceEvent * | parent_event_ |
TraceEvent * | trace_event_connect_ {nullptr} |
TraceEvent * | trace_event_socket_connect_ {nullptr} |
TraceEvent * | trace_event_socket_from_pool_ {nullptr} |
Additional Inherited Members | |
Protected Member Functions inherited from Processor | |
stdx::expected< Result, std::error_code > | send_server_failed (std::error_code ec) |
stdx::expected< Result, std::error_code > | recv_server_failed (std::error_code ec) |
stdx::expected< Result, std::error_code > | send_client_failed (std::error_code ec) |
stdx::expected< Result, std::error_code > | recv_client_failed (std::error_code ec) |
stdx::expected< Result, std::error_code > | server_socket_failed (std::error_code ec) |
stdx::expected< Result, std::error_code > | client_socket_failed (std::error_code ec) |
stdx::expected< void, std::error_code > | discard_current_msg (Channel &src_channel, ClassicProtocolState &src_protocol) |
discard to current message. More... | |
template<class Proto > | |
stdx::expected< void, std::error_code > | discard_current_msg (TlsSwitchableConnection< Proto > &conn) |
void | trace (Tracer::Event e) |
Tracer & | tracer () |
TraceEvent * | trace_span (TraceEvent *parent_span, const std::string_view &prefix) |
start a span. More... | |
void | trace_span_end (TraceEvent *event, TraceEvent::StatusCode status_code=TraceEvent::StatusCode::kUnset) |
end a span and set a status-code. More... | |
TraceEvent * | trace_command (const std::string_view &prefix) |
start a command span. More... | |
TraceEvent * | trace_connect_and_forward_command (TraceEvent *parent_span) |
start a connect-and-forward span. More... | |
TraceEvent * | trace_connect (TraceEvent *parent_span) |
start a connect span. More... | |
void | trace_set_connection_attributes (TraceEvent *ev) |
start a connect span. More... | |
TraceEvent * | trace_forward_command (TraceEvent *parent_span) |
start a forward span. More... | |
void | trace_command_end (TraceEvent *event, TraceEvent::StatusCode status_code=TraceEvent::StatusCode::kUnset) |
end a command span and set a status-code. More... | |
Static Protected Member Functions inherited from Processor | |
static void | log_fatal_error_code (const char *msg, std::error_code ec) |
log a message with error-code as error. More... | |
|
strong |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
bool ConnectProcessor::is_destination_good | ( | const std::string & | hostname, |
uint16_t | port | ||
) | const |
|
private |
|
private |
|
overridevirtual |
Implements BasicProcessor.
|
private |
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |