From a7e2bf09c809658d93ad55a5e6f0738727edfb98 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Mon, 16 Nov 2015 13:46:22 +0200 Subject: [PATCH] Cleaned up monitor headers Formatted all monitor headers according to the coding style. --- server/modules/monitor/galeramon.h | 30 +++++++------- server/modules/monitor/mmmon.h | 22 ++++++---- server/modules/monitor/mysqlmon.h | 57 ++++++++++++++------------ server/modules/monitor/ndbclustermon.h | 20 +++++---- 4 files changed, 70 insertions(+), 59 deletions(-) diff --git a/server/modules/monitor/galeramon.h b/server/modules/monitor/galeramon.h index 5a209f01e..b92e97015 100644 --- a/server/modules/monitor/galeramon.h +++ b/server/modules/monitor/galeramon.h @@ -46,23 +46,23 @@ * @endverbatim */ - /** - * The handle for an instance of a MySQL Monitor module + * The handle for an instance of a Galera Monitor module */ -typedef struct { - SPINLOCK lock; /**< The monitor spinlock */ - pthread_t tid; /**< id of monitor thread */ - int shutdown; /**< Flag to shutdown the monitor thread */ - int status; /**< Monitor status */ - unsigned long id; /**< Monitor ID */ - int disableMasterFailback; /**< Monitor flag for Galera Cluster Master failback */ - int availableWhenDonor; /**< Monitor flag for Galera Cluster Donor availability */ - int disableMasterRoleSetting; /**< Monitor flag to disable setting master role */ - MONITOR_SERVERS *master; /**< Master server for MySQL Master/Slave replication */ - char* script; - bool use_priority; /*< Use server priorities */ - bool events[MAX_MONITOR_EVENT]; /*< enabled events */ +typedef struct +{ + SPINLOCK lock; /**< The monitor spinlock */ + pthread_t tid; /**< id of monitor thread */ + int shutdown; /**< Flag to shutdown the monitor thread */ + int status; /**< Monitor status */ + unsigned long id; /**< Monitor ID */ + int disableMasterFailback; /**< Monitor flag for Galera Cluster Master failback */ + int availableWhenDonor; /**< Monitor flag for Galera Cluster Donor availability */ + int disableMasterRoleSetting; /**< Monitor flag to disable setting master role */ + MONITOR_SERVERS *master; /**< Master server for MySQL Master/Slave replication */ + char* script; + bool use_priority; /*< Use server priorities */ + bool events[MAX_MONITOR_EVENT]; /*< enabled events */ } GALERA_MONITOR; #endif diff --git a/server/modules/monitor/mmmon.h b/server/modules/monitor/mmmon.h index 8a9edfb56..9e1f4d962 100644 --- a/server/modules/monitor/mmmon.h +++ b/server/modules/monitor/mmmon.h @@ -17,6 +17,7 @@ * * Copyright MariaDB Corporation Ab 2015 */ + #include #include #include @@ -34,17 +35,22 @@ #include #include +/** + * @file mmmon.h - The Multi-Master monitor + */ + /** * The handle for an instance of a Multi-Master Monitor module */ -typedef struct { - SPINLOCK lock; /**< The monitor spinlock */ - pthread_t tid; /**< id of monitor thread */ - int shutdown; /**< Flag to shutdown the monitor thread */ - int status; /**< Monitor status */ - unsigned long id; /**< Monitor ID */ - int detectStaleMaster; /**< Monitor flag for Stale Master detection */ - MONITOR_SERVERS *master; /**< Master server for Master/Slave replication */ +typedef struct +{ + SPINLOCK lock; /**< The monitor spinlock */ + pthread_t tid; /**< id of monitor thread */ + int shutdown; /**< Flag to shutdown the monitor thread */ + int status; /**< Monitor status */ + unsigned long id; /**< Monitor ID */ + 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 */ bool events[MAX_MONITOR_EVENT]; /*< enabled events */ } MM_MONITOR; diff --git a/server/modules/monitor/mysqlmon.h b/server/modules/monitor/mysqlmon.h index 227b693c9..eaa640a94 100644 --- a/server/modules/monitor/mysqlmon.h +++ b/server/modules/monitor/mysqlmon.h @@ -17,6 +17,7 @@ * * Copyright MariaDB Corporation Ab 2013-2014 */ + #include #include #include @@ -33,44 +34,46 @@ #include #include #include + /** - * @file mysqlmon.h - The MySQL monitor functionality within the gateway + * @file mysqlmon.h - The MySQL monitor * * @verbatim * Revision History * - * Date Who Description - * 08/07/13 Mark Riddoch Initial implementation - * 26/05/14 Massimiliano Pinto Default values for MONITOR_INTERVAL - * 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 - * 28/08/14 Massimiliano Pinto Addition of detectStaleMaster - * 30/10/14 Massimiliano Pinto Addition of disableMasterFailback - * 07/11/14 Massimiliano Pinto Addition of NetworkTimeout: connect, read, write - * 20/04/15 Guillaume Lefranc Addition of availableWhenDonor - * 22/04/15 Martin Brampton Addition of disableMasterRoleSetting - * 07/05/15 Markus Makela Addition of command execution on Master server failure + * Date Who Description + * 08/07/13 Mark Riddoch Initial implementation + * 26/05/14 Massimiliano Pinto Default values for MONITOR_INTERVAL + * 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 + * 28/08/14 Massimiliano Pinto Addition of detectStaleMaster + * 30/10/14 Massimiliano Pinto Addition of disableMasterFailback + * 07/11/14 Massimiliano Pinto Addition of NetworkTimeout: connect, read, write + * 20/04/15 Guillaume Lefranc Addition of availableWhenDonor + * 22/04/15 Martin Brampton Addition of disableMasterRoleSetting + * 07/05/15 Markus Makela Addition of command execution on Master server failure * @endverbatim */ /** * The handle for an instance of a MySQL Monitor module */ -typedef struct { - SPINLOCK lock; /**< The monitor spinlock */ - pthread_t tid; /**< id of monitor thread */ - int shutdown; /**< Flag to shutdown the monitor thread */ - int status; /**< Monitor status */ - unsigned long id; /**< Monitor ID */ - int replicationHeartbeat; /**< Monitor flag for MySQL replication heartbeat */ - int detectStaleMaster; /**< Monitor flag for MySQL replication Stale Master detection */ - int disableMasterFailback; /**< Monitor flag for Galera Cluster Master failback */ - int availableWhenDonor; /**< Monitor flag for Galera Cluster Donor availability */ - int disableMasterRoleSetting; /**< Monitor flag to disable setting master role */ - bool mysql51_replication; /**< Use MySQL 5.1 replication */ - MONITOR_SERVERS *master; /**< Master server for MySQL Master/Slave replication */ - char* script; /*< Script to call when state changes occur on servers */ - bool events[MAX_MONITOR_EVENT]; /*< enabled events */ +typedef struct +{ + SPINLOCK lock; /**< The monitor spinlock */ + pthread_t tid; /**< id of monitor thread */ + int shutdown; /**< Flag to shutdown the monitor thread */ + int status; /**< Monitor status */ + unsigned long id; /**< Monitor ID */ + int replicationHeartbeat; /**< Monitor flag for MySQL replication heartbeat */ + int detectStaleMaster; /**< Monitor flag for MySQL replication Stale Master detection */ + int disableMasterFailback; /**< Monitor flag for Galera Cluster Master failback */ + int availableWhenDonor; /**< Monitor flag for Galera Cluster Donor availability */ + int disableMasterRoleSetting; /**< Monitor flag to disable setting master role */ + bool mysql51_replication; /**< Use MySQL 5.1 replication */ + MONITOR_SERVERS *master; /**< Master server for MySQL Master/Slave replication */ + char* script; /*< Script to call when state changes occur on servers */ + bool events[MAX_MONITOR_EVENT]; /*< enabled events */ } MYSQL_MONITOR; #endif diff --git a/server/modules/monitor/ndbclustermon.h b/server/modules/monitor/ndbclustermon.h index 56b961c45..90798fb87 100644 --- a/server/modules/monitor/ndbclustermon.h +++ b/server/modules/monitor/ndbclustermon.h @@ -17,6 +17,7 @@ * * Copyright MariaDB Corporation Ab 2013-2014 */ + #include #include #include @@ -42,15 +43,16 @@ /** * The handle for an instance of a NDB Cluster Monitor module */ -typedef struct { - SPINLOCK lock; /**< The monitor spinlock */ - pthread_t tid; /**< id of monitor thread */ - int shutdown; /**< Flag to shutdown the monitor thread */ - int status; /**< Monitor status */ - unsigned long id; /**< Monitor ID */ - MONITOR_SERVERS *master; /**< Master server for MySQL Master/Slave replication */ - char* script; /*< Script to call when state changes occur on servers */ - bool events[MAX_MONITOR_EVENT]; /*< enabled events */ +typedef struct +{ + SPINLOCK lock; /**< The monitor spinlock */ + pthread_t tid; /**< id of monitor thread */ + int shutdown; /**< Flag to shutdown the monitor thread */ + int status; /**< Monitor status */ + unsigned long id; /**< Monitor ID */ + MONITOR_SERVERS *master; /**< Master server for MySQL Master/Slave replication */ + char* script; /*< Script to call when state changes occur on servers */ + bool events[MAX_MONITOR_EVENT]; /*< enabled events */ } MYSQL_MONITOR; #endif