MySQL 8.4.2
Source Code Documentation
table_replication_asynchronous_connection_failover.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_REPLICATION_ASYNCHRONOUS_CONNECTION_FAILOVER_H
26#define TABLE_REPLICATION_ASYNCHRONOUS_CONNECTION_FAILOVER_H
27
28/**
29 @file storage/perfschema/table_replication_asynchronous_connection_failover.h
30 Table replication_asynchronous_connection_failover (declarations).
31*/
32
33#include <sys/types.h>
34
35#include "compression.h" // COMPRESSION_ALGORITHM_NAME_BUFFER_SIZE
36#include "my_base.h"
37#include "my_io.h"
38#include "mysql_com.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*/
64 long port;
67 uint weight;
70};
71
72/**
73 Table
74 PERFORMANCE_SCHEMA.TABLE_REPLICATION_ASYNCHRONOUS_CONNECTION_FAILOVER.
75*/
77 : public PFS_engine_table {
78 /** Position of a cursor, for simple iterations. */
80
81 private:
82 /**
83 Stores current row (i.e.index) values for the table into m_row struct
84 members. This stored data is read later through read_row_values().
85
86 @param[in] index current row position.
87
88 @return Operation status
89 @retval 0 Success
90 @retval != 0 Error (error code returned)
91 */
92 int make_row(uint index);
93
94 /** Table share lock. */
96
97 /** Table definition. */
99
100 /** Current row */
102
103 /** Current position. */
105
106 /** Next position. */
108
109 protected:
110 /**
111 Read the current row values.
112
113 @param[in] table Table handle
114 @param[in] buf row buffer
115 @param[in] fields Table fields
116 @param[in] read_all true if all columns are read.
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. */
181
182 /* Stores the current number of rows read. */
184};
185
186/** @} */
187#endif
Definition: field.h:575
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_REPLICATION_ASYNCHRONOUS_CONNECTION_FAILOVER.
Definition: table_replication_asynchronous_connection_failover.h:77
pos_t m_pos
Current position.
Definition: table_replication_asynchronous_connection_failover.h:104
static ha_rows num_rows
Definition: table_replication_asynchronous_connection_failover.h:183
PFS_simple_index pos_t
Position of a cursor, for simple iterations.
Definition: table_replication_asynchronous_connection_failover.h:79
RPL_FAILOVER_SOURCE_LIST m_source_conn_detail
Definition: table_replication_asynchronous_connection_failover.h:180
static THR_LOCK m_table_lock
Table share lock.
Definition: table_replication_asynchronous_connection_failover.h:95
int rnd_init(bool scan) override
Initialize table for random read or scan.
Definition: table_replication_asynchronous_connection_failover.cc:125
static PFS_engine_table_share m_share
Table share.
Definition: table_replication_asynchronous_connection_failover.h:127
int rnd_pos(const void *pos) override
Read row via random scan from position.
Definition: table_replication_asynchronous_connection_failover.cc:154
static Plugin_table m_table_def
Table definition.
Definition: table_replication_asynchronous_connection_failover.h:98
int make_row(uint index)
Stores current row (i.e.index) values for the table into m_row struct members.
Definition: table_replication_asynchronous_connection_failover.cc:167
static ha_rows get_row_count()
Get the current number of rows read.
Definition: table_replication_asynchronous_connection_failover.cc:120
int rnd_next() override
Read next row via random scan.
Definition: table_replication_asynchronous_connection_failover.cc:142
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_replication_asynchronous_connection_failover.cc:219
static PFS_engine_table * create(PFS_engine_table_share *tbs)
Open table function.
Definition: table_replication_asynchronous_connection_failover.cc:100
table_replication_asynchronous_connection_failover()
Definition: table_replication_asynchronous_connection_failover.cc:106
pos_t m_next_pos
Next position.
Definition: table_replication_asynchronous_connection_failover.h:107
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_replication_asynchronous_connection_failover.cc:112
st_row_rpl_async_conn_failover m_row
Current row.
Definition: table_replication_asynchronous_connection_failover.h:101
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.
#define NAME_LEN
Definition: mysql_com.h:67
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
Performance schema tables (declarations).
std::vector< RPL_FAILOVER_SOURCE_TUPLE > RPL_FAILOVER_SOURCE_LIST
Definition: rpl_async_conn_failover_table_operations.h:53
#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_replication_asynchronous_connection_failover.h:59
char managed_name[HOSTNAME_LENGTH]
Definition: table_replication_asynchronous_connection_failover.h:68
uint weight
Definition: table_replication_asynchronous_connection_failover.h:67
char network_namespace[NAME_LEN]
Definition: table_replication_asynchronous_connection_failover.h:65
char channel_name[CHANNEL_NAME_LENGTH]
Definition: table_replication_asynchronous_connection_failover.h:60
uint host_length
Definition: table_replication_asynchronous_connection_failover.h:63
uint channel_name_length
Definition: table_replication_asynchronous_connection_failover.h:61
long port
Definition: table_replication_asynchronous_connection_failover.h:64
uint network_namespace_length
Definition: table_replication_asynchronous_connection_failover.h:66
uint managed_name_length
Definition: table_replication_asynchronous_connection_failover.h:69
char host[HOSTNAME_LENGTH]
Definition: table_replication_asynchronous_connection_failover.h:62
Helpers to implement a performance schema table.