24#ifndef RPL_ASYNC_CONN_FAILOVER_TABLE_OPERATIONS_H
25#define RPL_ASYNC_CONN_FAILOVER_TABLE_OPERATIONS_H
37class SourceAndManagedList;
42 std::tuple<std::string, std::string, uint, std::string, uint, std::string>;
46 std::tuple<std::string, std::string, std::string, Json_wrapper>;
50 std::tuple<std::string, std::string, std::string, uint, uint>;
156 uint secondary_weight);
254 std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
276 std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
295 std::string channel_name, std::vector<RPL_FAILOVER_MANAGED_TUPLE> &rows);
313 static std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
330 std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
346 std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
365 std::vector<RPL_FAILOVER_MANAGED_JSON_TUPLE> &rows);
383 std::vector<RPL_FAILOVER_MANAGED_TUPLE> &rows);
417 const std::string
m_db{
"mysql"};
420 "replication_asynchronous_connection_failover"};
424 "replication_asynchronous_connection_failover_managed"};
452 const std::vector<uint> &field_index,
453 const std::vector<std::string> &field_name,
const T &field_value,
493 enum thr_lock_type lock_type,
const std::vector<uint> &field_index,
494 const std::vector<std::string> &field_name,
const T &field_value,
Abstraction for accessing JSON values irrespective of whether they are (started out as) binary JSON v...
Definition: json_dom.h:1161
Definition: rpl_async_conn_failover_table_operations.h:60
static bool read_managed_random_rows_internal(Rpl_sys_table_access &table_op, std::vector< RPL_FAILOVER_MANAGED_JSON_TUPLE > &rows)
Read rows and fields from replication_asynchronous_connection_failover_managed table and returns its ...
Definition: rpl_async_conn_failover_table_operations.cc:498
enum thr_lock_type m_lock_type
Definition: rpl_async_conn_failover_table_operations.h:416
bool read_managed_random_rows(std::vector< RPL_FAILOVER_MANAGED_TUPLE > &rows)
Read rows and fields from replication_asynchronous_connection_failover_managed table and returns its ...
Definition: rpl_async_conn_failover_table_operations.cc:518
std::tuple< bool, std::vector< RPL_FAILOVER_SOURCE_TUPLE > > read_source_rows_for_channel_and_managed_name(std::string channel_name, std::string managed_name)
Real all sources for a channel and a managed name.
Definition: rpl_async_conn_failover_table_operations.cc:357
static const MYSQL_LEX_CSTRING Primary_weight_key
Definition: rpl_async_conn_failover_table_operations.h:410
static std::tuple< bool, std::string > execute_handler_func_skip_send(const std::vector< uint > &field_index, const std::vector< std::string > &field_name, const T &field_value, std::function< void(Rpl_sys_table_access &, bool &, std::string &, uint &, key_part_map &)> func, uint table_index, key_part_map keypart_map, Rpl_sys_table_access &table_op)
A wrapper template function to save/delete data to given table.
Definition: rpl_async_conn_failover_table_operations.cc:548
std::tuple< bool, std::string > delete_source(const std::string &channel, const std::string &host, uint port, const std::string &network_namespace)
Delete row for a unmanaged sender on replication_asynchronous_connection_failover table.
Definition: rpl_async_conn_failover_table_operations.cc:197
const uint m_table_failover_num_field
Definition: rpl_async_conn_failover_table_operations.h:421
bool read_managed_rows_for_channel(std::string channel_name, std::vector< RPL_FAILOVER_MANAGED_TUPLE > &rows)
Read rows and fields from replication_asynchronous_connection_failover_managed table and returns its ...
Definition: rpl_async_conn_failover_table_operations.cc:275
static std::tuple< bool, std::string > execute_handler_func_send(const std::string &db_name, const std::string &table_name, uint num_field, enum thr_lock_type lock_type, const std::vector< uint > &field_index, const std::vector< std::string > &field_name, const T &field_value, std::function< void(Rpl_sys_table_access &, bool &, std::string &, uint &, key_part_map &)> func, uint table_index, key_part_map keypart_map)
A wrapper template function to save/delete data to given table, and send stored table data to its gro...
Definition: rpl_async_conn_failover_table_operations.cc:588
Rpl_async_conn_failover_table_operations(enum thr_lock_type lock_type=TL_WRITE)
Construction.
Definition: rpl_async_conn_failover_table_operations.h:67
static std::tuple< bool, std::vector< RPL_FAILOVER_SOURCE_TUPLE > > read_source_all_rows_internal(Rpl_sys_table_access &table_op)
Read all sources.
Definition: rpl_async_conn_failover_table_operations.cc:396
const std::string m_table_failover
Definition: rpl_async_conn_failover_table_operations.h:419
std::tuple< bool, std::vector< RPL_FAILOVER_SOURCE_TUPLE > > read_source_random_rows()
Get all sources using random scan (ha_rnd_next) to fetch all the rows.
Definition: rpl_async_conn_failover_table_operations.cc:434
bool reset()
Delete all rows on replication_asynchronous_connection_failover_managed and replication_asynchronous_...
Definition: rpl_async_conn_failover_table_operations.cc:247
const std::string m_db
Definition: rpl_async_conn_failover_table_operations.h:417
static void get_data(Rpl_sys_table_access &table_op, TUP &rows)
Get stored data in table.
Definition: rpl_async_conn_failover_table_operations.cc:536
std::tuple< bool, std::vector< RPL_FAILOVER_SOURCE_TUPLE > > read_source_rows_for_channel(std::string channel_name)
Read all sources for a channel.
Definition: rpl_async_conn_failover_table_operations.cc:323
std::tuple< bool, std::string > add_managed(const std::string &channel, const std::string &host, uint port, const std::string &network_namespace, const std::string &managed_type, const std::string &managed_name, uint primary_weight, uint secondary_weight)
Insert row on replication_asynchronous_connection_failover_managed and replication_asynchronous_conne...
Definition: rpl_async_conn_failover_table_operations.cc:103
std::tuple< bool, std::string > add_source(const std::string &channel, const std::string &host, uint port, const std::string &network_namespace, uint weight, const std::string &managed_name)
Insert row for a unmanaged sender on replication_asynchronous_connection_failover table,...
Definition: rpl_async_conn_failover_table_operations.cc:62
static const MYSQL_LEX_CSTRING Secondary_weight_key
Definition: rpl_async_conn_failover_table_operations.h:413
std::tuple< bool, std::vector< RPL_FAILOVER_SOURCE_TUPLE > > read_source_all_rows()
Read all sources.
Definition: rpl_async_conn_failover_table_operations.cc:417
std::tuple< bool, std::string > delete_managed(const std::string &channel, const std::string &managed_name)
Delete row on replication_asynchronous_connection_failover_managed table and all its sources on repli...
Definition: rpl_async_conn_failover_table_operations.cc:216
static std::tuple< bool, std::string > add_source_skip_send(const std::string &channel, const std::string &host, uint port, const std::string &network_namespace, uint weight, const std::string &managed_name, Rpl_sys_table_access &table_op)
Insert row for a unmanaged sender on replication_asynchronous_connection_failover table.
Definition: rpl_async_conn_failover_table_operations.cc:83
const uint m_table_managed_num_field
Definition: rpl_async_conn_failover_table_operations.h:425
static std::tuple< bool, std::string > add_managed_skip_send(const std::string &channel, const std::string &managed_type, const std::string &managed_name, const Json_wrapper &wrapper, Rpl_sys_table_access &table_op)
Insert row on replication_asynchronous_connection_failover_managed table.
Definition: rpl_async_conn_failover_table_operations.cc:170
virtual ~Rpl_async_conn_failover_table_operations()=default
const std::string m_table_managed
Definition: rpl_async_conn_failover_table_operations.h:423
The class are wrappers for handler index and random scan functions to simplify their usage.
Definition: rpl_sys_table_access.h:43
ulong key_part_map
Definition: my_base.h:1007
const char * host
Definition: mysqladmin.cc:59
Definition: rpl_async_conn_failover_table_operations.h:36
const char * table_name
Definition: rules_table_service.cc:56
const char * db_name
Definition: rules_table_service.cc:55
required string managed_type
Definition: replication_asynchronous_connection_failover.proto:48
required string managed_name
Definition: replication_asynchronous_connection_failover.proto:36
required string network_namespace
Definition: replication_asynchronous_connection_failover.proto:34
required uint64 weight
Definition: replication_asynchronous_connection_failover.proto:35
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
std::vector< RPL_FAILOVER_SOURCE_TUPLE > RPL_FAILOVER_SOURCE_LIST
Definition: rpl_async_conn_failover_table_operations.h:52
std::tuple< std::string, std::string, std::string, Json_wrapper > RPL_FAILOVER_MANAGED_JSON_TUPLE
Definition: rpl_async_conn_failover_table_operations.h:46
std::tuple< std::string, std::string, uint, std::string, uint, std::string > RPL_FAILOVER_SOURCE_TUPLE
Definition: rpl_async_conn_failover_table_operations.h:42
std::tuple< std::string, std::string, std::string, uint, uint > RPL_FAILOVER_MANAGED_TUPLE
Definition: rpl_async_conn_failover_table_operations.h:50
Definition: mysql_lex_string.h:40
thr_lock_type
Definition: thr_lock.h:51
@ TL_WRITE
Definition: thr_lock.h:92
unsigned int uint
Definition: uca9-dump.cc:75