Move some Monitor fields to private and protected

None of the fields should be publicly writable and some should not even
be writable from derived classes.
This commit is contained in:
Esa Korhonen
2019-05-08 18:43:37 +03:00
parent 5077ad62df
commit a9b1e3a442
7 changed files with 100 additions and 74 deletions

View File

@ -182,8 +182,8 @@ bool MariaDBMonitor::set_replication_credentials(const MXS_CONFIG_PARAMETER* par
else
{
// Ok, neither is set. Use monitor credentials.
repl_user = m_settings.conn_settings.username;
repl_pw = m_settings.conn_settings.password;
repl_user = settings().conn_settings.username;
repl_pw = settings().conn_settings.password;
}
}
@ -395,7 +395,7 @@ void MariaDBMonitor::tick()
// Query all servers for their status.
bool should_update_disk_space = check_disk_space_this_tick();
const auto& conn_settings = m_settings.conn_settings;
const auto& conn_settings = settings().conn_settings;
auto update_task = [should_update_disk_space, conn_settings](MariaDBServer* server) {
server->update_server(should_update_disk_space, conn_settings);