MXS-2271 Move free monitor functions into classes

Functions are divided to MonitorManager, Monitor, or the monitored
server.
This commit is contained in:
Esa Korhonen
2019-03-06 14:41:06 +02:00
parent 40f24aaaee
commit a8949b2560
13 changed files with 138 additions and 148 deletions

View File

@ -47,7 +47,7 @@ static std::string do_query(MXS_MONITORED_SERVER* srv, const char* query)
}
else
{
mon_report_query_error(srv);
srv->mon_report_query_error();
}
return rval;
@ -95,7 +95,7 @@ bool CsMonitor::has_sufficient_permissions()
void CsMonitor::update_server_status(MXS_MONITORED_SERVER* srv)
{
monitor_clear_pending_status(srv, SERVER_MASTER | SERVER_SLAVE | SERVER_RUNNING);
srv->clear_pending_status(SERVER_MASTER | SERVER_SLAVE | SERVER_RUNNING);
int status = 0;
if (do_query(srv, alive_query) == "1")
@ -114,7 +114,7 @@ void CsMonitor::update_server_status(MXS_MONITORED_SERVER* srv)
}
}
monitor_set_pending_status(srv, status);
srv->set_pending_status(status);
}
bool CsMonitor::configure(const MXS_CONFIG_PARAMETER* pParams)