24#ifndef RPL_ASYNC_CONN_FAILOVER_TABLE_OPERATIONS_H
25#define RPL_ASYNC_CONN_FAILOVER_TABLE_OPERATIONS_H
39class SourceAndManagedList;
44 std::tuple<std::string, std::string, uint, std::string, uint, std::string>;
48 std::tuple<std::string, std::string, std::string, Json_wrapper>;
52 std::tuple<std::string, std::string, std::string, uint, uint>;
158 uint secondary_weight);
256 std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
278 std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
297 std::string channel_name, std::vector<RPL_FAILOVER_MANAGED_TUPLE> &rows);
315 static std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
332 std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
348 std::tuple<bool, std::vector<RPL_FAILOVER_SOURCE_TUPLE>>
367 std::vector<RPL_FAILOVER_MANAGED_JSON_TUPLE> &rows);
385 std::vector<RPL_FAILOVER_MANAGED_TUPLE> &rows);
419 const std::string
m_db{
"mysql"};
422 "replication_asynchronous_connection_failover"};
426 "replication_asynchronous_connection_failover_managed"};
454 const std::vector<uint> &field_index,
455 const std::vector<std::string> &field_name,
const T &field_value,
495 enum thr_lock_type lock_type,
const std::vector<uint> &field_index,
496 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:1150
Definition: rpl_async_conn_failover_table_operations.h:62
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:491
enum thr_lock_type m_lock_type
Definition: rpl_async_conn_failover_table_operations.h:418
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:511
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:350
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:541
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:190
static constexpr std::string_view Secondary_weight_key
Definition: rpl_async_conn_failover_table_operations.h:415
const uint m_table_failover_num_field
Definition: rpl_async_conn_failover_table_operations.h:423
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:268
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:581
Rpl_async_conn_failover_table_operations(enum thr_lock_type lock_type=TL_WRITE)
Construction.
Definition: rpl_async_conn_failover_table_operations.h:69
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:389
const std::string m_table_failover
Definition: rpl_async_conn_failover_table_operations.h:421
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:427
bool reset()
Delete all rows on replication_asynchronous_connection_failover_managed and replication_asynchronous_...
Definition: rpl_async_conn_failover_table_operations.cc:240
static constexpr std::string_view Primary_weight_key
Definition: rpl_async_conn_failover_table_operations.h:412
const std::string m_db
Definition: rpl_async_conn_failover_table_operations.h:419
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:529
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:316
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:96
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:55
std::tuple< bool, std::vector< RPL_FAILOVER_SOURCE_TUPLE > > read_source_all_rows()
Read all sources.
Definition: rpl_async_conn_failover_table_operations.cc:410
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:209
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:76
const uint m_table_managed_num_field
Definition: rpl_async_conn_failover_table_operations.h:427
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:163
virtual ~Rpl_async_conn_failover_table_operations()=default
const std::string m_table_managed
Definition: rpl_async_conn_failover_table_operations.h:425
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:38
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:54
std::tuple< std::string, std::string, std::string, Json_wrapper > RPL_FAILOVER_MANAGED_JSON_TUPLE
Definition: rpl_async_conn_failover_table_operations.h:48
std::tuple< std::string, std::string, uint, std::string, uint, std::string > RPL_FAILOVER_SOURCE_TUPLE
Definition: rpl_async_conn_failover_table_operations.h:44
std::tuple< std::string, std::string, std::string, uint, uint > RPL_FAILOVER_MANAGED_TUPLE
Definition: rpl_async_conn_failover_table_operations.h:52
thr_lock_type
Definition: thr_lock.h:51
@ TL_WRITE
Definition: thr_lock.h:92