Cleaned up monitor headers

Formatted all monitor headers according to the coding style.
This commit is contained in:
Markus Makela
2015-11-16 13:46:22 +02:00
parent 65e2b50f96
commit a7e2bf09c8
4 changed files with 70 additions and 59 deletions

View File

@ -46,23 +46,23 @@
* @endverbatim * @endverbatim
*/ */
/** /**
* The handle for an instance of a MySQL Monitor module * The handle for an instance of a Galera Monitor module
*/ */
typedef struct { typedef struct
SPINLOCK lock; /**< The monitor spinlock */ {
pthread_t tid; /**< id of monitor thread */ SPINLOCK lock; /**< The monitor spinlock */
int shutdown; /**< Flag to shutdown the monitor thread */ pthread_t tid; /**< id of monitor thread */
int status; /**< Monitor status */ int shutdown; /**< Flag to shutdown the monitor thread */
unsigned long id; /**< Monitor ID */ int status; /**< Monitor status */
int disableMasterFailback; /**< Monitor flag for Galera Cluster Master failback */ unsigned long id; /**< Monitor ID */
int availableWhenDonor; /**< Monitor flag for Galera Cluster Donor availability */ int disableMasterFailback; /**< Monitor flag for Galera Cluster Master failback */
int disableMasterRoleSetting; /**< Monitor flag to disable setting master role */ int availableWhenDonor; /**< Monitor flag for Galera Cluster Donor availability */
MONITOR_SERVERS *master; /**< Master server for MySQL Master/Slave replication */ int disableMasterRoleSetting; /**< Monitor flag to disable setting master role */
char* script; MONITOR_SERVERS *master; /**< Master server for MySQL Master/Slave replication */
bool use_priority; /*< Use server priorities */ char* script;
bool events[MAX_MONITOR_EVENT]; /*< enabled events */ bool use_priority; /*< Use server priorities */
bool events[MAX_MONITOR_EVENT]; /*< enabled events */
} GALERA_MONITOR; } GALERA_MONITOR;
#endif #endif

View File

@ -17,6 +17,7 @@
* *
* Copyright MariaDB Corporation Ab 2015 * Copyright MariaDB Corporation Ab 2015
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -34,17 +35,22 @@
#include <monitor_common.h> #include <monitor_common.h>
#include <externcmd.h> #include <externcmd.h>
/**
* @file mmmon.h - The Multi-Master monitor
*/
/** /**
* The handle for an instance of a Multi-Master Monitor module * The handle for an instance of a Multi-Master Monitor module
*/ */
typedef struct { typedef struct
SPINLOCK lock; /**< The monitor spinlock */ {
pthread_t tid; /**< id of monitor thread */ SPINLOCK lock; /**< The monitor spinlock */
int shutdown; /**< Flag to shutdown the monitor thread */ pthread_t tid; /**< id of monitor thread */
int status; /**< Monitor status */ int shutdown; /**< Flag to shutdown the monitor thread */
unsigned long id; /**< Monitor ID */ int status; /**< Monitor status */
int detectStaleMaster; /**< Monitor flag for Stale Master detection */ unsigned long id; /**< Monitor ID */
MONITOR_SERVERS *master; /**< Master server for Master/Slave replication */ int detectStaleMaster; /**< Monitor flag for Stale Master detection */
MONITOR_SERVERS *master; /**< Master server for Master/Slave replication */
char* script; /*< Script to call when state changes occur on servers */ char* script; /*< Script to call when state changes occur on servers */
bool events[MAX_MONITOR_EVENT]; /*< enabled events */ bool events[MAX_MONITOR_EVENT]; /*< enabled events */
} MM_MONITOR; } MM_MONITOR;

View File

