MySQL 8.4.2
Source Code Documentation
table_rpl_async_connection_failover_managed.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2020, 2024, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License, version 2.0, for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
24
25#ifndef TABLE_RPL_ASYNC_CONNECTION_FAILOVER_MANAGED_H
26#define TABLE_RPL_ASYNC_CONNECTION_FAILOVER_MANAGED_H
27
28/**
29 @file storage/perfschema/table_rpl_async_connection_failover_managed.h
30 Table replication_asynchronous_connection_failover_managed (declarations).
31*/
32
33#include <sys/types.h>
34
35#include "my_base.h"
36#include "my_io.h"
37#include "mysql_com.h"
38#include "sql-common/json_dom.h"
40#include "sql/rpl_info.h" /* CHANNEL_NAME_LENGTH*/
43
44class Field;
45class Master_info;
46class Plugin_table;
47struct TABLE;
48struct THR_LOCK;
49
50/**
51 @addtogroup performance_schema_tables
52 @{
53*/
54
55/**
56 A row in the table. The fields with string values have an additional
57 length field denoted by <field_name>_length.
58*/
67};
68
69/**
70 Table
71 PERFORMANCE_SCHEMA.TABLE_RPL_ASYNC_CONNECTION_FAILOVER_MANAGED.
72*/
74 /** Position of a cursor, for simple iterations. */
76
77 private:
78 /**
79 Stores current row (i.e.index) values for the table into m_row struct
80 members. This stored data is read later through read_row_values().
81
82 @param[in] index current row position.
83
84 @return Operation status
85 @retval 0 Success
86 @retval != 0 Error (error code returned)
87 */
88 int make_row(uint index);
89
90 /** Table share lock. */
92
93 /** Table definition. */
95
96 /** Current row */
98
99 /** Current position. */
101
102 /** Next position. */
104
105 protected:
106 /**
107 Read the current row values.
108
109 @param[in] table Table handle
110 @param[in] buf row buffer
111 @param[in] fields Table fields
112 @param[in] read_all true if all columns are read.
113
114 @return Operation status
115 @retval 0 Success
116 @retval != 0 Error (error code returned)
117 */
118 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
119 bool read_all) override;
120
122
123 public:
125
126 /** Table share. */
128
129 /**
130 Open table function.
131
132 @param[in] tbs Table share object
133 */
135
136 /**
137 Get the current number of rows read.
138
139 @return number of rows read.
140 */
141 static ha_rows get_row_count();
142
143 /** Reset the cursor position to the beginning of the table. */
144 void reset_position() override;
145
146 /**
147 Initialize table for random read or scan.
148
149 @param[in] scan if true: Initialize for random scans through rnd_next()
150 if false: Initialize for random reads through rnd_pos()
151
152 @return Operation status
153 @retval 0 Success
154 @retval != 0 Error (error code returned)
155 */
156 int rnd_init(bool scan) override;
157
158 /**
159 Read next row via random scan.
160
161 @return Operation status
162 @retval 0 Success
163 @retval != 0 Error (error code returned)
164 */
165 int rnd_next() override;
166
167 /**
168 Read row via random scan from position.
169
170 @param[in] pos Position from position() call
171
172 @return Operation status
173 @retval 0 Success
174 @retval != 0 Error (error code returned)
175 */
176 int rnd_pos(const void *pos) override;
177
178 private:
179 /* Stores the data being read i.e. source connection details. */
180 std::vector<RPL_FAILOVER_MANAGED_JSON_TUPLE> m_source_managed_list{};
181
182 /* Stores the current number of rows read. */
184};
185
186/** @} */
187#endif
Definition: field.h:575
Abstraction for accessing JSON values irrespective of whether they are (started out as) binary JSON v...
Definition: json_dom.h:1153
Definition: rpl_mi.h:87
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
Table PERFORMANCE_SCHEMA.TABLE_RPL_ASYNC_CONNECTION_FAILOVER_MANAGED.
Definition: table_rpl_async_connection_failover_managed.h:73
std::vector< RPL_FAILOVER_MANAGED_JSON_TUPLE > m_source_managed_list
Definition: table_rpl_async_connection_failover_managed.h:180
int make_row(uint index)
Stores current row (i.e.index) values for the table into m_row struct members.
Definition: table_rpl_async_connection_failover_managed.cc:194
static ha_rows num_rows
Definition: table_rpl_async_connection_failover_managed.h:183
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_rpl_async_connection_failover_managed.cc:108
int rnd_pos(const void *pos) override
Read row via random scan from position.
Definition: table_rpl_async_connection_failover_managed.cc:182
static PFS_engine_table * create(PFS_engine_table_share *tbs)
Open table function.
Definition: table_rpl_async_connection_failover_managed.cc:96
table_rpl_async_connection_failover_managed()
Definition: table_rpl_async_connection_failover_managed.cc:102
int rnd_init(bool scan) override
Initialize table for random read or scan.
Definition: table_rpl_async_connection_failover_managed.cc:121
int rnd_next() override
Read next row via random scan.
Definition: table_rpl_async_connection_failover_managed.cc:170
pos_t m_next_pos
Next position.
Definition: table_rpl_async_connection_failover_managed.h:103
static PFS_engine_table_share m_share
Table share.
Definition: table_rpl_async_connection_failover_managed.h:127
static ha_rows get_row_count()
Get the current number of rows read.
Definition: table_rpl_async_connection_failover_managed.cc:116
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_rpl_async_connection_failover_managed.cc:227
PFS_simple_index pos_t
Position of a cursor, for simple iterations.
Definition: table_rpl_async_connection_failover_managed.h:75
pos_t m_pos
Current position.
Definition: table_rpl_async_connection_failover_managed.h:100
static Plugin_table m_table_def
Table definition.
Definition: table_rpl_async_connection_failover_managed.h:94
static THR_LOCK m_table_lock
Table share lock.
Definition: table_rpl_async_connection_failover_managed.h:91
st_row_rpl_async_conn_failover_managed m_row
Current row.
Definition: table_rpl_async_connection_failover_managed.h:97
JSON DOM.
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1141
static constexpr int HOSTNAME_LENGTH
Definition: my_hostname.h:43
Common #defines and includes for file and socket I/O.
Common definition between mysql server & client.
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
Performance schema tables (declarations).
#define CHANNEL_NAME_LENGTH
Definition: rpl_info.h:41
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:358
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:566
Definition: table.h:1406
Definition: thr_lock.h:139
A row in the table.
Definition: table_rpl_async_connection_failover_managed.h:59
char channel_name[CHANNEL_NAME_LENGTH]
Definition: table_rpl_async_connection_failover_managed.h:60
char managed_name[HOSTNAME_LENGTH]
Definition: table_rpl_async_connection_failover_managed.h:62
uint managed_name_length
Definition: table_rpl_async_connection_failover_managed.h:63
uint managed_type_length
Definition: table_rpl_async_connection_failover_managed.h:65
uint channel_name_length
Definition: table_rpl_async_connection_failover_managed.h:61
char managed_type[HOSTNAME_LENGTH]
Definition: table_rpl_async_connection_failover_managed.h:64
Json_wrapper configuration
Definition: table_rpl_async_connection_failover_managed.h:66
Helpers to implement a performance schema table.