Rename to has_session_commands
This way it is similar to other member functions.
This commit is contained in:
@ -98,7 +98,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @return True if there are session commands waiting to be executed
|
* @return True if there are session commands waiting to be executed
|
||||||
*/
|
*/
|
||||||
inline bool have_session_commands() const
|
inline bool has_session_commands() const
|
||||||
{
|
{
|
||||||
return !m_session_commands.empty();
|
return !m_session_commands.empty();
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ void Backend::close(close_type type)
|
|||||||
|
|
||||||
bool Backend::execute_session_command()
|
bool Backend::execute_session_command()
|
||||||
{
|
{
|
||||||
if (is_closed() || !have_session_commands())
|
if (is_closed() || !has_session_commands())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ size_t Backend::session_command_count() const
|
|||||||
|
|
||||||
const SSessionCommand& Backend::next_session_command() const
|
const SSessionCommand& Backend::next_session_command() const
|
||||||
{
|
{
|
||||||
ss_dassert(have_session_commands());
|
ss_dassert(has_session_commands());
|
||||||
return m_session_commands.front();
|
return m_session_commands.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ bool RWSplitSession::route_single_stmt(GWBUF *querybuf, const RouteInfo& info)
|
|||||||
// The connection to target was down and we failed to reconnect
|
// The connection to target was down and we failed to reconnect
|
||||||
succp = false;
|
succp = false;
|
||||||
}
|
}
|
||||||
else if (target->have_session_commands())
|
else if (target->has_session_commands())
|
||||||
{
|
{
|
||||||
// We need to wait until the session commands are executed
|
// We need to wait until the session commands are executed
|
||||||
m_expected_responses++;
|
m_expected_responses++;
|
||||||
@ -940,7 +940,7 @@ bool RWSplitSession::handle_got_target(GWBUF* querybuf, SRWBackend& target, bool
|
|||||||
target->uri());
|
target->uri());
|
||||||
|
|
||||||
/** The session command cursor must not be active */
|
/** The session command cursor must not be active */
|
||||||
ss_dassert(!target->have_session_commands());
|
ss_dassert(!target->has_session_commands());
|
||||||
|
|
||||||
mxs::Backend::response_type response = mxs::Backend::NO_RESPONSE;
|
mxs::Backend::response_type response = mxs::Backend::NO_RESPONSE;
|
||||||
m_wait_gtid_state = EXPECTING_NOTHING;
|
m_wait_gtid_state = EXPECTING_NOTHING;
|
||||||
|
@ -69,7 +69,7 @@ static void discard_if_response_differs(SRWBackend backend, uint8_t master_cmd,
|
|||||||
|
|
||||||
void RWSplitSession::process_sescmd_response(SRWBackend& backend, GWBUF** ppPacket)
|
void RWSplitSession::process_sescmd_response(SRWBackend& backend, GWBUF** ppPacket)
|
||||||
{
|
{
|
||||||
if (backend->have_session_commands())
|
if (backend->has_session_commands())
|
||||||
{
|
{
|
||||||
/** We are executing a session command */
|
/** We are executing a session command */
|
||||||
if (GWBUF_IS_TYPE_SESCMD_RESPONSE((*ppPacket)))
|
if (GWBUF_IS_TYPE_SESCMD_RESPONSE((*ppPacket)))
|
||||||
|
@ -457,13 +457,13 @@ void RWSplitSession::clientReply(GWBUF *writebuf, DCB *backend_dcb)
|
|||||||
m_expected_responses, backend->name());
|
m_expected_responses, backend->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (backend->have_session_commands())
|
if (backend->has_session_commands())
|
||||||
{
|
{
|
||||||
/** Reply to an executed session command */
|
/** Reply to an executed session command */
|
||||||
process_sescmd_response(backend, &writebuf);
|
process_sescmd_response(backend, &writebuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (backend->have_session_commands())
|
if (backend->has_session_commands())
|
||||||
{
|
{
|
||||||
if (backend->execute_session_command())
|
if (backend->execute_session_command())
|
||||||
{
|
{
|
||||||
@ -675,7 +675,7 @@ bool RWSplitSession::handle_error_new_connection(DCB *backend_dcb, GWBUF *errmsg
|
|||||||
*/
|
*/
|
||||||
gwbuf_free(stored);
|
gwbuf_free(stored);
|
||||||
|
|
||||||
if (!backend->have_session_commands())
|
if (!backend->has_session_commands())
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The backend was executing a command that requires a reply.
|
* The backend was executing a command that requires a reply.
|
||||||
|
@ -431,7 +431,7 @@ int32_t SchemaRouterSession::routeQuery(GWBUF* pPacket)
|
|||||||
|
|
||||||
MXS_INFO("Route query to \t%s:%d <", bref->backend()->server->name, bref->backend()->server->port);
|
MXS_INFO("Route query to \t%s:%d <", bref->backend()->server->name, bref->backend()->server->port);
|
||||||
|
|
||||||
if (bref->have_session_commands())
|
if (bref->has_session_commands())
|
||||||
{
|
{
|
||||||
/** Store current statement if execution of the previous
|
/** Store current statement if execution of the previous
|
||||||
* session command hasn't been completed. */
|
* session command hasn't been completed. */
|
||||||
@ -490,7 +490,7 @@ void SchemaRouterSession::handle_mapping_reply(SSRBackend& bref, GWBUF** pPacket
|
|||||||
|
|
||||||
void SchemaRouterSession::process_sescmd_response(SSRBackend& bref, GWBUF** ppPacket)
|
void SchemaRouterSession::process_sescmd_response(SSRBackend& bref, GWBUF** ppPacket)
|
||||||
{
|
{
|
||||||
if (bref->have_session_commands())
|
if (bref->has_session_commands())
|
||||||
{
|
{
|
||||||
/** We are executing a session command */
|
/** We are executing a session command */
|
||||||
if (GWBUF_IS_TYPE_SESCMD_RESPONSE((*ppPacket)))
|
if (GWBUF_IS_TYPE_SESCMD_RESPONSE((*ppPacket)))
|
||||||
|
Reference in New Issue
Block a user