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