@ -17,6 +17,7 @@
* *
* Copyright MariaDB Corporation Ab 2013-2014 * Copyright MariaDB Corporation Ab 2013-2014
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -33,44 +34,46 @@
#include <maxconfig.h> #include <maxconfig.h>
#include <monitor_common.h> #include <monitor_common.h>
#include <externcmd.h> #include <externcmd.h>
/** /**
* @file mysqlmon.h - The MySQL monitor functionality within the gateway * @file mysqlmon.h - The MySQL monitor
* *
* @verbatim * @verbatim
* Revision History * Revision History
* *
* Date Who Description * Date Who Description
* 08/07/13 Mark Riddoch Initial implementation * 08/07/13 Mark Riddoch Initial implementation
* 26/05/14 Massimiliano Pinto Default values for MONITOR_INTERVAL * 26/05/14 Massimiliano Pinto Default values for MONITOR_INTERVAL
* 28/05/14 Massimiliano Pinto Addition of new fields in MYSQL_MONITOR struct * 28/05/14 Massimiliano Pinto Addition of new fields in MYSQL_MONITOR struct
* 24/06/14 Massimiliano Pinto Addition of master field in MYSQL_MONITOR struct and MONITOR_MAX_NUM_SLAVES * 24/06/14 Massimiliano Pinto Addition of master field in MYSQL_MONITOR struct and MONITOR_MAX_NUM_SLAVES
* 28/08/14 Massimiliano Pinto Addition of detectStaleMaster * 28/08/14 Massimiliano Pinto Addition of detectStaleMaster
* 30/10/14 Massimiliano Pinto Addition of disableMasterFailback * 30/10/14 Massimiliano Pinto Addition of disableMasterFailback
* 07/11/14 Massimiliano Pinto Addition of NetworkTimeout: connect, read, write * 07/11/14 Massimiliano Pinto Addition of NetworkTimeout: connect, read, write
* 20/04/15 Guillaume Lefranc Addition of availableWhenDonor * 20/04/15 Guillaume Lefranc Addition of availableWhenDonor
* 22/04/15 Martin Brampton Addition of disableMasterRoleSetting * 22/04/15 Martin Brampton Addition of disableMasterRoleSetting
* 07/05/15 Markus Makela Addition of command execution on Master server failure * 07/05/15 Markus Makela Addition of command execution on Master server failure
* @endverbatim * @endverbatim
*/ */
/** /**
* The handle for an instance of a MySQL Monitor module * The handle for an instance of a MySQL Monitor module
*/ */
typedef struct { typedef struct
SPINLOCK lock; /**< The monitor spinlock */ {
pthread_t tid; /**< id of monitor thread */ SPINLOCK lock; /**< The monitor spinlock */
int shutdown; /**< Flag to shutdown the monitor thread */ pthread_t tid; /**< id of monitor thread */
int status; /**< Monitor status */ int shutdown; /**< Flag to shutdown the monitor thread */
unsigned long id; /**< Monitor ID */ int status; /**< Monitor status */
int replicationHeartbeat; /**< Monitor flag for MySQL replication heartbeat */ unsigned long id; /**< Monitor ID */
int detectStaleMaster; /**< Monitor flag for MySQL replication Stale Master detection */ int replicationHeartbeat; /**< Monitor flag for MySQL replication heartbeat */
int disableMasterFailback; /**< Monitor flag for Galera Cluster Master failback */ int detectStaleMaster; /**< Monitor flag for MySQL replication Stale Master detection */
int availableWhenDonor; /**< Monitor flag for Galera Cluster Donor availability */ int disableMasterFailback; /**< Monitor flag for Galera Cluster Master failback */
int disableMasterRoleSetting; /**< Monitor flag to disable setting master role */ int availableWhenDonor; /**< Monitor flag for Galera Cluster Donor availability */
bool mysql51_replication; /**< Use MySQL 5.1 replication */ int disableMasterRoleSetting; /**< Monitor flag to disable setting master role */
MONITOR_SERVERS *master; /**< Master server for MySQL Master/Slave replication */ bool mysql51_replication; /**< Use MySQL 5.1 replication */
char* script; /*< Script to call when state changes occur on servers */ MONITOR_SERVERS *master; /**< Master server for MySQL Master/Slave replication */
bool events[MAX_MONITOR_EVENT]; /*< enabled events */ char* script; /*< Script to call when state changes occur on servers */
bool events[MAX_MONITOR_EVENT]; /*< enabled events */
} MYSQL_MONITOR; } MYSQL_MONITOR;
#endif #endif

View File

@ -17,6 +17,7 @@
* *
* Copyright MariaDB Corporation Ab 2013-2014 * Copyright MariaDB Corporation Ab 2013-2014
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -42,15 +43,16 @@
/** /**
* The handle for an instance of a NDB Cluster Monitor module * The handle for an instance of a NDB Cluster Monitor module
*/ */
typedef struct { typedef struct
SPINLOCK lock; /**< The monitor spinlock */ {
pthread_t tid; /**< id of monitor thread */ SPINLOCK lock; /**< The monitor spinlock */
int shutdown; /**< Flag to shutdown the monitor thread */ pthread_t tid; /**< id of monitor thread */
int status; /**< Monitor status */ int shutdown; /**< Flag to shutdown the monitor thread */
unsigned long id; /**< Monitor ID */ int status; /**< Monitor status */
MONITOR_SERVERS *master; /**< Master server for MySQL Master/Slave replication */ unsigned long id; /**< Monitor ID */
char* script; /*< Script to call when state changes occur on servers */ MONITOR_SERVERS *master; /**< Master server for MySQL Master/Slave replication */
bool events[MAX_MONITOR_EVENT]; /*< enabled events */ char* script; /*< Script to call when state changes occur on servers */
bool events[MAX_MONITOR_EVENT]; /*< enabled events */
} MYSQL_MONITOR; } MYSQL_MONITOR;
#endif #endif