1 /* Copyright (c) 2017, 2021, Oracle and/or its affiliates.
2 
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License, version 2.0,
5    as published by the Free Software Foundation.
6 
7    This program is also distributed with certain software (including
8    but not limited to OpenSSL) that is licensed under separate terms,
9    as designated in a particular file or component or in included license
10    documentation.  The authors of MySQL hereby grant you an additional
11    permission to link the program and your derivative works with the
12    separately licensed software that they have included with MySQL.
13 
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License, version 2.0, for more details.
18 
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software Foundation,
21    51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
22 
23 #ifndef SINGLE_PRIMARY_CHANNEL_STATE_OBSERVER_INCLUDE
24 #define	SINGLE_PRIMARY_CHANNEL_STATE_OBSERVER_INCLUDE
25 
26 #include "channel_observation_manager.h"
27 
28 class Asynchronous_channels_state_observer : public Channel_state_observer
29 {
30 public:
31   Asynchronous_channels_state_observer();
32 
33   /** Observer for receiver thread starts */
34   int thread_start(Binlog_relay_IO_param *param);
35 
36   /** Observer for receiver thread stops */
37   int thread_stop(Binlog_relay_IO_param *param);
38 
39   /** Observer for applier thread starts */
40   int applier_start(Binlog_relay_IO_param *param);
41 
42   /** Observer for applier thread stops */
43   int applier_stop(Binlog_relay_IO_param *param, bool aborted);
44 
45   /** Observer for when a new transmission from a another server is requested */
46   int before_request_transmit(Binlog_relay_IO_param *param,
47                               uint32 flags);
48 
49   /** Observer for whenever a event is read by the receiver thread*/
50   int after_read_event(Binlog_relay_IO_param *param,
51                        const char *packet, unsigned long len,
52                        const char **event_buf,
53                        unsigned long *event_len);
54 
55   /** Observer for whenever a event is queued by the receiver thread*/
56   int after_queue_event(Binlog_relay_IO_param *param,
57                         const char *event_buf,
58                         unsigned long event_len,
59                         uint32 flags);
60 
61   /** Observer for whenever a reset slave is executed */
62   int after_reset_slave(Binlog_relay_IO_param *param);
63 
64 };
65 
66 #endif /* SINGLE_PRIMARY_CHANNEL_STATE_OBSERVER_INCLUDE */
67