18 #ifndef CONSUMER_RESTORE_HPP
19 #define CONSUMER_RESTORE_HPP
21 #include "consumer.hpp"
23 bool map_nodegroups(Uint32 *ng_array, Uint32 no_parts);
42 enum AttrConvType { ACT_UNSUPPORTED = 0, ACT_PRESERVING = 1, ACT_LOSSY =-1 };
43 typedef AttrConvType (*AttrCheckCompatFunc)(
const NDBCOL &old_col,
49 AttrCheckCompatFunc attr_check_compatability;
50 AttrConvertFunc attr_convert;
60 Uint32 parallelism=1) :
62 m_cluster_connection(NULL),
63 m_ndb_connectstring(ndb_connectstring),
64 m_ndb_nodeid(ndb_nodeid)
66 m_nodegroup_map = ng_map;
67 m_nodegroup_map_len = ng_map_len;
73 m_logBytes = m_dataBytes = 0;
74 m_logCount = m_dataCount = 0;
76 m_restore_meta =
false;
77 m_no_restore_disk =
false;
78 m_restore_epoch =
false;
79 m_parallelism = parallelism;
84 m_tableChangesMask = 0;
85 m_preserve_trailing_spaces =
false;
87 m_cache.m_old_table = 0;
88 m_disable_indexes =
false;
89 m_rebuild_indexes =
false;
93 virtual bool init(Uint32 tableChangesMask);
94 virtual void release();
95 virtual bool object(Uint32
type,
const void* ptr);
97 virtual bool endOfTables();
98 virtual void tuple(
const TupleS &, Uint32 fragId);
99 virtual void tuple_free();
103 Uint32 tableId, Uint64 value);
106 virtual void exitHandler();
107 virtual void endOfTuples();
108 virtual void logEntry(
const LogEntry &);
109 virtual void endOfLogEntrys();
110 virtual bool finalize_table(
const TableS &);
111 virtual bool rebuild_indexes(
const TableS&);
112 virtual bool has_temp_error();
113 virtual bool createSystable(
const TableS & table);
115 virtual bool column_compatible_check(
const char* tableName,
119 virtual bool report_started(
unsigned node_id,
unsigned backup_id);
120 virtual bool report_meta_data(
unsigned node_id,
unsigned backup_id);
121 virtual bool report_data(
unsigned node_id,
unsigned backup_id);
122 virtual bool report_log(
unsigned node_id,
unsigned backup_id);
123 virtual bool report_completed(
unsigned node_id,
unsigned backup_id);
124 void connectToMysql();
125 bool map_in_frm(
char *new_data,
const char *data,
126 uint data_len, uint *new_data_len);
127 bool search_replace(
char *search_str,
char **new_data,
128 const char **data,
const char *end_data,
130 bool map_nodegroups(Uint32 *ng_array, Uint32 no_parts);
131 Uint32 map_ng(Uint32 ng);
134 static AttrConvType check_compat_sizes(
const NDBCOL &old_col,
136 static AttrConvType check_compat_promotion(
const NDBCOL &old_col,
138 static AttrConvType check_compat_lossy(
const NDBCOL &old_col,
143 convert_bitset(
const void * source,
void * target,
bool &truncated);
146 template<
typename S,
typename T >
148 convert_array(
const void * source,
void * target,
bool & truncated);
152 template<
typename T,
typename S >
154 convert_integral(
const void * source,
void * target,
bool & truncated);
158 get_attr_check_compatability(
const NDBCOL::Type &old_type,
168 const char* m_ndb_connectstring;
172 bool m_no_restore_disk;
173 bool m_restore_epoch;
175 bool m_disable_indexes;
176 bool m_rebuild_indexes;
177 Uint32 m_tableChangesMask;
178 static bool m_preserve_trailing_spaces;
180 Uint32 m_n_tablespace;
181 Uint32 m_n_logfilegroup;
192 Uint32 m_parallelism;
193 volatile Uint32 m_transactions;