Johan Wikman 81654fb0e7 MXS-1848 Rename monitor types and instance variable
The following type name changes

  MXS_MONITOR_OBJECT   -> MXS_MONITOR_API
  MXS_SPECIFIC_MONITOR -> MXS_MONITOR_INSTANCE

Further, the 'handle' instance variable of what used to be
called MXS_MONITOR_OBJECT has been renamed to 'api'.

An example, what used to look like

   mon->module->stopMonitor(mon->handle);

now looks like

  mon->api->stopMonitor(mon->instance);

which makes it more obvious what is going on.
2018-05-07 14:08:36 +03:00

54 lines
1.7 KiB
C

#pragma once
#ifndef _MMMON_H
#define _MMMON_H
/*
* Copyright (c) 2016 MariaDB Corporation Ab
*
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
*
* Change Date: 2020-01-01
*
* On the date above, in accordance with the Business Source License, use
* of this software will be governed by version 2 or later of the General
* Public License.
*/
#include <maxscale/cdefs.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <maxscale/monitor.h>
#include <maxscale/spinlock.h>
#include <maxscale/thread.h>
#include <mysql.h>
#include <mysqld_error.h>
#include <maxscale/log_manager.h>
#include <maxscale/secrets.h>
#include <maxscale/dcb.h>
#include <maxscale/modinfo.h>
#include <maxscale/config.h>
/**
* @file mmmon.h - The Multi-Master monitor
*/
/**
* The handle for an instance of a Multi-Master Monitor module
*/
struct MM_MONITOR : public MXS_MONITOR_INSTANCE
{
THREAD thread; /**< 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 */
MXS_MONITORED_SERVER *master; /**< Master server for Master/Slave replication */
char* script; /**< Script to call when state changes occur on servers */
uint64_t events; /**< enabled events */
MXS_MONITOR* monitor; /**< Pointer to generic monitor structure */
bool checked; /**< Whether server access has been checked */
};
#endif