MySQL 8.0.39
Source Code Documentation
group_replication_status_service.h
Go to the documentation of this file.
1/* Copyright (c) 2021, 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 GROUP_REPLICATION_STATUS_SERVICE_H
25#define GROUP_REPLICATION_STATUS_SERVICE_H
26
28#include <stddef.h>
29
30/**
31 @ingroup group_components_services_inventory
32
33 A service to get the status of a member of Group Replication.
34
35 This is only available if the component is on a server with Group
36 Replication plugin installed.
37
38 @code
39 SERVICE_TYPE(registry) *plugin_registry = mysql_plugin_registry_acquire();
40 my_service<SERVICE_TYPE(group_replication_status_service_v1)> svc(
41 "group_replication_status_service_v1", plugin_registry);
42
43 if (svc.is_valid()) {
44 bool error = svc->...
45 }
46 @endcode
47*/
48BEGIN_SERVICE_DEFINITION(group_replication_status_service_v1)
49
50/**
51 Checks if this member is part of a group in single-primary mode.
52
53 @return status
54 @retval true this member is part of a group in single-primary mode
55 @retval false otherwise (including case where member is even not running
56 Group Replication)
57*/
58DECLARE_BOOL_METHOD(is_group_in_single_primary_mode, ());
59
60/**
61 Checks if this member is part of a group in single-primary mode and if
62 this member is the primary.
63
64 @return status
65 @retval true this member is part of a group in single-primary mode
66 and is the primary
67 @retval false otherwise
68*/
69DECLARE_BOOL_METHOD(is_group_in_single_primary_mode_and_im_the_primary, ());
70
71/**
72 Checks if this member is part of a group in single-primary mode and if
73 this member is a secondary.
74
75 @return status
76 @retval true this member is part of a group in single-primary mode
77 and is a secondary
78 @retval false otherwise
79*/
80DECLARE_BOOL_METHOD(is_group_in_single_primary_mode_and_im_a_secondary, ());
81
82/**
83 Checks if this member is ONLINE and part of the group majority.
84
85 @return status
86 @retval true this member is ONLINE and part of the group majority
87 @retval false otherwise
88*/
89DECLARE_BOOL_METHOD(is_member_online_with_group_majority, ());
90
91END_SERVICE_DEFINITION(group_replication_status_service_v1)
92
93#endif /* GROUP_REPLICATION_STATUS_SERVICE_H */
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:112