24#ifndef RPL_ASYNC_CONN_FAILOVER_TABLE_OPERATIONS_H
25#define RPL_ASYNC_CONN_FAILOVER_TABLE_OPERATIONS_H
38class SourceAndManagedList;
43 std::tuple<std::string, std::string, uint, std::string, uint, std::string>;
47 std::tuple<std::string, std::string, std::string, Json_wrapper>;
51 std::tuple<std::string, std::string, std::string, uint, uint>;
157 uint secondary_weight);
255 std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
277 std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
296 std::string channel_name, std::vector<RPL_FAILOVER_MANAGED_TUPLE> &rows);
314 static std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
331 std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
347 std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
366 std::vector<RPL_FAILOVER_MANAGED_JSON_TUPLE> &rows);
384 std::vector<RPL_FAILOVER_MANAGED_TUPLE> &rows);
418 const std::string
m_db{
"mysql"};
421 "replication_asynchronous_connection_failover"};
425 "replication_asynchronous_connection_failover_managed"};
453 const std::vector<uint> &field_index,
454 const std::vector<std::string> &field_name,
const T &field_value,
494 enum thr_lock_type lock_type,
const std::vector<uint> &field_index,
495 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:1153
Definition: rpl_async_conn_failover_table_operations.h:61
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:417
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:411
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:422
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:68
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:420
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:418
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:414
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:426
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:424
The class are wrappers for handler index and random scan functions to simplify their usage.
Definition: rpl_sys_table_access.h:45
ulong key_part_map
Definition: my_base.h:1008
const char * host
Definition: mysqladmin.cc:65
Definition: rpl_async_conn_failover_table_operations.h:37
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:53
std::tuple< std::string, std::string, std::string, Json_wrapper > RPL_FAILOVER_MANAGED_JSON_TUPLE
Definition: rpl_async_conn_failover_table_operations.h:47
std::tuple< std::string, std::string, uint, std::string, uint, std::string > RPL_FAILOVER_SOURCE_TUPLE
Definition: rpl_async_conn_failover_table_operations.h:43
std::tuple< std::string, std::string, std::string, uint, uint > RPL_FAILOVER_MANAGED_TUPLE
Definition: rpl_async_conn_failover_table_operations.h:51
Definition: mysql_lex_string.h:40
thr_lock_type
Definition: thr_lock.h:51
@ TL_WRITE
Definition: thr_lock.h:92