#include <rpl_gtid_persist.h>
|
int | compress_in_single_transaction (THD *thd, bool &is_complete) |
| Compress the gtid_executed table, read each row by the PK(sid, gno_start) in increasing order, compress the first consecutive range of gtids within a single transaction. More...
|
|
int | compress_first_consecutive_range (TABLE *table, bool &is_complete) |
| Read each row by the PK(sid, gno_start) in increasing order, compress the first consecutive range of gtids. More...
|
|
int | fill_fields (Field **fields, const char *sid, rpl_gno gno_start, rpl_gno gno_end) |
| Fill a gtid interval into fields of the gtid_executed table. More...
|
|
int | write_row (TABLE *table, const char *sid, rpl_gno gno_start, rpl_gno gno_end) |
| Write a gtid interval into the gtid_executed table. More...
|
|
int | update_row (TABLE *table, const char *sid, rpl_gno gno_start, rpl_gno new_gno_end) |
| Update a gtid interval in the gtid_executed table. More...
|
|
int | delete_all (TABLE *table) |
| Delete all rows in the gtid_executed table. More...
|
|
std::string | encode_gtid_text (TABLE *table) |
| Encode the current row fetched from the table into gtid text. More...
|
|
void | get_gtid_interval (TABLE *table, std::string &sid, rpl_gno &gno_start, rpl_gno &gno_end) |
| Get gtid interval from the the current row of the table. More...
|
|
int | save (TABLE *table, const Gtid_set *gtid_set) |
| Insert the gtid set into table. More...
|
|
Gtid_table_persistor & | operator= (const Gtid_table_persistor &info) |
|
| Gtid_table_persistor (const Gtid_table_persistor &info) |
|
◆ Gtid_table_persistor() [1/2]
Gtid_table_persistor::Gtid_table_persistor |
( |
| ) |
|
|
default |
◆ ~Gtid_table_persistor()
virtual Gtid_table_persistor::~Gtid_table_persistor |
( |
| ) |
|
|
virtualdefault |
◆ Gtid_table_persistor() [2/2]
◆ compress()
int Gtid_table_persistor::compress |
( |
THD * |
thd | ) |
|
Compress the gtid_executed table completely by employing one or more transactions.
- Parameters
-
thd | Thread requesting to compress the table |
- Return values
-
0 | OK |
1 | The table was not found. |
-1 | Error |
◆ compress_first_consecutive_range()
int Gtid_table_persistor::compress_first_consecutive_range |
( |
TABLE * |
table, |
|
|
bool & |
is_complete |
|
) |
| |
|
private |
Read each row by the PK(sid, gno_start) in increasing order, compress the first consecutive range of gtids.
For example, 1 1 2 2 3 3 6 6 7 7 8 8 After the compression, the gtids in the table is compressed as following: 1 3 6 6 7 7 8 8
- Parameters
-
| table | Reference to a table object. |
[out] | is_complete | True if the gtid_executed table is compressd completely. |
- Return values
-
◆ compress_in_single_transaction()
int Gtid_table_persistor::compress_in_single_transaction |
( |
THD * |
thd, |
|
|
bool & |
is_complete |
|
) |
| |
|
private |
Compress the gtid_executed table, read each row by the PK(sid, gno_start) in increasing order, compress the first consecutive range of gtids within a single transaction.
- Parameters
-
| thd | Thread requesting to compress the table |
[out] | is_complete | True if the gtid_executed table is compressd completely. |
- Return values
-
0 | OK |
1 | The table was not found. |
-1 | Error |
◆ delete_all()
int Gtid_table_persistor::delete_all |
( |
TABLE * |
table | ) |
|
|
private |
Delete all rows in the gtid_executed table.
- Parameters
-
table | Reference to a table object. |
- Return values
-
◆ encode_gtid_text()
string Gtid_table_persistor::encode_gtid_text |
( |
TABLE * |
table | ) |
|
|
private |
Encode the current row fetched from the table into gtid text.
- Parameters
-
table | Reference to a table object. |
- Return values
-
Return | the encoded gtid text. |
◆ fetch_gtids()
int Gtid_table_persistor::fetch_gtids |
( |
Gtid_set * |
gtid_set | ) |
|
Fetch gtids from gtid_executed table and store them into gtid_executed set.
- Parameters
-
[out] | gtid_set | store gtids fetched from the gtid_executed table. |
- Return values
-
0 | OK |
1 | The table was not found. |
-1 | Error |
◆ fill_fields()
int Gtid_table_persistor::fill_fields |
( |
Field ** |
fields, |
|
|
const char * |
sid, |
|
|
rpl_gno |
gno_start, |
|
|
rpl_gno |
gno_end |
|
) |
| |
|
private |
Fill a gtid interval into fields of the gtid_executed table.
- Parameters
-
fields | Reference to table fields. |
sid | The source id of the gtid interval. |
gno_start | The first GNO of the gtid interval. |
gno_end | The last GNO of the gtid interval. |
- Return values
-
◆ get_gtid_interval()
void Gtid_table_persistor::get_gtid_interval |
( |
TABLE * |
table, |
|
|
std::string & |
sid, |
|
|
rpl_gno & |
gno_start, |
|
|
rpl_gno & |
gno_end |
|
) |
| |
|
private |
Get gtid interval from the the current row of the table.
- Parameters
-
| table | Reference to a table object. |
[out] | sid | The source id of the gtid interval. |
[out] | gno_start | The first GNO of the gtid interval. |
[out] | gno_end | The last GNO of the gtid interval. |
◆ operator=()
◆ reset()
int Gtid_table_persistor::reset |
( |
THD * |
thd | ) |
|
Delete all rows from the table.
- Parameters
-
thd | Thread requesting to reset the table |
- Return values
-
0 | OK |
1 | The table was not found. |
-1 | Error |
◆ save() [1/3]
int Gtid_table_persistor::save |
( |
const Gtid_set * |
gtid_set, |
|
|
bool |
compress = true |
|
) |
| |
Insert the gtid set into table.
- Parameters
-
gtid_set | contains a set of gtid, which holds the sidno and the gno. |
compress | notify to compress gtid_executed table |
- Return values
-
◆ save() [2/3]
int Gtid_table_persistor::save |
( |
TABLE * |
table, |
|
|
const Gtid_set * |
gtid_set |
|
) |
| |
|
private |
Insert the gtid set into table.
- Parameters
-
table | The gtid_executed table. |
gtid_set | Contains a set of gtid, which holds the sidno and the gno. |
- Return values
-
◆ save() [3/3]
int Gtid_table_persistor::save |
( |
THD * |
thd, |
|
|
const Gtid * |
gtid |
|
) |
| |
Insert the gtid into table.
- Parameters
-
thd | Thread requesting to save gtid into the table |
gtid | holds the sidno and the gno. |
- Return values
-
0 | OK |
1 | The table was not found. |
-1 | Error |
◆ update_row()
int Gtid_table_persistor::update_row |
( |
TABLE * |
table, |
|
|
const char * |
sid, |
|
|
rpl_gno |
gno_start, |
|
|
rpl_gno |
new_gno_end |
|
) |
| |
|
private |
Update a gtid interval in the gtid_executed table.
- locate the gtid interval by primary key (sid, gno_start) to update it with the new_gno_end.
- Parameters
-
table | Reference to a table object. |
sid | The source id of the gtid interval. |
gno_start | The first GNO of the gtid interval. |
new_gno_end | The new last GNO of the gtid interval. |
- Return values
-
◆ warn_or_err_on_explicit_modification()
int Gtid_table_persistor::warn_or_err_on_explicit_modification |
( |
THD * |
thd, |
|
|
Table_ref * |
table |
|
) |
| |
|
inline |
Push a warning to client if user is modifying the gtid_executed table explicitly by a non-XA transaction.
Push an error to client if user is modifying it explicitly by a XA transaction.
- Parameters
-
thd | Thread requesting to access the table |
table | The table is being accessed. |
- Return values
-
0 | No warning or error was pushed to the client. |
1 | Push a warning to client. |
2 | Push an error to client. |
◆ write_row()
int Gtid_table_persistor::write_row |
( |
TABLE * |
table, |
|
|
const char * |
sid, |
|
|
rpl_gno |
gno_start, |
|
|
rpl_gno |
gno_end |
|
) |
| |
|
private |
Write a gtid interval into the gtid_executed table.
- Parameters
-
table | Reference to a table object. |
sid | The source id of the gtid interval. |
gno_start | The first GNO of the gtid interval. |
gno_end | The last GNO of the gtid interval. |
- Return values
-
◆ m_atomic_count
std::atomic<int64> Gtid_table_persistor::m_atomic_count {0} |
|
private |
◆ number_fields
const uint Gtid_table_persistor::number_fields = 3 |
|
static |
The documentation for this class was generated from the following files: