26#ifndef ROUTING_CLASSIC_PROCESSOR_INCLUDED
27#define ROUTING_CLASSIC_PROCESSOR_INCLUDED
122 template <
class Proto>
135 "use 'if (auto &tr = tracer()) { tr.trace(...); } instead")]]
void
147 const std::string_view &prefix);
base class of all the processors.
Definition: processor.h:57
MysqlRoutingClassicConnectionBase * conn_
Definition: processor.h:85
virtual ~BasicProcessor()=default
MysqlRoutingClassicConnectionBase * connection()
Definition: processor.h:80
Result
Definition: processor.h:59
const MysqlRoutingClassicConnectionBase * connection() const
Definition: processor.h:78
BasicProcessor(MysqlRoutingClassicConnectionBase *conn)
Definition: processor.h:74
virtual stdx::expected< Result, std::error_code > process()=0
SSL aware socket buffers.
Definition: channel.h:65
protocol state of a classic protocol connection.
Definition: classic_protocol_state.h:39
Definition: classic_connection_base.h:56
a processor base class with helper functions.
Definition: processor.h:91
static void log_fatal_error_code(const char *msg, std::error_code ec)
log a message with error-code as error.
Definition: processor.cc:134
stdx::expected< Result, std::error_code > send_server_failed(std::error_code ec)
Definition: processor.cc:38
void trace_command_end(TraceEvent *event, TraceEvent::StatusCode status_code=TraceEvent::StatusCode::kUnset)
end a command span and set a status-code.
Definition: processor.cc:206
stdx::expected< Result, std::error_code > recv_client_failed(std::error_code ec)
Definition: processor.cc:67
stdx::expected< Result, std::error_code > client_socket_failed(std::error_code ec)
Definition: processor.cc:87
TraceEvent * trace_connect(TraceEvent *parent_span)
start a connect span.
Definition: processor.cc:181
TraceEvent * trace_command(const std::string_view &prefix)
start a command span.
Definition: processor.cc:160
void trace(Tracer::Event e)
Definition: processor.cc:139
stdx::expected< Result, std::error_code > recv_server_failed(std::error_code ec)
Definition: processor.cc:47
stdx::expected< Result, std::error_code > send_client_failed(std::error_code ec)
Definition: processor.cc:58
void trace_span_end(TraceEvent *event, TraceEvent::StatusCode status_code=TraceEvent::StatusCode::kUnset)
end a span and set a status-code.
Definition: processor.cc:152
stdx::expected< void, std::error_code > discard_current_msg(TlsSwitchableConnection< Proto > &conn)
Definition: processor.h:123
stdx::expected< Result, std::error_code > server_socket_failed(std::error_code ec)
Definition: processor.cc:78
TraceEvent * trace_span(TraceEvent *parent_span, const std::string_view &prefix)
start a span.
Definition: processor.cc:145
stdx::expected< void, std::error_code > discard_current_msg(Channel &src_channel, ClassicProtocolState &src_protocol)
discard to current message.
Definition: processor.cc:95
TraceEvent * trace_connect_and_forward_command(TraceEvent *parent_span)
start a connect-and-forward span.
Definition: processor.cc:171
void trace_set_connection_attributes(TraceEvent *ev)
start a connect span.
Definition: processor.cc:185
TraceEvent * trace_forward_command(TraceEvent *parent_span)
start a forward span.
Definition: processor.cc:202
Tracer & tracer()
Definition: processor.cc:143
a Connection that can be switched to TLS.
Definition: connection_base.h:264
Channel & channel()
Definition: connection_base.h:359
protocol_state_type & protocol()
Definition: connection_base.h:398
traces the timestamps of events in a stderr log.
Definition: tracer.h:49
Definition: expected.h:284
required string event
Definition: replication_group_member_actions.proto:32
Definition: trace_span.h:35
StatusCode
Definition: trace_span.h:65