MySQL 8.3.0
Source Code Documentation
table_replication_applier_status_by_coordinator.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2013, 2023, 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_APPLIER_STATUS_BY_COORDINATOR_H
25#define TABLE_REPLICATION_APPLIER_STATUS_BY_COORDINATOR_H
26
27/**
28 @file storage/perfschema/table_replication_applier_status_by_coordinator.h
29 Table replication_applier_status_by_coordinator(declarations).
30*/
31
32#include <sys/types.h>
33
34#include "my_base.h"
35#include "my_inttypes.h"
36#include "sql/rpl_gtid.h"
37#include "sql/rpl_info.h" /*CHANNEL_NAME_LENGTH*/
38#include "sql/rpl_reporting.h"
41
42class Field;
43class Master_info;
44class Plugin_table;
45struct TABLE;
46struct THR_LOCK;
47
48/**
49 @addtogroup performance_schema_tables
50 @{
51*/
52
53#ifndef ENUM_RPL_YES_NO
54#define ENUM_RPL_YES_NO
55/** enum values for Service_State of coordinator thread */
57 PS_RPL_YES = 1, /* Service_State= on */
58 PS_RPL_NO /* Service_State= off */
59};
60#endif
61
62/*
63 A row in coordinator's table. The fields with string values have an
64 additional length field denoted by <field_name>_length.
65*/
87};
88
90 public:
93
95
96 virtual bool match(Master_info *mi) = 0;
97};
98
101 public:
104
106
107 bool match(Master_info *mi) override;
108
109 private:
111};
112
115 public:
118
120
121 bool match(Master_info *mi) override;
122
123 private:
125};
126
127/** Table PERFORMANCE_SCHEMA.replication_applier_status_by_coordinator */
129 : public PFS_engine_table {
131
132 private:
133 int make_row(Master_info *mi);
134
135 /** Table share lock. */
137 /** Table definition. */
139
140 /** Current row */
142 /** Current position. */
144 /** Next position. */
146
147 protected:
148 /**
149 Read the current row values.
150 @param table Table handle
151 @param buf row buffer
152 @param fields Table fields
153 @param read_all true if all columns are read.
154 */
155
156 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
157 bool read_all) override;
158
160
161 public:
163
164 /** Table share. */
167 static ha_rows get_row_count();
168 void reset_position() override;
169
170 int rnd_next() override;
171 int rnd_pos(const void *pos) override;
172
173 int index_init(uint idx, bool sorted) override;
174 int index_next() override;
175
176 private:
178};
179
180/** @} */
181#endif
Definition: field.h:574
Definition: rpl_mi.h:86
Definition: pfs_engine_table.h:299
Definition: pfs_engine_table.h:267
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Definition: table_replication_applier_status_by_coordinator.h:100
bool match(Master_info *mi) override
Definition: table_replication_applier_status_by_coordinator.cc:100
~PFS_index_rpl_applier_status_by_coord_by_channel() override=default
PFS_index_rpl_applier_status_by_coord_by_channel()
Definition: table_replication_applier_status_by_coordinator.h:102
PFS_key_name m_key
Definition: table_replication_applier_status_by_coordinator.h:110
Definition: table_replication_applier_status_by_coordinator.h:114
PFS_key_thread_id m_key
Definition: table_replication_applier_status_by_coordinator.h:124
PFS_index_rpl_applier_status_by_coord_by_thread()
Definition: table_replication_applier_status_by_coordinator.h:116
~PFS_index_rpl_applier_status_by_coord_by_thread() override=default
bool match(Master_info *mi) override
Definition: table_replication_applier_status_by_coordinator.cc:117
Definition: table_replication_applier_status_by_coordinator.h:89
~PFS_index_rpl_applier_status_by_coord() override=default
PFS_index_rpl_applier_status_by_coord(PFS_engine_key *key)
Definition: table_replication_applier_status_by_coordinator.h:91
virtual bool match(Master_info *mi)=0
Definition: table_helper.h:1553
Definition: table_helper.h:1278
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:39
Table PERFORMANCE_SCHEMA.replication_applier_status_by_coordinator.
Definition: table_replication_applier_status_by_coordinator.h:129
PFS_simple_index pos_t
Definition: table_replication_applier_status_by_coordinator.h:130
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_replication_applier_status_by_coordinator.cc:144
st_row_coordinator m_row
Current row.
Definition: table_replication_applier_status_by_coordinator.h:141
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_replication_applier_status_by_coordinator.cc:156
pos_t m_next_pos
Next position.
Definition: table_replication_applier_status_by_coordinator.h:145
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_replication_applier_status_by_coordinator.cc:193
table_replication_applier_status_by_coordinator()
Definition: table_replication_applier_status_by_coordinator.cc:150
static Plugin_table m_table_def
Table definition.
Definition: table_replication_applier_status_by_coordinator.h:138
PFS_index_rpl_applier_status_by_coord * m_opened_index
Definition: table_replication_applier_status_by_coordinator.h:177
int make_row(Master_info *mi)
Definition: table_replication_applier_status_by_coordinator.cc:265
static ha_rows get_row_count()
Definition: table_replication_applier_status_by_coordinator.cc:161
static PFS_engine_table_share m_share
Table share.
Definition: table_replication_applier_status_by_coordinator.h:165
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_replication_applier_status_by_coordinator.cc:338
pos_t m_pos
Current position.
Definition: table_replication_applier_status_by_coordinator.h:143
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_replication_applier_status_by_coordinator.cc:165
int index_next() override
Find key in index, read record.
Definition: table_replication_applier_status_by_coordinator.cc:232
static THR_LOCK m_table_lock
Table share lock.
Definition: table_replication_applier_status_by_coordinator.h:136
int index_init(uint idx, bool sorted) override
Definition: table_replication_applier_status_by_coordinator.cc:212
@ PS_RPL_NO
Definition: table_replication_applier_status_by_coordinator.h:58
@ PS_RPL_YES
Definition: table_replication_applier_status_by_coordinator.h:57
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1140
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
Definition: buf0block_hint.cc:29
Performance schema tables (declarations).
required string key
Definition: replication_asynchronous_connection_failover.proto:59
#define CHANNEL_NAME_LENGTH
Definition: rpl_info.h:40
#define MAX_SLAVE_ERRMSG
Maximum size of an error message from a slave thread.
Definition: rpl_reporting.h:41
static const int MAX_TEXT_LENGTH
The maximal length of the textual representation of a TSID, not including the terminating '\0'.
Definition: rpl_gtid.h:1136
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:357
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:557
Definition: table.h:1403
Definition: thr_lock.h:138
Definition: table_replication_applier_status_by_coordinator.h:66
ulonglong last_processed_trx_end_buffer_timestamp
Definition: table_replication_applier_status_by_coordinator.h:81
ulonglong last_processed_trx_immediate_commit_timestamp
Definition: table_replication_applier_status_by_coordinator.h:79
uint processing_trx_length
Definition: table_replication_applier_status_by_coordinator.h:83
char processing_trx[Gtid::MAX_TEXT_LENGTH+1]
Definition: table_replication_applier_status_by_coordinator.h:82
ulonglong last_error_timestamp
Definition: table_replication_applier_status_by_coordinator.h:75
char last_error_message[MAX_SLAVE_ERRMSG]
Definition: table_replication_applier_status_by_coordinator.h:73
uint last_processed_trx_length
Definition: table_replication_applier_status_by_coordinator.h:77
ulonglong processing_trx_immediate_commit_timestamp
Definition: table_replication_applier_status_by_coordinator.h:85
char channel_name[CHANNEL_NAME_LENGTH]
Definition: table_replication_applier_status_by_coordinator.h:67
ulonglong processing_trx_original_commit_timestamp
Definition: table_replication_applier_status_by_coordinator.h:84
uint last_error_number
Definition: table_replication_applier_status_by_coordinator.h:72
uint last_error_message_length
Definition: table_replication_applier_status_by_coordinator.h:74
bool thread_id_is_null
Definition: table_replication_applier_status_by_coordinator.h:70
ulonglong processing_trx_start_buffer_timestamp
Definition: table_replication_applier_status_by_coordinator.h:86
ulonglong last_processed_trx_original_commit_timestamp
Definition: table_replication_applier_status_by_coordinator.h:78
char last_processed_trx[Gtid::MAX_TEXT_LENGTH+1]
Definition: table_replication_applier_status_by_coordinator.h:76
ulonglong last_processed_trx_start_buffer_timestamp
Definition: table_replication_applier_status_by_coordinator.h:80
uint channel_name_length
Definition: table_replication_applier_status_by_coordinator.h:68
enum_rpl_yes_no service_state
Definition: table_replication_applier_status_by_coordinator.h:71
ulonglong thread_id
Definition: table_replication_applier_status_by_coordinator.h:69
Helpers to implement a performance schema table.
enum_rpl_yes_no
Definition: table_replication_applier_configuration.h:49