MySQL 8.3.0
Source Code Documentation
gcs_view_modification_notifier.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2023, 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
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef GCS_VIEW_MODIFICATION_NOTIFIER_INCLUDE
24#define GCS_VIEW_MODIFICATION_NOTIFIER_INCLUDE
25
28
29/*
30 @class Plugin_gcs_view_modification_notifier
31
32 This class is used with the purpose of issuing a view changing event
33 and wait for its completion.
34 */
36 public:
39
40 /**
41 Signals that a view modification is about to start
42 */
44
45 /**
46 Checks if there is a view modification ongoing.
47
48 @retval true there is a view modification ongoing
49 @retval false otherwise
50 */
52
53 /**
54 Signals that a view modification has ended
55 */
57
58 /**
59 Signals that a view modification has been cancelled
60
61 @param[in] errnr error that did cause the view modification to
62 be cancelled
63 */
66
67 /**
68 Check if view modification was cancelled.
69 This method must only be called after view modification is complete.
70
71 @retval true view modification was cancelled
72 @retval false otherwise
73 */
74 bool is_cancelled();
75
76 /**
77 Method in which one waits for the view modification to end
78
79 @param[in] timeout how long one wants to wait, in seconds
80
81 @return Operation status
82 @retval false OK
83 @retval true error (timeout or view modification cancelled)
84 */
86
87 /**
88 Get the error number that did happen on view modification.
89 This method must only be called after view modification is complete.
90
91 @return Operation
92 @retval 0 OK (no error)
93 @retval >0 error number
94 */
95 int get_error();
96
97 private:
100 int error;
101
104};
105
106#endif /* GCS_VIEW_MODIFICATION_NOTIFIER_INCLUDE */
Definition: gcs_view_modification_notifier.h:35
Plugin_gcs_view_modification_notifier()
Definition: gcs_view_modification_notifier.cc:32
mysql_mutex_t wait_for_view_mutex
Definition: gcs_view_modification_notifier.h:103
void cancel_view_modification(int errnr=GROUP_REPLICATION_CONFIGURATION_ERROR)
Signals that a view modification has been cancelled.
Definition: gcs_view_modification_notifier.cc:67
mysql_cond_t wait_for_view_cond
Definition: gcs_view_modification_notifier.h:102
int get_error()
Get the error number that did happen on view modification.
Definition: gcs_view_modification_notifier.cc:113
bool wait_for_view_modification(long timeout=VIEW_MODIFICATION_TIMEOUT)
Method in which one waits for the view modification to end.
Definition: gcs_view_modification_notifier.cc:82
bool view_changing
Definition: gcs_view_modification_notifier.h:98
void start_view_modification()
Signals that a view modification is about to start.
Definition: gcs_view_modification_notifier.cc:45
virtual ~Plugin_gcs_view_modification_notifier()
Definition: gcs_view_modification_notifier.cc:40
int error
Definition: gcs_view_modification_notifier.h:100
bool is_view_modification_ongoing()
Checks if there is a view modification ongoing.
Definition: gcs_view_modification_notifier.cc:53
bool is_cancelled()
Check if view modification was cancelled.
Definition: gcs_view_modification_notifier.cc:77
bool cancelled_view_change
Definition: gcs_view_modification_notifier.h:99
void end_view_modification()
Signals that a view modification has ended.
Definition: gcs_view_modification_notifier.cc:60
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:497
#define VIEW_MODIFICATION_TIMEOUT
Definition: plugin_constants.h:49
#define GROUP_REPLICATION_CONFIGURATION_ERROR
Definition: plugin_constants.h:36
An instrumented cond structure.
Definition: mysql_cond_bits.h:49
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49