MXS-2196: Rename dcb_role_t to DCB::Role

This commit is contained in:
Markus Mäkelä
2018-12-04 12:02:10 +02:00
parent 0b9241913c
commit 77477d9648
21 changed files with 93 additions and 94 deletions

View File

@ -375,7 +375,7 @@ bool notify_cb(DCB* dcb, void* data)
{
SERVICE* service = static_cast<SERVICE*>(data);
if (dcb->service == service && dcb->dcb_role == DCB_ROLE_CLIENT_HANDLER)
if (dcb->service == service && dcb->role == DCB::Role::CLIENT)
{
poll_fake_write_event(dcb);
}

View File

@ -2374,7 +2374,7 @@ static void errorReply(MXS_ROUTER* instance,
mxs_error_action_t action,
bool* succp)
{
mxb_assert(backend_dcb->dcb_role == DCB_ROLE_BACKEND_HANDLER);
mxb_assert(backend_dcb->role == DCB::Role::BACKEND);
ROUTER_INSTANCE* router = (ROUTER_INSTANCE*)instance;
int error;
socklen_t len;

View File

@ -189,7 +189,7 @@ static void blr_start_master(void* data)
pthread_mutex_unlock(&router->lock);
// TODO: Fix this
DCB* client = dcb_alloc(DCB_ROLE_INTERNAL, NULL);
DCB* client = dcb_alloc(DCB::Role::INTERNAL, NULL);
/* Create fake 'client' DCB */
if (client == NULL)

View File

@ -158,7 +158,7 @@ void HintRouterSession::handleError(GWBUF* pMessage,
{
HR_ENTRY();
mxb_assert(pProblem->dcb_role == DCB_ROLE_BACKEND_HANDLER);
mxb_assert(pProblem->role == DCB::Role::BACKEND);
MXS_SESSION* pSession = pProblem->session;
mxs_session_state_t sesstate = pSession->state;

View File

@ -269,7 +269,7 @@ static void handleError(MXS_ROUTER* instance,
bool* succp)
{
mxb_assert(backend_dcb->dcb_role == DCB_ROLE_BACKEND_HANDLER);
mxb_assert(backend_dcb->role == DCB::Role::BACKEND);
DCB* client_dcb;
MXS_SESSION* session = backend_dcb->session;

View File

@ -710,7 +710,7 @@ static void handleError(MXS_ROUTER* instance,
bool* succp)
{
mxb_assert(problem_dcb->dcb_role == DCB_ROLE_BACKEND_HANDLER);
mxb_assert(problem_dcb->role == DCB::Role::BACKEND);
mxb_assert(problem_dcb->session->state == SESSION_STATE_ROUTER_READY);
DCB* client_dcb = problem_dcb->session->client_dcb;
client_dcb->func.write(client_dcb, gwbuf_clone(errbuf));

View File

@ -858,9 +858,9 @@ void RWSplitSession::log_master_routing_failure(bool found,
/** Both backends should either be empty, not connected or the DCB should
* be a backend (the last check is slightly redundant). */
mxb_assert(!old_master || !old_master->in_use()
|| old_master->dcb()->dcb_role == DCB_ROLE_BACKEND_HANDLER);
|| old_master->dcb()->role == DCB::Role::BACKEND);
mxb_assert(!curr_master || !curr_master->in_use()
|| curr_master->dcb()->dcb_role == DCB_ROLE_BACKEND_HANDLER);
|| curr_master->dcb()->role == DCB::Role::BACKEND);
char errmsg[MAX_SERVER_ADDRESS_LEN * 2 + 100]; // Extra space for error message
if (m_config.delayed_retry && m_retry_duration >= m_config.delayed_retry_timeout)

View File

@ -311,7 +311,7 @@ GWBUF* RWSplitSession::discard_master_wait_gtid_result(GWBUF* buffer)
*/
RWBackend* RWSplitSession::get_backend_from_dcb(DCB* dcb)
{
mxb_assert(dcb->dcb_role == DCB_ROLE_BACKEND_HANDLER);
mxb_assert(dcb->role == DCB::Role::BACKEND);
for (auto it = m_raw_backends.begin(); it != m_raw_backends.end(); it++)
{
@ -866,7 +866,7 @@ void RWSplitSession::handleError(GWBUF* errmsgbuf,
mxs_error_action_t action,
bool* succp)
{
mxb_assert(problem_dcb->dcb_role == DCB_ROLE_BACKEND_HANDLER);
mxb_assert(problem_dcb->role == DCB::Role::BACKEND);
MXS_SESSION* session = problem_dcb->session;
mxb_assert(session);

View File

@ -616,7 +616,7 @@ void SchemaRouterSession::handleError(GWBUF* pMessage,
mxs_error_action_t action,
bool* pSuccess)
{
mxb_assert(pProblem->dcb_role == DCB_ROLE_BACKEND_HANDLER);
mxb_assert(pProblem->role == DCB::Role::BACKEND);
SSRBackend bref = get_bref_from_dcb(pProblem);
if (bref.get() == NULL) // Should never happen