MySQL 9.1.0
Source Code Documentation
gcs_view_modification_notifier.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef GCS_VIEW_MODIFICATION_NOTIFIER_INCLUDE
25#define GCS_VIEW_MODIFICATION_NOTIFIER_INCLUDE
26
29
30/*
31 @class Plugin_gcs_view_modification_notifier
32
33 This class is used with the purpose of issuing a view changing event
34 and wait for its completion.
35 */
37 public:
40
41 /**
42 Signals that a view modification is about to start
43 */
45
46 /**
47 Checks if there is a view modification ongoing.
48
49 @retval true there is a view modification ongoing
50 @retval false otherwise
51 */
53
54 /**
55 Signals that a view modification has ended
56 */
58
59 /**
60 Signals that a view modification has been cancelled
61
62 @param[in] errnr error that did cause the view modification to
63 be cancelled
64 */
67
68 /**
69 Check if view modification was cancelled.
70 This method must only be called after view modification is complete.
71
72 @retval true view modification was cancelled
73 @retval false otherwise
74 */
75 bool is_cancelled();
76
77 /**
78 Method in which one waits for the view modification to end
79
80 @param[in] timeout how long one wants to wait, in seconds
81
82 @return Operation status
83 @retval false OK
84 @retval true error (timeout or view modification cancelled)
85 */
87
88 /**
89 Get the error number that did happen on view modification.
90 This method must only be called after view modification is complete.
91
92 @return Operation
93 @retval 0 OK (no error)
94 @retval >0 error number
95 */
96 int get_error();
97
98 private:
101 int error;
102
105};
106
107#endif /* GCS_VIEW_MODIFICATION_NOTIFIER_INCLUDE */
Definition: gcs_view_modification_notifier.h:36
Plugin_gcs_view_modification_notifier()
Definition: gcs_view_modification_notifier.cc:33
mysql_mutex_t wait_for_view_mutex
Definition: gcs_view_modification_notifier.h:104
void cancel_view_modification(int errnr=GROUP_REPLICATION_CONFIGURATION_ERROR)
Signals that a view modification has been cancelled.
Definition: gcs_view_modification_notifier.cc:68
mysql_cond_t wait_for_view_cond
Definition: gcs_view_modification_notifier.h:103
int get_error()
Get the error number that did happen on view modification.
Definition: gcs_view_modification_notifier.cc:114
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:83
bool view_changing
Definition: gcs_view_modification_notifier.h:99
void start_view_modification()
Signals that a view modification is about to start.
Definition: gcs_view_modification_notifier.cc:46
virtual ~Plugin_gcs_view_modification_notifier()
Definition: gcs_view_modification_notifier.cc:41
int error
Definition: gcs_view_modification_notifier.h:101
bool is_view_modification_ongoing()
Checks if there is a view modification ongoing.
Definition: gcs_view_modification_notifier.cc:54
bool is_cancelled()
Check if view modification was cancelled.
Definition: gcs_view_modification_notifier.cc:78
bool cancelled_view_change
Definition: gcs_view_modification_notifier.h:100
void end_view_modification()
Signals that a view modification has ended.
Definition: gcs_view_modification_notifier.cc:61
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:498
#define VIEW_MODIFICATION_TIMEOUT
Definition: plugin_constants.h:50
#define GROUP_REPLICATION_CONFIGURATION_ERROR
Definition: plugin_constants.h:37
An instrumented cond structure.
Definition: mysql_cond_bits.h:50
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50