MXS-2273 Move code for setting maintenance bit to monitor.cc

Applies to being-drained as well.

Better that this special handling is handled by Monitor that needs it.
This commit is contained in:
Johan Wikman
2019-01-28 14:00:32 +02:00
parent 05b650ed91
commit 727d3feb3b
3 changed files with 143 additions and 61 deletions

View File

@ -193,6 +193,30 @@ public:
void set_interval(int64_t interval);
/**
* Set status of monitored server.
*
* @param srv Server, must be monitored by this monitor.
* @param bit The server status bit to be sent.
* @errmsg_out If the setting of the bit fails, on return the human readable
* reason why it could not be set.
*
* @return True, if the bit could be set.
*/
bool set_server_status(SERVER* srv, int bit, std::string* errmsg_out);
/**
* Clear status of monitored server.
*
* @param srv Server, must be monitored by this monitor.
* @param bit The server status bit to be cleared.
* @errmsg_out If the clearing of the bit fails, on return the human readable
* reason why it could not be cleared.
*
* @return True, if the bit could be cleared.
*/
bool clear_server_status(SERVER* srv, int bit, std::string* errmsg_out);
void show(DCB* dcb);
const char* const m_name; /**< Monitor instance name. TODO: change to string */