MXS-1775 Change MonitorInstance::configure() prototype

Now return boolean, to allow derived class to signal a failure
to configure.
This commit is contained in:
Johan Wikman
2018-05-25 14:06:06 +03:00
parent 0783af88ed
commit 9b7e37e112
12 changed files with 45 additions and 32 deletions

View File

@ -49,8 +49,9 @@ json_t* AuroraMonitor::diagnostics_json() const
return NULL;
}
void AuroraMonitor::configure(const MXS_CONFIG_PARAMETER* params)
bool AuroraMonitor::configure(const MXS_CONFIG_PARAMETER* params)
{
return true;
}
bool AuroraMonitor::has_sufficient_permissions() const

View File

@ -32,7 +32,7 @@ public:
json_t* diagnostics_json() const;
protected:
void configure(const MXS_CONFIG_PARAMETER* params);
bool configure(const MXS_CONFIG_PARAMETER* params);
bool has_sufficient_permissions() const;
void update_server_status(MXS_MONITORED_SERVER* monitored_server);

View File

@ -130,7 +130,7 @@ json_t* GaleraMonitor::diagnostics_json() const
return rval;
}
void GaleraMonitor::configure(const MXS_CONFIG_PARAMETER* params)
bool GaleraMonitor::configure(const MXS_CONFIG_PARAMETER* params)
{
m_disableMasterFailback = config_get_bool(params, "disable_master_failback");
m_availableWhenDonor = config_get_bool(params, "available_when_donor");
@ -142,6 +142,8 @@ void GaleraMonitor::configure(const MXS_CONFIG_PARAMETER* params)
/* Reset all data in the hashtable */
reset_cluster_info();
return true;
}
bool GaleraMonitor::has_sufficient_permissions() const

View File

@ -64,7 +64,7 @@ public:
json_t* diagnostics_json() const;
protected:
void configure(const MXS_CONFIG_PARAMETER* param);
bool configure(const MXS_CONFIG_PARAMETER* param);
bool has_sufficient_permissions() const;
void update_server_status(MXS_MONITORED_SERVER* monitored_server);
void tick();

View File

@ -49,8 +49,9 @@ json_t* GRMon::diagnostics_json() const
return NULL;
}
void GRMon::configure(const MXS_CONFIG_PARAMETER* params)
bool GRMon::configure(const MXS_CONFIG_PARAMETER* params)
{
return true;
}
bool GRMon::has_sufficient_permissions() const

View File

@ -32,7 +32,7 @@ public:
json_t* diagnostics_json() const;
protected:
void configure(const MXS_CONFIG_PARAMETER* params);
bool configure(const MXS_CONFIG_PARAMETER* params);
bool has_sufficient_permissions() const;
void update_server_status(MXS_MONITORED_SERVER* monitored_server);

View File

@ -64,9 +64,11 @@ json_t* MMMonitor::diagnostics_json() const
return rval;
}
void MMMonitor::configure(const MXS_CONFIG_PARAMETER* params)
bool MMMonitor::configure(const MXS_CONFIG_PARAMETER* params)
{
m_detectStaleMaster = config_get_bool(params, "detect_stale_master");
return true;
}
bool MMMonitor::has_sufficient_permissions() const

View File

@ -32,7 +32,7 @@ public:
json_t* diagnostics_json() const;
protected:
void configure(const MXS_CONFIG_PARAMETER* params);
bool configure(const MXS_CONFIG_PARAMETER* params);
bool has_sufficient_permissions() const;
void update_server_status(MXS_MONITORED_SERVER* monitored_server);
void tick();

View File

@ -47,8 +47,9 @@ json_t* NDBCMonitor::diagnostics_json() const
return NULL;
}
void NDBCMonitor::configure(const MXS_CONFIG_PARAMETER* params)
bool NDBCMonitor::configure(const MXS_CONFIG_PARAMETER* params)
{
return true;
}
bool NDBCMonitor::has_sufficient_permissions() const

View File

@ -32,7 +32,7 @@ public:
json_t* diagnostics_json() const;
protected:
void configure(const MXS_CONFIG_PARAMETER* params);
bool configure(const MXS_CONFIG_PARAMETER* params);
bool has_sufficient_permissions() const;
void update_server_status(MXS_MONITORED_SERVER* monitored_server);