16 #ifndef RPL_INFO_FACTORY_H
17 #define RPL_INFO_FACTORY_H
19 #ifdef HAVE_REPLICATION
25 #include "rpl_rli_pdb.h"
26 #include "rpl_info_file.h"
27 #include "rpl_info_table.h"
28 #include "rpl_info_dummy.h"
29 #include "rpl_info_handler.h"
31 extern ulong opt_mi_repository_id;
32 extern ulong opt_rli_repository_id;
34 class Rpl_info_factory
37 static bool create_coordinators(uint mi_option, Master_info **mi,
39 static Master_info *create_mi(uint rli_option);
40 static bool change_mi_repository(Master_info *mi,
const uint mi_option,
42 static Relay_log_info *create_rli(uint rli_option,
bool is_slave_recovery);
43 static bool change_rli_repository(
Relay_log_info *rli,
const uint rli_option,
45 static Slave_worker *create_worker(uint rli_option, uint worker_id,
47 bool is_gaps_collecting_phase);
54 char pattern[FN_REFLEN];
65 static struct_table_data rli_table_data;
66 static struct_file_data rli_file_data;
67 static struct_table_data mi_table_data;
68 static struct_file_data mi_file_data;
69 static struct_table_data worker_table_data;
70 static struct_file_data worker_file_data;
72 static void init_repository_metadata();
73 static bool decide_repository(
Rpl_info *info,
75 Rpl_info_handler **handler_src,
76 Rpl_info_handler **handler_dest,
78 static bool init_repositories(
const struct_table_data table_data,
79 const struct_file_data file_data,
82 Rpl_info_handler **handler_src,
83 Rpl_info_handler **handler_dest,
86 static enum_return_check check_src_repository(
Rpl_info *info,
88 Rpl_info_handler **handler_src);
89 static bool check_error_repository(
Rpl_info *info,
90 Rpl_info_handler *handler_src,
91 Rpl_info_handler *handler_dst,
92 enum_return_check err_src,
93 enum_return_check err_dst,
95 static bool init_repositories(
Rpl_info *info,
96 Rpl_info_handler **handler_src,
97 Rpl_info_handler **handler_dst,
99 static bool scan_repositories(uint* found_instances,
100 uint* found_rep_option,
101 const struct_table_data table_data,
102 const struct_file_data file_data,
const char **
msg);