MySQL 8.0.29
Source Code Documentation
table_rpl_async_connection_failover_managed.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2020, 2022, 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 also distributed 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 included with MySQL.
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 TABLE_RPL_ASYNC_CONNECTION_FAILOVER_MANAGED_H
25#define TABLE_RPL_ASYNC_CONNECTION_FAILOVER_MANAGED_H
26
27/**
28 @file storage/perfschema/table_rpl_async_connection_failover_managed.h
29 Table replication_asynchronous_connection_failover_managed (declarations).
30*/
31
32#include <sys/types.h>
33
34#include "my_base.h"
35#include "my_io.h"
36#include "mysql_com.h"
37#include "sql/json_dom.h"
39#include "sql/rpl_info.h" /* CHANNEL_NAME_LENGTH*/
42
43class Field;
44class Master_info;
45class Plugin_table;
46struct TABLE;
47struct THR_LOCK;
48
49/**
50 @addtogroup performance_schema_tables
51 @{
52*/
53
54/**
55 A row in the table. The fields with string values have an additional
56 length field denoted by <field_name>_length.
57*/
66};
67
68/**
69 Table
70 PERFORMANCE_SCHEMA.TABLE_RPL_ASYNC_CONNECTION_FAILOVER_MANAGED.
71*/
73 /** Position of a cursor, for simple iterations. */
75
76 private:
77 /**
78 Stores current row (i.e.index) values for the table into m_row struct
79 members. This stored data is read later through read_row_values().
80
81 @param[in] index current row position.
82
83 @return Operation status
84 @retval 0 Success
85 @retval != 0 Error (error code returned)
86 */
87 int make_row(uint index);
88
89 /** Table share lock. */
91
92 /** Table definition. */
94
95 /** Current row */
97
98 /** Current position. */
100
101 /** Next position. */
103
104 protected:
105 /**
106 Read the current row values.
107
108 @param[in] table Table handle
109 @param[in] buf row buffer
110 @param[in] fields Table fields
111 @param[in] read_all true if all columns are read.
112
113 @return Operation status
114 @retval 0 Success
115 @retval != 0 Error (error code returned)
116 */
117 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
118 bool read_all) override;
119
121
122 public:
124
125 /** Table share. */
127
128 /**
129 Open table function.
130
131 @param[in] tbs Table share object
132 */
134
135 /**
136 Get the current number of rows read.
137
138 @return number of rows read.
139 */
140 static ha_rows get_row_count();
141
142 /** Reset the cursor position to the beginning of the table. */
143 void reset_position(void) override;
144
145 /**
146 Initialize table for random read or scan.
147
148 @param[in] scan if true: Initialize for random scans through rnd_next()
149 if false: Initialize for random reads through rnd_pos()
150
151 @return Operation status
152 @retval 0 Success
153 @retval != 0 Error (error code returned)
154 */
155 int rnd_init(bool scan) override;
156
157 /**
158 Read next row via random scan.
159
160 @return Operation status
161 @retval 0 Success
162 @retval != 0 Error (error code returned)
163 */
164 int rnd_next() override;
165
166 /**
167 Read row via random scan from position.
168
169 @param[in] pos Position from position() call
170
171 @return Operation status
172 @retval 0 Success
173 @retval != 0 Error (error code returned)
174 */
175 int rnd_pos(const void *pos) override;
176
177 private:
178 /* Stores the data being read i.e. source connection details. */
179 std::vector<RPL_FAILOVER_MANAGED_JSON_TUPLE> m_source_managed_list{};
180
181 /* Stores the current number of rows read. */
183};
184
185/** @} */
186#endif
Definition: field.h:573
Abstraction for accessing JSON values irrespective of whether they are (started out as) binary JSON v...
Definition: json_dom.h:1167
Definition: rpl_mi.h:86
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:39
Table PERFORMANCE_SCHEMA.TABLE_RPL_ASYNC_CONNECTION_FAILOVER_MANAGED.
Definition: table_rpl_async_connection_failover_managed.h:72
std::vector< RPL_FAILOVER_MANAGED_JSON_TUPLE > m_source_managed_list
Definition: table_rpl_async_connection_failover_managed.h:179
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:189
static ha_rows num_rows
Definition: table_rpl_async_connection_failover_managed.h:182
void reset_position(void) override
Reset the cursor position to the beginning of the table.
Definition: table_rpl_async_connection_failover_managed.cc:105
int rnd_pos(const void *pos) override
Read row via random scan from position.
Definition: table_rpl_async_connection_failover_managed.cc:177
static PFS_engine_table * create(PFS_engine_table_share *tbs)
Open table function.
Definition: table_rpl_async_connection_failover_managed.cc:93
table_rpl_async_connection_failover_managed()
Definition: table_rpl_async_connection_failover_managed.cc:99
int rnd_init(bool scan) override
Initialize table for random read or scan.
Definition: table_rpl_async_connection_failover_managed.cc:118
int rnd_next() override
Read next row via random scan.
Definition: table_rpl_async_connection_failover_managed.cc:165
pos_t m_next_pos
Next position.
Definition: table_rpl_async_connection_failover_managed.h:102
static PFS_engine_table_share m_share
Table share.
Definition: table_rpl_async_connection_failover_managed.h:126
static ha_rows get_row_count()
Get the current number of rows read.
Definition: table_rpl_async_connection_failover_managed.cc:113
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:223
PFS_simple_index pos_t
Position of a cursor, for simple iterations.
Definition: table_rpl_async_connection_failover_managed.h:74
pos_t m_pos
Current position.
Definition: table_rpl_async_connection_failover_managed.h:99
static Plugin_table m_table_def
Table definition.
Definition: table_rpl_async_connection_failover_managed.h:93
static THR_LOCK m_table_lock
Table share lock.
Definition: table_rpl_async_connection_failover_managed.h:90
st_row_rpl_async_conn_failover_managed m_row
Current row.
Definition: table_rpl_async_connection_failover_managed.h:96
char * pos
Definition: do_ctype.cc:76
JSON DOM.
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1139
static constexpr int HOSTNAME_LENGTH
Definition: my_hostname.h:42
Common #defines and includes for file and socket I/O.
Common definition between mysql server & client.
Definition: buf0block_hint.cc:29
Performance schema tables (declarations).
#define CHANNEL_NAME_LENGTH
Definition: rpl_info.h:40
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:357
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:558
Definition: table.h:1394
Definition: thr_lock.h:138
A row in the table.
Definition: table_rpl_async_connection_failover_managed.h:58
char channel_name[CHANNEL_NAME_LENGTH]
Definition: table_rpl_async_connection_failover_managed.h:59
char managed_name[HOSTNAME_LENGTH]
Definition: table_rpl_async_connection_failover_managed.h:61
uint managed_name_length
Definition: table_rpl_async_connection_failover_managed.h:62
uint managed_type_length
Definition: table_rpl_async_connection_failover_managed.h:64
uint channel_name_length
Definition: table_rpl_async_connection_failover_managed.h:60
char managed_type[HOSTNAME_LENGTH]
Definition: table_rpl_async_connection_failover_managed.h:63
Json_wrapper configuration
Definition: table_rpl_async_connection_failover_managed.h:65
Helpers to implement a performance schema table.
unsigned int uint
Definition: uca-dump.cc:29