MXS-1703 Use monitor-specific array instead of linked list

Also starting cleanup of server specific monitor code.
This commit is contained in:
Esa Korhonen
2018-04-27 18:33:46 +03:00
parent b44f2cfa36
commit 10b2b4ac37
4 changed files with 32 additions and 46 deletions

View File

@ -91,26 +91,18 @@ void MariaDBMonitor::init_server_info()
}
/**
* Get monitor-specific server info for the monitored server.
*
* @param handle
* @param db Server to get info for. Must be a valid server or function crashes.
* @return The server info.
*/
* Get monitor-specific server info for the monitored server.
*
* @param handle
* @param db Server to get info for. Must be a valid server or function crashes.
* @return The server info.
*/
MariaDBServer* MariaDBMonitor::get_server_info(MXS_MONITORED_SERVER* db)
{
ss_dassert(m_server_info.count(db) == 1); // Should always exist in the map
return m_server_info[db];
}
/**
* Constant version of get_server_info().
*/
const MariaDBServer* MariaDBMonitor::get_server_info(const MXS_MONITORED_SERVER* db) const
{
return const_cast<MariaDBMonitor*>(this)->get_server_info(const_cast<MXS_MONITORED_SERVER*>(db));
}
bool MariaDBMonitor::set_replication_credentials(const MXS_CONFIG_PARAMETER* params)
{
bool rval = false;