1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef DRIZZLED_RPL_REPORTING_H
21
#define DRIZZLED_RPL_REPORTING_H
24
Maximum size of an error message from a slave thread.
26
#define MAX_SLAVE_ERRMSG 1024
29
Mix-in to handle the message logging and reporting for relay log
30
info and master log info structures.
32
By inheriting from this class, the class is imbued with
33
capabilities to do slave reporting.
35
class Slave_reporting_capability
41
@param thread_name Printable name of the slave thread that is reporting.
43
Slave_reporting_capability(char const *thread_name)
44
: m_thread_name(thread_name)
49
Writes a message and, if it's an error message, to Last_Error
50
(which will be displayed by SHOW SLAVE STATUS).
52
@param level The severity level
53
@param err_code The error code
54
@param msg The message (usually related to the error
55
code, but can contain more information), in
58
void report(loglevel level, int err_code, const char *msg, ...) const
59
__attribute__((format(printf, 4, 5)));
62
Clear errors. They will not show up under <code>SHOW SLAVE
70
Error information structure.
73
friend class Slave_reporting_capability;
89
char message[MAX_SLAVE_ERRMSG];
92
Error const& last_error() const { return m_last_error; }
96
Last error produced by the I/O or SQL thread respectively.
98
mutable Error m_last_error;
100
char const *const m_thread_name;
103
#endif /* DRIZZLED_RPL_REPORTING_H */