MXS-2271 Monitor config name and instance name are parameters of createInstance()
Also adds/moves some comments from previous entrypoints. Name and module are now constant fields.
This commit is contained in:
@ -59,7 +59,8 @@ static const char CN_REPLICATION_PASSWORD[] = "replication_password";
|
||||
static const char DIAG_ERROR[] = "Internal error, could not print diagnostics. "
|
||||
"Check log for more information.";
|
||||
|
||||
MariaDBMonitor::MariaDBMonitor()
|
||||
MariaDBMonitor::MariaDBMonitor(const string& name, const string& module)
|
||||
: MonitorWorker(name, module)
|
||||
{
|
||||
}
|
||||
|
||||
@ -172,9 +173,9 @@ bool MariaDBMonitor::set_replication_credentials(const MXS_CONFIG_PARAMETER* par
|
||||
return rval;
|
||||
}
|
||||
|
||||
MariaDBMonitor* MariaDBMonitor::create()
|
||||
MariaDBMonitor* MariaDBMonitor::create(const string& name, const string& module)
|
||||
{
|
||||
return new MariaDBMonitor();
|
||||
return new MariaDBMonitor(name, module);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -48,10 +48,11 @@ public:
|
||||
/**
|
||||
* Create the monitor instance and return the instance data.
|
||||
*
|
||||
* @param monitor Generic monitor data
|
||||
* @param name Monitor config name
|
||||
* @param module Module name
|
||||
* @return MariaDBMonitor instance
|
||||
*/
|
||||
static MariaDBMonitor* create();
|
||||
static MariaDBMonitor* create(const std::string& name, const std::string& module);
|
||||
|
||||
~MariaDBMonitor();
|
||||
|
||||
@ -236,7 +237,7 @@ private:
|
||||
* gtid:s? */
|
||||
|
||||
// Base methods
|
||||
MariaDBMonitor();
|
||||
MariaDBMonitor(const std::string& name, const std::string& module);
|
||||
bool configure(const MXS_CONFIG_PARAMETER* params);
|
||||
bool set_replication_credentials(const MXS_CONFIG_PARAMETER* params);
|
||||
void reset_server_info();
|
||||
|
||||
@ -90,7 +90,7 @@ int main()
|
||||
}
|
||||
|
||||
MariaDBMonitor::Test::Test(bool use_hostnames)
|
||||
: m_monitor(new MariaDBMonitor())
|
||||
: m_monitor(new MariaDBMonitor("TestMonitor", MXS_MODULE_NAME))
|
||||
, m_use_hostnames(use_hostnames)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user