MySQL
8.4.2
Source Code Documentation
recovery_metadata_joiner_information.h
Go to the documentation of this file.
1
/* Copyright (c) 2023, 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 GR_RECOVERY_METADATA_JOINER_INCLUDE
25
#define GR_RECOVERY_METADATA_JOINER_INCLUDE
26
27
#include <string>
28
#include <vector>
29
30
#include "
plugin/group_replication/include/gcs_operations.h
"
31
32
class
Recovery_metadata_joiner_information
{
33
public
:
34
/**
35
Constructor
36
*/
37
Recovery_metadata_joiner_information
(
const
std::string &view_id)
38
:
m_joiner_view_id
(view_id) {}
39
40
/**
41
Destructor
42
*/
43
virtual
~Recovery_metadata_joiner_information
() {}
44
45
/**
46
Is the member joiner and waiting for the recovery metadata.
47
48
@return the send status
49
@retval true Member is joiner and waiting for recovery metadata.
50
@retval false Member is not joiner.
51
*/
52
bool
is_member_waiting_on_metadata
();
53
54
/**
55
Does the metadata belongs to the joiners for which it was waiting?
56
57
@param view_id The view ID of which metadata has to be compared
58
59
@return the send status
60
@retval true View-ID matches with the metadata in which joiner joined
61
@retval false View-ID does not match with the metadata in which joiner
62
joined
63
*/
64
bool
is_joiner_recovery_metadata
(
const
std::string &view_id);
65
66
/**
67
Is there any member in the group that has the recovery metadata for the
68
joiner?
69
70
@return the send status
71
@retval true Atleast 1 server in the group has recovery metadata for the
72
joiner.
73
@retval false No server in the group has recovery metadata for the
74
joiner.
75
*/
76
bool
is_valid_sender_list_empty
();
77
78
/**
79
Saves the GCS Member ID of the metadata senders i.e. members that were
80
ONLINE when the join request was received. This members will save the
81
recovery metadata till the joiner receives it.
82
83
@param valid_senders GCS Member ID of the member having recovery
84
metadata
85
*/
86
void
set_valid_sender_list_of_joiner
(
87
const
std::vector<Gcs_member_identifier> &valid_senders);
88
89
/**
90
Delete the members that have left the group from the stored GCS Member ID of
91
the valid sender list.
92
93
@param member_left GCS Member ID of the member left the group.
94
*/
95
void
delete_leaving_members_from_sender
(
96
std::vector<Gcs_member_identifier> member_left);
97
98
private
:
99
/** Stores valid recovery metadata senders for joiner. */
100
std::vector<Gcs_member_identifier>
m_valid_senders_for_joiner
;
101
102
/** View ID on which joiner joined */
103
const
std::string
m_joiner_view_id
;
104
};
105
106
#endif
/* GR_RECOVERY_METADATA_JOINER_INCLUDE */
Recovery_metadata_joiner_information
Definition:
recovery_metadata_joiner_information.h:32
Recovery_metadata_joiner_information::delete_leaving_members_from_sender
void delete_leaving_members_from_sender(std::vector< Gcs_member_identifier > member_left)
Delete the members that have left the group from the stored GCS Member ID of the valid sender list.
Definition:
recovery_metadata_joiner_information.cc:45
Recovery_metadata_joiner_information::is_valid_sender_list_empty
bool is_valid_sender_list_empty()
Is there any member in the group that has the recovery metadata for the joiner?
Definition:
recovery_metadata_joiner_information.cc:35
Recovery_metadata_joiner_information::~Recovery_metadata_joiner_information
virtual ~Recovery_metadata_joiner_information()
Destructor.
Definition:
recovery_metadata_joiner_information.h:43
Recovery_metadata_joiner_information::is_member_waiting_on_metadata
bool is_member_waiting_on_metadata()
Is the member joiner and waiting for the recovery metadata.
Definition:
recovery_metadata_joiner_information.cc:26
Recovery_metadata_joiner_information::m_joiner_view_id
const std::string m_joiner_view_id
View ID on which joiner joined.
Definition:
recovery_metadata_joiner_information.h:103
Recovery_metadata_joiner_information::is_joiner_recovery_metadata
bool is_joiner_recovery_metadata(const std::string &view_id)
Does the metadata belongs to the joiners for which it was waiting?
Definition:
recovery_metadata_joiner_information.cc:30
Recovery_metadata_joiner_information::m_valid_senders_for_joiner
std::vector< Gcs_member_identifier > m_valid_senders_for_joiner
Stores valid recovery metadata senders for joiner.
Definition:
recovery_metadata_joiner_information.h:100
Recovery_metadata_joiner_information::set_valid_sender_list_of_joiner
void set_valid_sender_list_of_joiner(const std::vector< Gcs_member_identifier > &valid_senders)
Saves the GCS Member ID of the metadata senders i.e.
Definition:
recovery_metadata_joiner_information.cc:39
Recovery_metadata_joiner_information::Recovery_metadata_joiner_information
Recovery_metadata_joiner_information(const std::string &view_id)
Constructor.
Definition:
recovery_metadata_joiner_information.h:37
gcs_operations.h
plugin
group_replication
include
plugin_handlers
recovery_metadata_joiner_information.h
Generated by
1.9.2