MXS-1848 monitor_[alloc|free]() -> monitor_[create|destroy]
As these will call the createInstance and destroyInstance functions of the monitor, they are more appropriately named like this.
This commit is contained in:
@ -3480,7 +3480,7 @@ int create_new_monitor(CONFIG_CONTEXT *context, CONFIG_CONTEXT *obj, HASHTABLE*
|
|||||||
char *module = config_get_value(obj->parameters, CN_MODULE);
|
char *module = config_get_value(obj->parameters, CN_MODULE);
|
||||||
if (module)
|
if (module)
|
||||||
{
|
{
|
||||||
if ((obj->element = monitor_alloc(obj->object, module)) == NULL)
|
if ((obj->element = monitor_create(obj->object, module)) == NULL)
|
||||||
{
|
{
|
||||||
MXS_ERROR("Failed to create monitor '%s'.", obj->object);
|
MXS_ERROR("Failed to create monitor '%s'.", obj->object);
|
||||||
error_count++;
|
error_count++;
|
||||||
|
|||||||
@ -937,7 +937,7 @@ bool runtime_create_monitor(const char *name, const char *module)
|
|||||||
{
|
{
|
||||||
MXS_DEBUG("Repurposed monitor '%s'", name);
|
MXS_DEBUG("Repurposed monitor '%s'", name);
|
||||||
}
|
}
|
||||||
else if ((monitor = monitor_alloc(name, module)) == NULL)
|
else if ((monitor = monitor_create(name, module)) == NULL)
|
||||||
{
|
{
|
||||||
runtime_error("Could not create monitor '%s' with module '%s'", name, module);
|
runtime_error("Could not create monitor '%s' with module '%s'", name, module);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,8 +47,8 @@ typedef enum
|
|||||||
MONITOR_CONNECT_ATTEMPTS = 3
|
MONITOR_CONNECT_ATTEMPTS = 3
|
||||||
} monitor_timeouts_t;
|
} monitor_timeouts_t;
|
||||||
|
|
||||||
MXS_MONITOR *monitor_alloc(const char *, const char *);
|
MXS_MONITOR *monitor_create(const char *, const char *);
|
||||||
void monitor_free(MXS_MONITOR *);
|
void monitor_destroy(MXS_MONITOR *);
|
||||||
|
|
||||||
void monitor_start(MXS_MONITOR *, const MXS_CONFIG_PARAMETER*);
|
void monitor_start(MXS_MONITOR *, const MXS_CONFIG_PARAMETER*);
|
||||||
void monitor_stop(MXS_MONITOR *);
|
void monitor_stop(MXS_MONITOR *);
|
||||||
|
|||||||
@ -92,14 +92,14 @@ static unsigned int all_server_bits = SERVER_RUNNING | SERVER_MAINT |
|
|||||||
SERVER_JOINED | SERVER_NDB;
|
SERVER_JOINED | SERVER_NDB;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocate a new monitor, load the associated module for the monitor
|
* Create a new monitor, load the associated module for the monitor
|
||||||
* and start execution on the monitor.
|
* and start execution on the monitor.
|
||||||
*
|
*
|
||||||
* @param name The name of the monitor module to load
|
* @param name The name of the monitor module to load
|
||||||
* @param module The module to load
|
* @param module The module to load
|
||||||
* @return The newly created monitor
|
* @return The newly created monitor
|
||||||
*/
|
*/
|
||||||
MXS_MONITOR* monitor_alloc(const char *name, const char *module)
|
MXS_MONITOR* monitor_create(const char *name, const char *module)
|
||||||
{
|
{
|
||||||
char* my_name = MXS_STRDUP(name);
|
char* my_name = MXS_STRDUP(name);
|
||||||
char *my_module = MXS_STRDUP(module);
|
char *my_module = MXS_STRDUP(module);
|
||||||
|
|||||||
@ -406,7 +406,7 @@ int test_domain_matching(const char* actual_module,
|
|||||||
/** Create a monitor */
|
/** Create a monitor */
|
||||||
char *libdir = MXS_STRDUP_A("../../modules/monitor/mariadbmon/");
|
char *libdir = MXS_STRDUP_A("../../modules/monitor/mariadbmon/");
|
||||||
set_libdir(libdir);
|
set_libdir(libdir);
|
||||||
monitor_alloc(name, actual_module);
|
monitor_create(name, actual_module);
|
||||||
|
|
||||||
const MODULECMD *cmd;
|
const MODULECMD *cmd;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user