Updates to refactoring of the monitors.
This commit is contained in:
@ -93,7 +93,7 @@ static int internalService(char *router);
|
|||||||
int config_get_ifaddr(unsigned char *output);
|
int config_get_ifaddr(unsigned char *output);
|
||||||
int config_get_release_string(char* release);
|
int config_get_release_string(char* release);
|
||||||
FEEDBACK_CONF * config_get_feedback_data();
|
FEEDBACK_CONF * config_get_feedback_data();
|
||||||
|
void config_add_param(CONFIG_CONTEXT*,char*,char*);
|
||||||
static char *config_file = NULL;
|
static char *config_file = NULL;
|
||||||
static GATEWAY_CONF gateway;
|
static GATEWAY_CONF gateway;
|
||||||
static FEEDBACK_CONF feedback;
|
static FEEDBACK_CONF feedback;
|
||||||
@ -895,6 +895,7 @@ int error_count = 0;
|
|||||||
gateway.id = getpid();
|
gateway.id = getpid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
monitorStart(obj->element,obj->parameters)
|
||||||
/* add the maxscale-id to monitor data */
|
/* add the maxscale-id to monitor data */
|
||||||
monitorSetId(obj->element, gateway.id);
|
monitorSetId(obj->element, gateway.id);
|
||||||
|
|
||||||
@ -904,7 +905,7 @@ int error_count = 0;
|
|||||||
|
|
||||||
/* set replication heartbeat */
|
/* set replication heartbeat */
|
||||||
if(replication_heartbeat == 1)
|
if(replication_heartbeat == 1)
|
||||||
monitorSetReplicationHeartbeat(obj->element, replication_heartbeat);
|
monitorSetReplicationHeartbeat(obj->element, replication_heartbeat);
|
||||||
|
|
||||||
/* detect stale master */
|
/* detect stale master */
|
||||||
if(detect_stale_master == 1)
|
if(detect_stale_master == 1)
|
||||||
@ -2262,3 +2263,18 @@ unsigned long config_get_gateway_id()
|
|||||||
{
|
{
|
||||||
return gateway.id;
|
return gateway.id;
|
||||||
}
|
}
|
||||||
|
void config_add_param(CONFIG_CONTEXT* obj, char* key,char* value)
|
||||||
|
{
|
||||||
|
CONFIG_PARAMETER* nptr = malloc(sizeof(CONFIG_PARAMETER));
|
||||||
|
|
||||||
|
if(nptr == NULL)
|
||||||
|
{
|
||||||
|
skygw_log_write(LOGFILE_ERROR,"Memory allocation failed when adding configuration parameters");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
nptr->name = strdup(key);
|
||||||
|
nptr->value = strdup(value);
|
||||||
|
nptr->next = obj->parameters;
|
||||||
|
obj->parameters = nptr;
|
||||||
|
}
|
||||||
@ -67,7 +67,7 @@
|
|||||||
* monitored.
|
* monitored.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void *(*startMonitor)(void *);
|
void *(*startMonitor)(void *, void*);
|
||||||
void (*stopMonitor)(void *);
|
void (*stopMonitor)(void *);
|
||||||
void (*registerServer)(void *, SERVER *);
|
void (*registerServer)(void *, SERVER *);
|
||||||
void (*unregisterServer)(void *, SERVER *);
|
void (*unregisterServer)(void *, SERVER *);
|
||||||
|
|||||||
@ -166,10 +166,10 @@ GetModuleObject()
|
|||||||
* @return A handle to use when interacting with the monitor
|
* @return A handle to use when interacting with the monitor
|
||||||
*/
|
*/
|
||||||
static void *
|
static void *
|
||||||
startMonitor(void *arg,CONFIG_PARAMETER param)
|
startMonitor(void *arg, void* opt)
|
||||||
{
|
{
|
||||||
MYSQL_MONITOR *handle;
|
MYSQL_MONITOR *handle;
|
||||||
|
CONFIG_PARAMETER* params = (CONFIG_PARAMETER*)opt;
|
||||||
if (arg)
|
if (arg)
|
||||||
{
|
{
|
||||||
handle = arg; /* Must be a restart */
|
handle = arg; /* Must be a restart */
|
||||||
|
|||||||
Reference in New Issue
Block a user